1 \chapter{Program Scope Entries}
2 \label{chap:programscopeentries}
3 This section describes debugging information entries that
4 relate to different levels of program scope: compilation,
5 module, subprogram, and so on. Except for separate type
6 entries (see Section \refersec{chap:typeunitentries}),
7 these entries may be thought of as
8 ranges of text addresses within the program.
10 \section{Unit Entries}
11 \label{chap:unitentries}
12 A DWARF object file is an object file that contains one or more
13 DWARF compilation units, of which there are these kinds:
14 \addtoindexx{unit|see {compilation unit}}
15 \addtoindexx{compilation unit}
17 \item A \definition{full compilation unit} describes
18 a complete compilation, possibly in combination with
19 related partial compilation units and/or type units.
21 \item A \definition{partial compilation unit} describes
22 a part of a compilation (generally corresponding to an
23 imported module) which is imported into one or more
24 related full compilation units.
26 \item A \definition{type unit} is a specialized unit
27 (similar to a compilation unit) that represents a type
28 whose description may be usefully shared by multiple
32 \index{conventional compilation unit|see{
33 full compilation unit, partial compilation unit, type unit}}
35 \textit{These first three kinds of compilation unit are
36 sometimes called \doublequote{conventional} compilation
37 units--they are kinds of compilation units that were
38 defined prior to \DWARFVersionV. Conventional compilation units
39 are part of the same object file as the compiled code and
40 data (whether relocatable, executable, shared and so on).
41 The word \doublequote{conventional} is usually
42 omitted in these names, unless needed to distinguish them
43 from the similar split compilation units below.}
47 \item A \definition{skeleton compilation unit} represents
48 the DWARF debugging information for a compilation using a
49 minimal description that identifies a separate split
50 compilation unit that provides the remainder (and most)
54 \textit{A skeleton compilation acts as a minimal conventional full
55 compilation (see above) that identifies and is paired with a
56 corresponding split full compilation (as described below). Like
57 the conventional compilation units, a skeleton compilation unit
58 is part of the same object file as the compiled code and data.}
62 \definition{split compilation unit} describes
63 a complete compilation, possibly in combination with
64 related type compilation units. It corresponds
65 to a specific skeleton compilation unit.
67 \item A \definition{split type unit} is a specialized
68 compilation unit that represents a type whose description may
69 be usefully shared by multiple other units.
73 \textit{Split compilation units and split type units may be
74 contained in object files separate from those containing the
75 program code and data.
76 These object files are not processed by a linker; thus,
77 split units do not depend on underlying object file relocations.}
79 \textit{Either a full compilation unit or a partial compilation
80 unit may be logically incorporated into another compilation unit
81 using an \addtoindex{imported unit entry}
82 (see Section \refersec{chap:importedunitentries}).}
85 combined split and partial
86 compilation unit kind is not defined.}
88 \textit{In the remainder of this document, the word
89 \doublequote{compilation} in the phrase \doublequote{compilation unit}
90 is generally omitted, unless it is deemed needed for clarity
93 \subsection{Full and Partial Compilation Unit Entries}
94 \label{chap:fullandpartialcompilationunitentries}
95 A \addtoindex{full compilation unit}\addtoindexx{compilation unit!full}
96 is represented by a debugging information entry with the tag
97 \DWTAGcompileunitTARG.
98 A \addtoindex{partial compilation unit}\addtoindexx{compilation unit!partial}
99 is represented by a debugging information entry with the tag
100 \DWTAGpartialunitTARG.
103 In a simple compilation, a single compilation unit with
105 \DWTAGcompileunit{} represents a complete object file
107 \DWTAGpartialunit{} (as well as tag \DWTAGtypeunit) is not used.
109 employing the DWARF space compression and duplicate elimination
111 Appendix \refersec{app:usingcompilationunits},
112 multiple compilation units using
115 \DWTAGpartialunit{} and/or
117 are used to represent portions of an object file.
119 \textit{A full compilation unit typically represents the text and
120 data contributed to an executable by a single relocatable
121 object file. It may be derived from several source files,
122 including pre-processed header files.
123 A \addtoindex{partial compilation unit} typically represents a part
124 of the text and data of a relocatable object file, in a manner that
125 can potentially be shared with the results of other compilations
126 to save space. It may be derived from an \doublequote{include file,}
127 template instantiation, or other implementation-dependent
128 portion of a compilation. A full compilation unit can also
129 function in a manner similar to a partial compilation unit
131 See Appendix \refersec{app:dwarfcompressionandduplicateeliminationinformative}
132 for discussion of related compression techniques.}
134 A compilation unit entry owns debugging information
135 entries that represent all or part of the declarations
136 made in the corresponding compilation. In the case of a
137 partial compilation unit, the containing scope of its owned
138 declarations is indicated by imported unit entries in one
139 or more other compilation unit entries that refer to that
140 partial compilation unit (see
141 Section \refersec{chap:importedunitentries}).
143 Compilation unit entries may have the following
145 \begin{enumerate}[1. ]
146 \item Either a \DWATlowpc{} and
147 \DWAThighpc{} pair of
148 \addtoindexx{high PC attribute}
150 \addtoindexx{low PC attribute}
152 \addtoindexx{ranges attribute}
154 \DWATranges{} attribute
155 \addtoindexx{ranges attribute}
157 \addtoindexx{discontiguous address ranges|see{non-contiguous address ranges}}
159 non-contiguous address ranges, respectively,
160 of the machine instructions generated for the compilation
161 unit (see Section \refersec{chap:codeaddressesandranges}).
163 A \DWATlowpc{} attribute
164 may also be specified in combination
165 \addtoindexx{ranges attribute}
167 \DWATranges{} to specify the
168 \addtoindexx{ranges attribute}
169 default base address for use in
170 \addtoindexx{location list}
171 location lists (see Section
172 \refersec{chap:locationlists}) and range lists
173 \addtoindexx{range list}
174 (see Section \refersec{chap:noncontiguousaddressranges}).
176 \item \hypertarget{chap:DWATnamepathnameofcompilationsource}{}
177 A \DWATnameDEFN{} attribute \addtoindexx{name attribute}
178 whose value is a null-terminated string
179 containing the full or relative path name
180 (relative to the value of the \DWATcompdir{} attribute,
181 see below) of the primary
182 source file from which the compilation unit was derived.
184 \item \hypertarget{chap:DWATlanguageprogramminglanguage}{}
185 A \DWATlanguageDEFN{} attribute\addtoindexx{language attribute}
186 whose constant value is an integer code
187 indicating the source language of the compilation
188 unit. The set of language names and their meanings are given
189 in Table \refersec{tab:languagenames}.
192 \setlength{\extrarowheight}{0.1cm}
193 \begin{longtable}{l|l}
194 \caption{Language names} \label{tab:languagenames} \\
195 \hline \bfseries Language name & \bfseries Meaning \\ \hline
197 \bfseries Language name & \bfseries Meaning \\ \hline
199 \hline \emph{Continued on next page}
202 \addtoindexx{ISO-defined language names}
203 \DWLANGAdaeightythreeTARG{} \dag & ISO Ada:1983 \addtoindexx{Ada:1983 (ISO)} \\
204 \DWLANGAdaninetyfiveTARG{} \dag & ISO Ada:1995 \addtoindexx{Ada:1995 (ISO)} \\
205 \DWLANGCTARG & Non-standardized C, such as K\&R \addtoindexx{C!non-standard}\\
206 \DWLANGCeightynineTARG & ISO C:1989 \addtoindexx{C:1989 (ISO)} \\
207 \DWLANGCninetynineTARG & ISO C:1999 \addtoindexx{C:1999 (ISO)} \\
208 \DWLANGCelevenTARG & ISO C:2011 \addtoindexx{C:2011 (ISO)} \\
209 \DWLANGCplusplusTARG & ISO C++98 \addtoindexx{C++98 (ISO)} \\
210 \DWLANGCpluspluszerothreeTARG & ISO C++03 \addtoindexx{C++03 (ISO)} \\
211 \DWLANGCpluspluselevenTARG & ISO C++11 \addtoindexx{C++11 (ISO)} \\
212 \DWLANGCplusplusfourteenTARG & ISO C++14 \addtoindexx{C++14 (ISO)}
214 \DWLANGCobolseventyfourTARG & ISO COBOL:1974 \addtoindexx{COBOL:1974 (ISO)} \\
215 \DWLANGCoboleightyfiveTARG & ISO COBOL:1985 \addtoindexx{COBOL:1985 (ISO)} \\
216 \DWLANGDTARG{}~\dag & D \addtoindexx{D language} \\
217 \DWLANGDylanTARG~\dag & Dylan \addtoindexx{Dylan} \\
218 \DWLANGFortranseventysevenTARG & ISO FORTRAN:1977 \addtoindexx{FORTRAN:1977 (ISO)} \\
219 \DWLANGFortranninetyTARG & ISO Fortran:1990 \addtoindexx{Fortran:1990 (ISO)} \\
220 \DWLANGFortranninetyfiveTARG & ISO Fortran:1995 \addtoindexx{Fortran:1995 (ISO)} \\
221 \DWLANGFortranzerothreeTARG & ISO Fortran:2004 \addtoindexx{Fortran:2004 (ISO)} \\
222 \DWLANGFortranzeroeightTARG & ISO Fortran:2010 \addtoindexx{Fortran:2010 (ISO)} \\
223 \DWLANGGoTARG{}~\dag & \addtoindex{Go} \\
224 \DWLANGHaskellTARG{} \dag & \addtoindex{Haskell} \\
225 \DWLANGJavaTARG{} & \addtoindex{Java}\\
226 \DWLANGJuliaTARG{}~\dag & \addtoindex{Julia} \\
227 \DWLANGModulatwoTARG & ISO Modula\dash 2:1996 \addtoindexx{Modula-2:1996 (ISO)} \\
228 \DWLANGModulathreeTARG & \addtoindex{Modula-3} \\
229 \DWLANGObjCTARG{} & \addtoindex{Objective C} \\
230 \DWLANGObjCplusplusTARG{} & \addtoindex{Objective C++} \\
231 \DWLANGOCamlTARG{}~\dag & \addtoindex{OCaml}\index{Objective Caml|see{OCaml}} \\
232 \DWLANGOpenCLTARG{}~\dag & \addtoindex{OpenCL} \\
233 \DWLANGPascaleightythreeTARG & ISO Pascal:1983 \addtoindexx{Pascal:1983 (ISO)} \\
234 \DWLANGPLITARG{}~\dag & ANSI PL/I:1976 \addtoindexx{PL/I:1976 (ANSI)} \\
235 \DWLANGPythonTARG{}~\dag & \addtoindex{Python} \\
236 \DWLANGRenderScriptTARG~\dag & \addtoindex{RenderScript Kernal Language}
238 \DWLANGRustTARG{}~\dag & \addtoindex{Rust} \\
240 & \addtoindex{Swift} \\
241 \DWLANGUPCTARG{} & UPC (Unified Parallel C) \addtoindexx{UPC}
242 \index{Unified Parallel C|see{UPC}} \\
244 \dag \ \ \textit{Support for these languages is limited}& \\
249 \item \hypertarget{chap:DWATstmtlistlinenumberinformationforunit}{}
250 A \DWATstmtlistDEFN{}\addtoindexx{statement list attribute}
251 attribute whose value is a
252 \addtoindexx{section offset!in statement list attribute}
253 section offset to the line number information for this compilation
256 This information is placed in a separate object file
257 section from the debugging information entries themselves. The
258 value of the statement list attribute is the offset in the
259 \dotdebugline{} section of the first byte of the line number
260 information for this compilation unit
261 (see Section \refersec{chap:linenumberinformation}).
263 \item A \DWATmacrosDEFN{}\hypertarget{chap:DWATmacrosmacroinformation}{}
265 \addtoindexx{macro information attribute}
267 \addtoindexx{section offset!in macro information attribute}
268 section offset to the macro information for this compilation unit.
270 This information is placed in a separate object file section
271 from the debugging information entries themselves. The
272 value of the macro information attribute is the offset in
273 the \dotdebugmacro{} section of the first byte of the macro
274 information for this compilation unit
275 (see Section \refersec{chap:macroinformation}).
277 \textit{The \DWATmacrosNAME{} attribute is new in \DWARFVersionV,
279 \DWATmacroinfoDEFN{} attribute of earlier DWARF versions.
280 \livetarg{chap:DWATmacroinfomacroinformation}{}
281 While \DWATmacrosNAME{} and \DWATmacroinfoNAME{} attributes cannot both occur in the same
282 compilation unit, both may be found in the set of units that make up an executable
283 or shared object file. The two attributes have distinct encodings to facilitate such
287 \item \hypertarget{chap:DWATcompdircompilationdirectory}{}
288 A \DWATcompdirDEFN{} attribute\addtoindexx{compilation directory attribute}
290 null-terminated string containing the current working directory
291 of the compilation command that produced this compilation
292 unit in whatever form makes sense for the host system.
294 \item \hypertarget{chap:DWATproducercompileridentification}{}
295 A \DWATproducerDEFN{} attribute\addtoindexx{producer attribute}
296 whose value is a null-terminated string containing
297 information about the compiler that produced the compilation unit.
300 \textit{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 will avoid confusion
304 with other producer values.}
308 \item \hypertarget{chap:DWATidentifiercaseidentifiercaserule}{}
309 A \DWATidentifiercaseDEFN{} attribute
310 \addtoindexx{identifier case attribute} whose integer
311 constant value is a code describing the treatment
312 of identifiers within this compilation unit. The
313 set of identifier case codes is given in
314 Table \refersec{tab:identifiercasecodes}.
316 \begin{simplenametable}{Identifier case codes}{tab:identifiercasecodes}
317 \DWIDcasesensitive{} \\
320 \DWIDcaseinsensitive{} \\
321 \end{simplenametable}
323 \DWIDcasesensitiveTARG{} is the default for all compilation units
324 that do not have this attribute. It indicates that names given
325 as the values of \DWATname{} attributes
326 \addtoindexx{name attribute}
327 in debugging information
328 entries for the compilation unit reflect the names as they
329 appear in the source program.
332 \textit{A debugger should be sensitive
333 to the case of \addtoindex{identifier names} when doing identifier
338 \DWIDupcaseTARG{} means that the
339 producer of the debugging
340 information for this compilation unit converted all source
341 names to upper case. The values of the name attributes may not
342 reflect the names as they appear in the source program.
345 \textit{A debugger should convert all names to upper case
349 \DWIDdowncaseTARG{} means that the producer of the debugging
350 information for this compilation unit converted all source
351 names to lower case. The values of the name attributes may not
352 reflect the names as they appear in the source program.
355 \textit{A debugger should convert all names to lower case
360 \DWIDcaseinsensitiveTARG{} means that the values of the name
361 attributes reflect the names as they appear in the source
362 program but that case is not significant.
365 \textit{A debugger should ignore case when doing lookups.}
370 \item \hypertarget{chap:DWATbasetypesprimitivedatatypesofcompilationunit}{}
371 A \DWATbasetypesDEFN{} attribute\addtoindexx{base types attribute}
372 whose value is a \livelink{chap:classreference}{reference}.
373 This attribute points to a debugging information entry
374 representing another compilation unit. It may be used
375 to specify the compilation unit containing the base type
376 entries used by entries in the current compilation unit
377 (see Section \refersec{chap:basetypeentries}).
380 \textit{This attribute provides a consumer a way to find the definition
381 of base types for a compilation unit that does not itself
382 contain such definitions. This allows a consumer, for example,
383 to interpret a type conversion to a base type correctly.}
385 \item \hypertarget{chap:DWATuseUTF8compilationunitusesutf8strings}{}
386 A \DWATuseUTFeightDEFN{} attribute,
387 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
388 which is a \livelink{chap:classflag}{flag} whose
389 presence indicates that all strings (such as the names of
390 declared entities in the source program, or filenames in the line number table)
391 are represented using the UTF-8 representation.
395 \hypertarget{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}{}
396 A \DWATmainsubprogramDEFN{} attribute,\addtoindexx{main subprogram attribute}
397 which is a \livelink{chap:classflag}{flag},
398 whose presence indicates that the compilation unit contains a
399 subprogram that has been identified as the starting
400 subprogram of the program. If more than one compilation unit contains
401 this \nolink{flag}, any one of them may contain the starting
404 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
406 to specify and provide a user-specified name for the main
407 subroutine of a program.
408 \addtoindex{C} uses the name \doublequote{main} to identify
409 the main subprogram of a program. Some other languages provide
410 similar or other means to identify the main subprogram of
411 a program. The \DWATmainsubprogram{} attribute may also be used to
412 identify such subprograms (see
413 Section \refersec{chap:generalsubroutineandentrypointinformation}).}
416 \hypertarget{chap:DWATentrypcofcompileunit}{}
417 \hypertarget{chap:DWATentrypcofpartialunit}{}
418 A \DWATentrypc{} attribute whose value is the address of the first
419 \addtoindexx{entry pc attribute}
420 executable instruction of the unit (see
421 Section \refersec{chap:entryaddress}).
424 \item \hypertarget{chap:DWATstroffsetbaseforindirectstringtable}{}
425 A \DWATstroffsetsbaseDEFN\addtoindexx{string offset base attribute}
426 attribute, whose value is of class \CLASSstroffsetsptr.
427 This attribute points to the first string
428 offset of the compilation unit's contribution to the
429 \dotdebugstroffsets{} (or \dotdebugstroffsetsdwo{}) section.
430 Indirect string references
431 (using \DWFORMstrx) within the compilation unit are
432 interpreted as indices relative to this base.
435 \item \hypertarget{chap:DWATaddrbaseforaddresstable}{}
436 A \DWATaddrbaseDEFN\addtoindexx{address table base attribute}
437 attribute, whose value is of class \CLASSaddrptr.
438 This attribute points to the beginning of the compilation
439 unit's contribution to the \dotdebugaddr{} section.
440 Indirect references (using \DWFORMaddrx, \DWOPaddrx,
442 \DWOPconstx, \DWLLEbaseaddressx{},
443 \DWLLEstartxendx{} or \DWLLEstartxlength)
445 within the compilation unit are interpreted as indices
446 relative to this base.
449 \item \hypertarget{chap:DWATrnglistsbaseforrnglists}{}
451 A \DWATrnglistsbaseDEFN\addtoindexx{ranges table base attribute}
452 attribute, whose value is of class \CLASSrnglistsptr.
453 This attribute points to the base of the compilation
454 unit's contribution to the \dotdebugrnglists{} section.
455 References to range lists (using \DWFORMrnglistx)
456 within the compilation unit are
457 interpreted relative to this base.
460 \item \hypertarget{chap:DWATloclistsbaseinlocationlist}{}
462 A \DWATloclistsbase{}\addtoindexx{location table base attribute}
463 attribute, whose value is of class \CLASSloclistsptr.
464 This attribute points to the base of the compilation
465 unit’s contribution to the \dotdebugloclists{} section. References
466 to location lists (using \DWFORMloclistx) within the compilation
467 unit are interpreted relative to this base.
471 The base address of a compilation unit is defined as the
472 value of the \DWATlowpc{} attribute, if present; otherwise,
473 it is undefined. If the base address is undefined, then any
474 DWARF entry or structure defined in terms of the base address
475 of that compilation unit is not valid.
478 \subsection{Skeleton Compilation Unit Entries}
479 \label{chap:skeletoncompilationunitentries}
480 \addtoindexx{compilation unit!skeleton}
481 \addtoindexx{skeleton compilation unit}
482 When generating a \splitDWARFobjectfile{} (see
483 Section \refersec{datarep:splitdwarfobjectfiles}), the
484 compilation unit in the \dotdebuginfo{} section is a "skeleton"
485 compilation unit with the tag
486 \DWTAGskeletonunitTARG, which contains a
487 \DWATdwoname{} attribute as well as a subset of the
488 attributes of a full or partial compilation unit. In general,
489 it contains those attributes that are necessary for the consumer
490 to locate the object file where the split full compilation unit
491 can be found, and for the consumer to interpret references to
492 addresses in the program.
495 A skeleton compilation unit has no children.
497 A skeleton compilation unit has a \DWATdwoname{} attribute:
499 \begin{enumerate}[1. ]
501 \item \livetarg{chap:DWATdwonameforunit}{}
502 A \DWATdwonameDEFN{} attribute
503 \addtoindexx{split DWARF object file name attribute}
505 null-terminated string containing the full or relative
506 path name (relative to the value of the \DWATcompdir{} attribute,
507 see below) of the object file that contains the full
510 The value in the \HFNdwoid{} field of the unit header for
511 this unit is the same as the value in the \HFNdwoid{} field
512 of the unit header of the corresponding full compilation
513 unit (see Section \refersec{datarep:unitheaders}).
515 \textit{The means of determining a compilation unit ID does
516 not need to be similar or related to the means of
517 determining a \TUsignature. However, it should
518 be suitable for detecting file version skew or other
519 kinds of mismatched files and for looking up a full
520 split unit in a DWARF package file
521 (see Section \refersec{datarep:dwarfpackagefiles}).}
525 A skeleton compilation unit may have additional attributes,
526 which are the same as for conventional compilation unit entries
527 except as noted, from among the following:
528 \begin{enumerate}[1. ]
529 \addtocounter{enumi}{1}
530 \item Either a \DWATlowpc{} and \DWAThighpc{} pair of attributes
531 or a \DWATranges{} attribute.
532 \item A \DWATstmtlist{} attribute.
533 \item A \DWATcompdir{} attribute.
536 \item A \DWATuseUTFeight{} attribute.
538 \textit{This attribute applies to strings referred to by the skeleton
539 compilation unit entry itself, and strings in the associated line
541 The representation for strings in the object file referenced
542 by the \DWATdwoname{} attribute is determined by the presence
543 of a \DWATuseUTFeight{} attribute in the full compilation unit
544 (see Section \refersec{chap:splitfullcompilationunitentries}).}
546 \item A \DWATstroffsetsbase{} attribute, for indirect strings references
547 from the skeleton compilation unit.
548 \item A \DWATaddrbase{} attribute.
554 All other attributes of a compilation unit entry (described
555 in Section \refersec{chap:fullandpartialcompilationunitentries})
559 placed in the split full compilation unit
560 (see \refersec{chap:splitfullcompilationunitentries}).
561 The attributes provided by the skeleton compilation
562 unit entry do not need to be repeated in the full compilation
565 \textit{The \DWATaddrbase{}
567 and \DWATstroffsetsbase{} attributes provide context that may be
568 necessary to interpret the contents
569 of the corresponding \splitDWARFobjectfile.}
571 \textit{The \DWATbasetypes{} attribute is not defined for a
572 skeleton compilation unit.}
575 \subsection{Split Full Compilation Unit Entries}
576 \label{chap:splitfullcompilationunitentries}
577 A \definition{split full compilation unit} is represented by a
578 debugging information entry with tag \DWTAGcompileunit.
579 It is very similar to a conventional full compilation unit but
580 is logically paired with a specific skeleton compilation unit while
581 being physically separate.
583 A split full compilation unit
584 may have the following attributes,
585 which are the same as for conventional compilation unit entries
587 \begin{enumerate}[1. ]
588 \item A \DWATname{} attribute.
589 \item A \DWATlanguage{} attribute.
590 \item A \DWATmacros{} attribute.
591 The value of this attribute is of class \CLASSmacptr{}, which is
592 an offset relative to the \dotdebugmacrodwo{} section.
594 \item A \DWATproducer{} attribute.
595 \item A \DWATidentifiercase{} attribute.
596 \item A \DWATmainsubprogram{} attribute.
597 \item A \DWATentrypc{} attribute.
598 \item A \DWATuseUTFeight{} attribute.
602 \textit{The following attributes are not part of a
603 split full compilation unit entry but instead are inherited
604 (if present) from the corresponding skeleton compilation unit:
605 \DWATlowpc, \DWAThighpc, \DWATranges, \DWATstmtlist, \DWATcompdir,
606 \DWATstroffsetsbase, \DWATaddrbase{} and
608 \DWATrnglistsbase.\eb}
610 \textit{The \DWATbasetypes{} attribute is not defined for a
611 split full compilation unit.}
615 \subsection{Type Unit Entries}
616 \label{chap:typeunitentries}
617 \addtoindexx{type unit}
618 \addtoindexx{type unit|see{\textit{also} compilation unit}}
619 \addtoindexx{compilation unit!\textit{see also} type unit}
620 An object file may contain any number of separate type
621 unit entries, each representing a single complete type
623 Each \addtoindex{type unit} must be uniquely identified by
624 an 8-byte signature, stored as part of the type unit, which
625 can be used to reference the type definition from debugging
626 information entries in other compilation units and type units.
628 Conventional and split type units are identical except for
629 the sections in which they are represented
630 (see \refersec{datarep:splitdwarfobjectfiles} for details).
631 \addtoindexx{conventional type unit}
632 \addtoindexx{split type unit}
633 Moreover, the \DWATstroffsetsbase{} attribute (see below) is not
634 used in a split type unit.
636 A type unit is represented by a debugging information entry
637 with the tag \DWTAGtypeunitTARG.
638 A \addtoindex{type unit entry} owns debugging
639 information entries that represent the definition of a single
640 type, plus additional debugging information entries that may
641 be necessary to include as part of the definition of the type.
644 A type unit entry may have the following attributes:
645 \begin{enumerate}[1. ]
648 \DWATlanguage{} attribute,
650 \addtoindexx{language attribute}
651 constant value is an integer code indicating the source
652 language used to define the type. The set of language names
653 and their meanings are given in Table \refersec{tab:languagenames}.
656 \item A \DWATstmtlist{} attribute\addtoindexx{statement list attribute}
657 whose value of class \CLASSlineptr{} points to the line number
658 information for this type unit.
660 \textit{Because type units do not describe any code, they
661 do not actually need a line number table, but the line number
662 headers contain a list of directories and file names that
663 may be referenced by the \DWATdeclfile{} attribute of the
664 type or part of its description.}
666 \textit{In an object file with a conventional compilation
667 unit entry, the type unit entries may refer to (share) the
668 line number table used by the compilation unit. In a type
669 unit located in a split compilation unit, the
670 \DWATstmtlistNAME{} attribute refers to a \doublequote{specialized}
671 line number table in the \dotdebuglinedwo{} section, which
672 contains only the list of directories and file names.}
674 \textit{All type unit entries in a \splitDWARFobjectfile{} may
675 (but are not required to) refer to the same
676 \addtoindex{specialized line number table}.}
678 \item A \DWATuseUTFeight{} attribute, which is a flag
679 whose presence indicates that all strings referred to by this type
680 unit entry, its children, and its associated
681 \addtoindex{specialized line number table},
682 are represented using the UTF-8 representation.
685 \DWATstroffsetsbase\addtoindexx{string offsets base attribute}
686 attribute, whose value is of class \CLASSstroffsetsptr.
687 This attribute points
688 to the first string offset of the type unit's contribution to
689 the \dotdebugstroffsets{} section. Indirect string references
690 (using \DWFORMstrx) within the type unit are interpreted
691 as indices relative to this base.
695 A \addtoindex{type unit} entry for a given type T owns a debugging
696 information entry that represents a defining declaration
697 of type T. If the type is nested within enclosing types or
698 namespaces, the debugging information entry for T is nested
699 within debugging information entries describing its containers;
700 otherwise, T is a direct child of the type unit entry.
702 A type unit entry may also own additional debugging information
703 entries that represent declarations of additional types that
704 are referenced by type T and have not themselves been placed in
705 separate type units. Like T, if an additional type U is nested
706 within enclosing types or namespaces, the debugging information
707 entry for U is nested within entries describing its containers;
708 otherwise, U is a direct child of the type unit entry.
710 The containing entries for types T and U are declarations,
711 and the outermost containing entry for any given type T or
712 U is a direct child of the type unit entry. The containing
713 entries may be shared among the additional types and between
714 T and the additional types.
716 \textit{Examples of these kinds of relationships are found in
717 Section \refersec{app:signaturecomputationexample} and
718 Section \refersec{app:declarationscompletingnondefiningdeclarations}.}
721 \textit{Types are not required to be placed in type units. In general,
722 only large types such as structure, class, enumeration, and
723 union types included from header files should be considered
724 for separate type units. Base types and other small types
725 are not usually worth the overhead of placement in separate
726 type units. Types that are unlikely to be replicated, such
727 as those defined in the main source file, are also better
728 left in the main compilation unit.}
730 \section{Module, Namespace and Importing Entries}
731 \textit{Modules and namespaces provide a means to collect related
732 entities into a single entity and to manage the names of
736 \subsection{Module Entries}
737 \label{chap:moduleentries}
738 \textit{Several languages have the concept of a \doublequote{module.}
739 \addtoindexx{Modula-2}
740 A Modula\dash 2 definition module
741 \addtoindexx{Modula-2!definition module}
742 may be represented by a module
744 \addtoindex{declaration attribute}
745 (\DWATdeclaration). A
746 \addtoindex{Fortran 90} module
747 \addtoindexx{Fortran!module (Fortran 90)}
748 may also be represented by a module entry
749 (but no declaration attribute is warranted because \addtoindex{Fortran}
750 has no concept of a corresponding module body).}
752 A module is represented by a debugging information entry
754 tag \DWTAGmoduleTARG.
755 Module entries may own other
756 debugging information entries describing program entities
757 whose declaration scopes end at the end of the module itself.
759 If the module has a name, the module entry has a
760 \DWATname{} attribute
761 \addtoindexx{name attribute}
762 whose value is a null\dash terminated string containing
765 The \addtoindex{module entry} may have either a
769 \addtoindexx{high PC attribute}
771 \addtoindexx{low PC attribute}
773 \DWATranges{} attribute
774 \addtoindexx{ranges attribute}
775 whose values encode the contiguous or non-contiguous address
776 ranges, respectively, of the machine instructions generated for
777 the module initialization
778 code\hypertarget{chap:DWATentrypcentryaddressofmoduleinitialization}{}
779 (see Section \refersec{chap:codeaddressesandranges}).
781 \addtoindexx{entry PC attribute!for module initialization}
782 \DWATentrypc{} attribute whose value is the address of
783 the first executable instruction of that initialization code
784 (see Section \refersec{chap:entryaddress}).
787 If\hypertarget{chap:DWATprioritymodulepriority}{}
788 the module has been assigned a priority, it may have a
789 \addtoindexx{priority attribute}
790 \DWATpriorityDEFN{} attribute.
791 The value of this attribute is a
792 reference to another debugging information entry describing
793 a variable with a constant value. The value of this variable
794 is the actual constant value of the module\textquoteright s priority,
795 represented as it would be on the target architecture.
797 \subsection{Namespace Entries}
798 \label{chap:namespaceentries}
799 \textit{\addtoindex{C++} has the notion of a namespace, which provides a way to
800 \addtoindexx{namespace (C++)}
801 implement name hiding, so that names of unrelated things
802 do not accidentally clash in the
803 \addtoindex{global namespace} when an
804 application is linked together.}
806 A namespace is represented by a debugging information entry
807 with the tag \DWTAGnamespaceTARG. A namespace extension
808 is\hypertarget{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}{}
809 represented by a \DWTAGnamespaceNAME{} entry with a
810 \DWATextensionDEFN{}\addtoindexx{extension attribute}
811 attribute referring to the previous extension, or if there
812 is no previous extension, to the original
813 \DWTAGnamespaceNAME{}
814 entry. A namespace extension entry does not need to duplicate
815 information in a previous extension entry of the namespace
816 nor need it duplicate information in the original namespace
817 entry. (Thus, for a namespace with a name,
818 a \DWATname{} attribute
819 \addtoindexx{name attribute}
820 need only be attached directly to the original
821 \DWTAGnamespaceNAME{} entry.)
824 Namespace and namespace extension entries may own
825 \addtoindexx{namespace extension entry}
827 \addtoindexx{namespace declaration entry}
828 debugging information entries describing program entities
829 whose declarations occur in the namespace.
831 A namespace may have a
832 \DWATexportsymbolsDEFN{}\livetarg{chap:DWATexportsymbolsofnamespace}{}
833 attribute\addtoindexx{export symbols attribute}
834 \addtoindexx{inline namespace|see{\textit{also} export symbols attribute}}
835 which is a \CLASSflag{} which
836 indicates that all member names defined within the
837 namespace may be referenced as if they were defined within
838 the containing namespace.
840 \textit{This may be used to describe an \addtoindex{inline namespace} in \addtoindex{C++}}.
842 If a type, variable, or function declared in a namespace is
843 defined outside of the body of the namespace declaration,
844 that type, variable, or function definition entry has a
845 \DWATspecification{} attribute
846 \addtoindexx{specification attribute}
847 whose value is a \livelink{chap:classreference}{reference} to the
848 debugging information entry representing the declaration of
849 the type, variable or function. Type, variable, or function
851 \DWATspecification{} attribute
852 \addtoindexx{specification attribute}
854 to duplicate information provided by the declaration entry
855 referenced by the specification attribute.
857 \textit{The \addtoindex{C++} \addtoindex{global namespace}
859 \addtoindexx{global namespace|see{namespace (C++), global}}
861 \addtoindexx{namespace (C++)!global}
863 \texttt{::f}, for example) is not explicitly represented in
864 DWARF with a namespace entry (thus mirroring the situation
865 in \addtoindex{C++} source).
866 Global items may be simply declared with no
867 reference to a namespace.}
869 \textit{The \addtoindex{C++}
870 compilation unit specific \doublequote{unnamed namespace} may
871 \addtoindexx{namespace (C++)!unnamed}
872 \addtoindexx{unnamed namespace|see {namespace (C++), unnamed}}
873 be represented by a namespace entry with no name attribute in
874 the original namespace declaration entry (and therefore no name
875 attribute in any namespace extension entry of this namespace).
877 C++ states that declarations in the unnamed namespace are
878 implicitly available in the containing scope; a producer
879 should make this effect explicit with the \DWATexportsymbols{}
880 attribute, or by using a \DWTAGimportedmodule{} that is a
881 sibling of the namespace entry and references it.
885 \textit{A compiler emitting namespace information may choose to
886 explicitly represent namespace extensions, or to represent the
887 final namespace declaration of a compilation unit; this is a
888 quality-of-implementation issue and no specific requirements
889 are given here. If only the final namespace is represented,
890 \addtoindexx{namespace (C++)!using declaration}
891 it is impossible for a debugger to interpret using declaration
892 references in exactly the manner defined by the
893 \addtoindex{C++} language.}
895 \textit{For \addtoindex{C++} namespace examples,
896 see Appendix \refersec{app:namespaceexamples}.}
900 \subsection{Imported (or Renamed) Declaration Entries}
901 \label{chap:importedorrenameddeclarationentries}
903 \textit{Some languages support the concept of importing into or
904 making accessible in a given unit certain declarations that occur
905 in a different module or scope. An imported declaration may
906 sometimes be given another name.}
909 An imported declaration is represented by one or
910 \addtoindexx{imported declaration entry}
911 more debugging information entries with the
912 tag \DWTAGimporteddeclarationTARG.
913 When\hypertarget{chap:DWATimportimporteddeclaration}{}
914 an overloaded entity is imported, there is one imported
915 declaration entry for each overloading.
916 Each imported declaration entry has a
917 \DWATimportDEFN{} attribute,\addtoindexx{import attribute}
918 whose value is a \livelink{chap:classreference}{reference} to the
919 debugging information entry representing the declaration that
922 An imported declaration may also have a \DWATname{}
923 attribute\addtoindexx{name attribute}
924 whose value is a null-terminated string containing the
926 imported entity is to be known in the context of the imported
927 declaration entry (which may be different than the name of
928 the entity being imported). If no name is present, then the
929 name by which the entity is to be known is the same as the
930 name of the entity being imported.
932 An imported declaration entry with a name attribute may be
933 used as a general means to rename or provide an alias for
934 \addtoindexx{alias declaration|see{imported declaration entry}}
935 an entity, regardless of the context in which the importing
936 declaration or the imported entity occurs.
938 \textit{A \addtoindex{C++}
939 namespace alias\hypertarget{chap:DWATimportnamespacealias}{}
940 may be represented by an imported declaration entry
941 \addtoindexx{namespace (C++)!alias}
942 with a name attribute whose value is
943 a null-terminated string containing the alias name
944 and a \DWATimportDEFN{} attribute
945 whose value is a \livelink{chap:classreference}{reference} to the
946 applicable original namespace or namespace extension entry.}
948 \textit{A \addtoindex{C++} using declaration may be represented
950 imported\hypertarget{chap:DWATimportnamespaceusingdeclaration}{}
951 \addtoindexx{namespace (C++)!using declaration}
952 declaration entries. When the using declaration
953 refers to an overloaded function, there is one imported
954 declaration entry corresponding to each overloading. Each
955 imported declaration entry has no name attribute but it does
956 have a \DWATimportDEFN{} attribute that refers to the entry for the
957 entity being imported. (\addtoindex{C++}
958 provides no means to \doublequote{rename}
959 an imported entity, other than a namespace).}
962 \textit{A \addtoindex{Fortran} use statement
963 \addtoindexx{Fortran!use statement}
964 \addtoindexx{use statement|see {Fortran, use statement}}
965 with an \doublequote{only list} may be
966 represented by a series of imported declaration entries,
967 one (or more) for each entity that is imported. An entity
968 \addtoindexx{renamed declaration|see{imported declaration entry}}
969 that is renamed in the importing context may be represented
970 by an imported declaration entry with a name attribute that
971 specifies the new local name.
974 \subsection{Imported Module Entries}
975 \label{chap:importedmoduleentries}
977 \textit{Some languages support the concept of importing into or making
978 accessible in a given unit all of the declarations contained
979 within a separate module or namespace.
982 An imported module declaration is represented by a debugging
983 information entry with
984 \addtoindexx{imported module attribute}
986 \addtoindexx{imported module entry}
987 tag \DWTAGimportedmoduleTARG.
989 imported module entry contains a
990 \DWATimport{} attribute
991 \addtoindexx{import attribute}
992 whose value is a \livelink{chap:classreference}{reference}
993 to the module or namespace entry
994 containing the definition and/or declaration entries for
995 the entities that are to be imported into the context of the
996 imported module entry.
998 An imported module declaration may own a set of imported
999 declaration entries, each of which refers to an entry in the
1000 module whose corresponding entity is to be known in the context
1001 of the imported module declaration by a name other than its
1002 name in that module. Any entity in the module that is not
1003 renamed in this way is known in the context of the imported
1004 module entry by the same name as it is declared in the module.
1006 \textit{A \addtoindex{C++} using directive
1007 \addtoindexx{namespace (C++)!using directive}
1008 \addtoindexx{using directive|see {namespace (C++), using directive}}
1009 may be represented by an imported
1010 module\hypertarget{chap:DWATimportnamespaceusingdirective}{}
1011 entry, with a \DWATimportDEFN{} attribute referring to the namespace
1012 entry of the appropriate extension of the namespace (which
1013 might be the original namespace entry) and no owned entries.
1016 \textit{A \addtoindex{Fortran} use statement
1017 \addtoindexx{Fortran!use statement}
1018 with a \doublequote{rename list} may be
1019 represented by an imported module entry with an import
1020 attribute referring to the module and owned entries
1021 corresponding to those entities that are renamed as part of
1025 \textit{A \addtoindex{Fortran} use statement
1026 \addtoindexx{Fortran!use statement}
1027 with neither a \doublequote{rename list} nor
1028 an \doublequote{only list} may be represented by an imported module
1029 entry with an import attribute referring to the module and
1030 no owned child entries.
1033 \textit{A use statement with an \doublequote{only list} is represented by a
1034 series of individual imported declaration entries as described
1035 in Section \refersec{chap:importedorrenameddeclarationentries}.
1039 \textit{A \addtoindex{Fortran} use statement for an entity in a module that is
1040 \addtoindexx{Fortran!use statement}
1041 itself imported by a use statement without an explicit mention
1042 may be represented by an imported declaration entry that refers
1043 to the original debugging information entry. For example, given
1060 \textit{the imported declaration entry for Q within module C refers
1061 directly to the variable declaration entry for X in module A
1062 because there is no explicit representation for X in module B.
1065 \textit{A similar situation arises for a \addtoindex{C++} using declaration
1066 \addtoindexx{namespace (C++)!using declaration}
1067 \addtoindexx{using declaration|see {namespace (C++), using declaration}}
1068 that imports an entity in terms of a namespace alias. See
1069 Appendix \refersec{app:namespaceexamples}
1073 \subsection{Imported Unit Entries}
1074 \label{chap:importedunitentries}
1075 \hypertarget{chap:DWATimportimportedunit}{}
1076 The place where a normal or partial compilation unit is imported is
1077 represented by a debugging information entry with the
1078 \addtoindexx{imported unit entry}
1079 tag \DWTAGimportedunitTARG.
1080 An imported unit entry contains a
1081 \DWATimportDEFN{} attribute\addtoindexx{import attribute}
1082 whose value is a \livelink{chap:classreference}{reference} to the
1083 normal or partial compilation unit whose declarations logically
1084 belong at the place of the imported unit entry.
1086 \textit{An imported unit entry does not necessarily correspond to
1087 any entity or construct in the source program. It is merely
1088 \doublequote{glue} used to relate a partial unit, or a compilation
1089 unit used as a partial unit, to a place in some other
1092 \section{Subroutine and Entry Point Entries}
1093 \label{chap:subroutineandentrypointentries}
1095 The following tags exist to describe
1096 debugging information entries
1097 \addtoindexx{function entry|see{subroutine entry}}
1099 \addtoindexx{subroutine entry}
1101 \addtoindexx{subprogram entry}
1103 % FIXME: is entry point entry the right index 'entry'?
1104 \addtoindexx{entry point entry}
1107 \begin{tabular}{lp{9.0cm}}
1108 \DWTAGsubprogramTARG{} & A subroutine or function \\
1109 \DWTAGinlinedsubroutine{} & A particular inlined
1110 \addtoindexx{inlined subprogram entry}
1111 instance of a subroutine or function \\
1112 \DWTAGentrypointTARG{} & An alternate entry point \\
1117 \subsection{General Subroutine and Entry Point Information}
1118 \label{chap:generalsubroutineandentrypointinformation}
1119 The subroutine or entry point entry has a \DWATname{}
1120 attribute whose value is a null-terminated string containing the
1121 subroutine or entry point name.
1122 It may also have a \DWATlinkagename{} attribute as
1123 described in Section \refersec{chap:linkagenames}.
1125 If the name of the subroutine described by an entry with the
1126 \addtoindexx{subprogram entry}
1127 tag \DWTAGsubprogram{}\hypertarget{chap:DWATexternalexternalsubroutine}{}
1128 is visible outside of its containing
1129 compilation unit, that entry has a
1130 \DWATexternalDEFN{} attribute,\addtoindexx{external attribute}
1131 which is a \livelink{chap:classflag}{flag}.
1133 \textit{Additional attributes for functions that are members of a
1134 class or structure are described in
1135 Section \refersec{chap:memberfunctionentries}.
1138 A\hypertarget{chap:DWATmainsubprogrammainorstartingsubprogram}{}
1139 subroutine entry may contain a
1140 \DWATmainsubprogramDEFN{} attribute
1141 \addtoindexx{main subprogram attribute}
1143 a \CLASSflag{} whose presence indicates that the
1144 subroutine has been identified as the starting function of
1145 the program. If more than one subprogram contains this
1147 any one of them may be the starting subroutine of the program.
1149 \textit{See also Section \refersec{chap:unitentries}) regarding the
1150 related use of this attribute to indicate that a compilation
1151 unit contains the main subroutine of a program.}
1153 \subsubsection{Calling Convention Information}
1154 \hypertarget{chap:DWATcallingconventionforsubprograms}{}
1155 A subroutine entry may contain a
1156 \DWATcallingconventionDEFN{}
1157 \addtoindexx{calling convention attribute!for subprogram}
1158 attribute, whose value is an
1159 \livelink{chap:classconstant}{integer constant}. The set of
1160 \addtoindexi{calling convention codes for subroutines}{calling convention codes!for subroutines}
1161 is given in Table \refersec{tab:callingconventioncodesforsubroutines}.
1163 \begin{simplenametable}[1.4in]{Calling convention codes for subroutines}{tab:callingconventioncodesforsubroutines}
1167 \end{simplenametable}
1169 If this attribute is not present, or its value is the constant
1170 \DWCCnormalTARG, then the subroutine may be safely called by
1171 obeying the \doublequote{standard} calling conventions of the target
1172 architecture. If the value of the calling convention attribute
1173 is the constant \DWCCnocallTARG, the subroutine does not obey
1174 standard calling conventions, and it may not be safe for the
1175 debugger to call this subroutine.
1177 \textit{Note that \DWCCnormal{} is also used as a calling convention
1178 code for certain types
1179 (see Table \refersec{tab:callingconventioncodesfortypes}).}
1181 If the semantics of the language of the compilation unit
1182 containing the subroutine entry distinguishes between ordinary
1183 subroutines and subroutines that can serve as the \doublequote{main
1184 program,} that is, subroutines that cannot be called
1185 directly according to the ordinary calling conventions,
1186 then the debugging information entry for such a subroutine
1187 may have a calling convention attribute whose value is the
1188 constant \DWCCprogramTARG.
1190 \textit{A common debugger feature is to allow the debugger user to call
1191 a subroutine within the subject program. In certain cases,
1192 however, the generated code for a subroutine will not obey
1193 the standard calling conventions for the target architecture
1194 and will therefore not be safe to call from within a debugger.}
1196 \textit{The \DWCCprogram{}
1197 value is intended to support \addtoindex{Fortran} main
1198 \addtoindexx{Fortran!main program}
1199 programs which in some implementations may not be callable
1200 or which must be invoked in a special way. It is not intended
1201 as a way of finding the entry address for the program.}
1204 \subsubsection{Miscellaneous Subprogram Properties}
1205 \textit{In \addtoindex{C}
1206 there is a difference between the types of functions
1207 declared using function prototype style declarations and
1208 those declared using non-prototype declarations.}
1210 A subroutine entry declared with a function prototype style
1211 declaration may have a
1212 \addtoindexx{prototyped attribute}
1213 \DWATprototypedDEFN{} attribute, which is
1215 The attribute indicates whether a subroutine entry point corresponds
1216 to a function declaration that includes parameter prototype information.
1218 A subprogram entry may have
1219 a\hypertarget{chap:DWATelementalelementalpropertyofasubroutine}{}
1220 \DWATelementalDEFN{} attribute,\addtoindexx{elemental attribute}
1221 which is a \livelink{chap:classflag}{flag}.
1222 The attribute indicates whether the subroutine
1223 or entry point was declared with the \doublequote{elemental} keyword
1226 A\hypertarget{chap:DWATpurepurepropertyofasubroutine}{}
1227 subprogram entry may have a
1228 \addtoindexx{pure attribute}
1229 \DWATpureDEFN{} attribute, which is
1230 a \livelink{chap:classflag}{flag}.
1231 The attribute indicates whether the subroutine was
1232 declared with the \doublequote{pure} keyword or property.
1234 A\hypertarget{chap:DWATrecursiverecursivepropertyofasubroutine}{}
1235 subprogram entry may have a
1236 \addtoindexx{recursive attribute}
1237 \DWATrecursiveDEFN{} attribute, which
1238 is a \livelink{chap:classflag}{flag}.
1239 The attribute indicates whether the subroutine
1240 or entry point was declared with the \doublequote{recursive} keyword
1243 A subprogram entry may have a
1245 \livetargi{chap:DWATnoreturnofsubprogram}{attribute}{noreturn attribute},
1246 which is a \CLASSflag. The attribute
1247 indicates whether the subprogram was declared with the \doublequote{noreturn} keyword or property
1248 indicating that the subprogram can be called, but will never return to its caller.
1250 \textit{The \addtoindex{Fortran}
1251 language allows the keywords \texttt{elemental}, \texttt{pure}
1252 and \texttt{recursive} to be included as part of the declaration of
1253 a subroutine; these attributes reflect that usage. These
1254 attributes are not relevant for languages that do not support
1255 similar keywords or syntax. In particular, the \DWATrecursiveNAME{}
1256 attribute is neither needed nor appropriate in languages such
1257 as \addtoindex{C} where functions support recursion by default.}
1260 \subsubsection{Call Site-Related Attributes}
1261 \textit{While subprogram attributes in the previous section provide
1262 information about the subprogram and its entry point(s) as a whole,
1263 the following attributes provide summary information about the calls
1264 that occur within a subprogram.}
1266 A subroutine entry may have \DWATcallalltailcalls,
1267 \DWATcallallcalls{} and/or \DWATcallallsourcecalls{}
1268 attributes, each of which is a \CLASSflag.
1269 \addtoindexx{call site summary information}
1270 \addtoindexx{subroutine call site summary attributes}
1271 These flags indicate the completeness of the call site
1272 information provided by call site entries (see
1273 Section \refersec{chap:callsiteentries}) within the subprogram.
1275 The \DWATcallalltailcallsDEFN{}
1276 \livetargi{chap:DWATcallalltailcallsofasubprogram}{attribute}{all tail calls summary attribute}
1277 indicates that every tail call
1278 that occurs in the code for the subprogram is described by a
1279 \DWTAGcallsite{} entry.
1280 (There may or may not be other non-tail calls to some of the same
1281 target subprograms.)
1283 The \DWATcallallcallsDEFN{}
1284 \livetargi{chap:DWATcallallcallsofasubprogram}{attribute}{all calls summary attribute}
1285 indicates that every non-inlined call
1286 (either a tail call or a normal call) that occurs in the code for the subprogram
1287 is described by a \DWTAGcallsite{} entry.
1289 The \DWATcallallsourcecallsDEFN{}
1290 \livetargi{chap:DWATcallallsourcecallsofasubprogram}{attribute}{all source calls summary attribute}
1291 indicates that every call that occurs in the
1292 code for the subprogram, including every call inlined into it, is described by either a
1293 \DWTAGcallsite{} entry or a \DWTAGinlinedsubroutine{} entry; further, any call
1294 that is optimized out is nonetheless also described using a \DWTAGcallsite{} entry
1295 that has neither a \DWATcallpc{} nor \DWATcallreturnpc{} attribute.
1297 \textit{The \DWATcallallsourcecallsNAME{} attribute is intended for debugging
1298 information format consumers that analyze call graphs.}
1300 If the the \DWATcallallsourcecalls{} attribute is present then the
1301 \DWATcallallcalls{} and \DWATcallalltailcalls{} attributes are
1302 also implicitly present. Similarly, if the
1303 \DWATcallallcalls{} attribute is present then the \DWATcallalltailcalls{}
1304 attribute is implicitly present.
1307 \subsection{Subroutine and Entry Point Return Types}
1308 \label{chap:subroutineandentrypointreturntypes}
1310 If\hypertarget{chap:DWATtypetypeofsubroutinereturn}{}
1311 the subroutine or entry point
1312 \addtoindexx{return type of subroutine}
1313 is a function that returns a
1314 value, then its debugging information entry has
1315 \addtoindexx{type attribute}
1316 a \DWATtypeDEFN{} attribute
1317 to denote the type returned by that function.
1319 \textit{Debugging information entries for
1320 \addtoindex{C} void functions should
1321 not have an attribute for the return type. }
1323 \textit{Debugging information entries for declarations of \addtoindex{C++}
1324 member functions with an
1325 \autoreturntype{} specifier should use an unspecified type entry (see
1326 Section \refersec{chap:unspecifiedtypeentries}).
1327 The debugging information entry for the corresponding definition
1328 should provide the deduced return type. This practice causes the description of
1329 the containing class to be consistent across compilation units, allowing the class
1330 declaration to be placed into a separate type unit if desired.}
1333 \subsection{Subroutine and Entry Point Locations}
1334 \label{chap:subroutineandentrypointlocations}
1336 A subroutine entry may have either a \DWATlowpc{} and
1337 \DWAThighpc{} pair of attributes or a \DWATranges{} attribute
1338 \addtoindexx{ranges attribute}
1340 \addtoindexx{high PC attribute}
1342 \addtoindexx{low PC attribute}
1343 encode the contiguous or non-contiguous address
1344 ranges, respectively, of the machine instructions generated
1345 for the subroutine (see
1346 Section \refersec{chap:codeaddressesandranges}).
1348 A\hypertarget{chap:DWATentrypcentryaddressofsubprogram}{}
1349 subroutine entry may also have a
1350 \addtoindexx{entry PC attribute!for subroutine}
1351 \DWATentrypc{} attribute
1352 whose value is the address of the first executable instruction
1353 of the subroutine (see
1354 Section \refersec{chap:entryaddress}).
1356 An entry point has a \DWATlowpc{} attribute whose value is the
1357 relocated address of the first machine instruction generated
1358 for the entry point.
1361 %\textit{While the \DWATentrypc{} attribute
1362 %\addtoindexx{entry pc attribute!for subroutine}
1363 %might also seem appropriate for this purpose, historically the
1364 %\DWATlowpc{} attribute was used before the
1365 %\DWATentrypc{} was introduced (in
1366 %\addtoindex{DWARF Version 3}).
1367 %There is insufficient reason to change this.}
1369 Subroutines and entry points may also have
1370 \DWATsegment{}\hypertarget{chap:DWATaddressclasssubroutineorsubroutinetype}{}
1371 \addtoindexx{segment attribute} and
1372 \DWATaddressclassDEFN{}\addtoindexx{address class attribute}
1373 attributes, as appropriate, to specify
1374 which segments the code for the subroutine resides in and
1375 the addressing mode to be used in calling that subroutine.
1377 A subroutine entry representing a subroutine declaration
1378 that is not also a definition does not have code address or
1382 \subsection{Declarations Owned by Subroutines and Entry Points}
1383 \label{chap:declarationsownedbysubroutinesandentrypoints}
1384 \addtoindexx{subroutine formal parameters}
1385 The declarations enclosed by a subroutine or entry point are
1386 represented by debugging information entries that are owned
1387 by the subroutine or entry point entry. Entries representing
1388 \addtoindexx{formal parameter}
1389 the formal parameters of the subroutine or entry point appear
1390 in the same order as the corresponding declarations in the
1394 \textit{There is no ordering requirement for entries for declarations
1395 other than formal parameters. The formal parameter
1396 entries may be interspersed with other entries used by formal
1397 parameter entries, such as type entries.}
1399 The unspecified (sometimes called \doublequote{varying})
1400 parameters of a subroutine parameter list are
1401 represented by a debugging information
1402 entry\addtoindexx{unspecified parameters entry}
1403 with the tag \DWTAGunspecifiedparametersTARG.
1406 The entry for a subroutine that includes a
1407 \addtoindex{Fortran}
1408 \addtoindexx{Fortran!common block}
1409 \livelink{chap:fortrancommonblock}{common}
1410 \livelink{chap:commonblockentry}{block}
1411 \addtoindexx{common block|see{Fortran common block}}
1412 has a child entry with the
1413 tag \DWTAGcommoninclusionTARG.
1414 The\hypertarget{chap:commonreferencecommonblockusage}{}
1415 common inclusion entry has a
1416 \DWATcommonreferenceDEFN{} attribute
1417 \addtoindexx{common block reference attribute}
1418 whose value is a \livelink{chap:classreference}{reference}
1419 to the debugging information entry
1420 for the common \nolink{block} being included
1421 (see Section \refersec{chap:commonblockentries}).
1423 \subsection{Low-Level Information}
1424 \label{chap:lowlevelinformation}
1426 A\hypertarget{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}{}
1427 subroutine or entry point entry may have a
1428 \addtoindexx{return address attribute}
1429 \DWATreturnaddrDEFN{}
1430 attribute, whose value is a location description. The location
1431 specified is the place where the return address for the
1432 subroutine or entry point is stored.
1434 A\hypertarget{chap:DWATframebasesubroutineframebaseaddress}{}
1435 subroutine or entry point entry may also have a
1436 \addtoindexx{frame base attribute}
1437 \DWATframebaseDEFN{} attribute, whose value is a location
1438 description that describes the \doublequote{frame base} for the
1439 subroutine or entry point. If the location description is
1440 a simple register location description, the given register
1441 contains the frame base address. If the location description is
1442 a DWARF expression, the result of evaluating that expression
1443 is the frame base address. Finally, for a
1444 \addtoindex{location list},
1445 this interpretation applies to each location description
1446 contained in the list of \addtoindex{location list} entries.
1448 \textit{The use of one of the \DWOPregn{}
1449 operations in this context is equivalent to using
1450 \DWOPbregn(0) but more
1451 compact. However, these are not equivalent in general.}
1454 \textit{The frame base for a subprogram is typically an address
1455 relative to the first unit of storage allocated for the
1456 subprogram\textquoteright s stack frame. The \DWATframebase{} attribute
1457 can be used in several ways:}
1458 \begin{enumerate}[1. ]
1459 \item \textit{In subprograms that need
1460 \addtoindexx{location list}
1461 location lists to locate local
1462 variables, the \DWATframebase{} can hold the needed location
1463 list, while all variables\textquoteright\ location descriptions can be
1464 simpler ones involving the frame base.}
1466 \item \textit{It can be used in resolving \doublequote{up\dash level} addressing
1467 within nested routines.
1468 (See also \DWATstaticlink, below)}
1472 \textit{Some languages support nested subroutines. In such languages,
1473 it is possible to reference the local variables of an
1474 outer subroutine from within an inner subroutine. The
1475 \DWATstaticlink{} and \DWATframebase{} attributes allow
1476 debuggers to support this same kind of referencing.}
1478 If\hypertarget{chap:DWATstaticlinklocationofuplevelframe}{}
1479 a subroutine or entry point is nested, it may have a
1480 \addtoindexx{address!uplevel|see {static link attribute}}
1481 \addtoindexx{uplevel address|see {static link attribute}}
1482 \DWATstaticlinkDEFN{} attribute, whose value is a location
1483 description that computes the frame base of the relevant
1484 instance of the subroutine that immediately encloses the
1485 subroutine or entry point.
1487 In the context of supporting nested subroutines, the
1488 \DWATframebase{} attribute value
1492 the following constraints:
1494 \begin{enumerate}[1. ]
1499 a value that does not change during the
1500 life of the subprogram, and
1502 \item The computed value
1506 unique among instances of
1507 the same subroutine.
1510 \textit{For typical \DWATframebase{} use, this
1511 means that a recursive subroutine\textquoteright s stack frame must have
1517 \textit{If a debugger is attempting to resolve an up\dash level reference
1518 to a variable, it uses the nesting structure of DWARF to
1519 determine which subroutine is the lexical parent and the
1520 \DWATstaticlink{} value to identify the appropriate active
1521 frame of the parent. It can then attempt to find the reference
1522 within the context of the parent.}
1526 \subsection{Types Thrown by Exceptions}
1527 \label{chap:typesthrownbyexceptions}
1529 \textit{In \addtoindex{C++} a subroutine may declare a set of types which
1530 it may validly throw.}
1532 If a subroutine explicitly declares that it may throw
1533 \addtoindexx{exception thrown|see{thrown type entry}}
1535 \addtoindexx{thrown exception|see{thrown type entry}}
1536 exception of one or more types, each such type is
1537 represented by a debugging information entry with
1538 \addtoindexx{thrown type entry}
1540 \DWTAGthrowntypeTARG.
1541 Each such entry is a child of the entry
1542 representing the subroutine that may throw this type. Each
1543 thrown type entry contains
1544 \addtoindexx{type attribute}
1545 a \DWATtype{} attribute, whose
1546 value is a \livelink{chap:classreference}{reference}
1547 to an entry describing the type of the
1548 exception that may be thrown.
1550 \subsection{Function Template Instantiations}
1551 \label{chap:functiontemplateinstantiations}
1553 \textit{In \addtoindex{C++}, a function template is a generic definition of
1554 a function that is instantiated differently for calls with
1555 values of different types. DWARF does not represent the generic
1556 template definition, but does represent each instantiation.}
1559 A \addtoindex{function template instantiation}\addtoindexx{template instantiation!function}
1560 is represented by a debugging information entry with the
1561 \addtoindexx{subprogram entry!use for template instantiation}
1562 tag \DWTAGsubprogram.
1564 exceptions, such an entry will contain the same attributes and
1565 will have the same types of child entries as would an entry
1566 for a subroutine defined explicitly using the instantiation
1567 types and values. The exceptions are:
1569 \begin{enumerate}[1. ]
1570 \item Template parameters are described and referenced as specified in
1571 Section \refersec{chap:templateparameters}.
1574 \item If the compiler has generated a separate compilation unit
1575 to hold the template instantiation and that compilation unit
1576 has a different name from the compilation unit containing
1577 the template definition, the name attribute for the debugging
1578 information entry representing that compilation unit is empty
1581 \item If the subprogram entry representing the template
1582 instantiation or any of its child entries contain declaration
1583 coordinate attributes, those attributes refer to the source
1584 for the template definition, not to any source generated
1585 artificially by the compiler for this instantiation.
1590 \subsection{Inlinable and Inlined Subroutines}
1591 \label{chap:inlinedsubroutines}
1592 A declaration or a definition of an inlinable subroutine
1593 is represented by a debugging information entry with the
1594 tag \DWTAGsubprogram.
1595 The entry for a subroutine
1596 \addtoindexx{subprogram entry!use in inlined subprogram}
1597 that is\hypertarget{chap:DWATinlineinlinedsubroutine}{}
1598 explicitly declared to be available for inline expansion or
1599 that was expanded inline implicitly by the compiler has a
1600 \addtoindexx{inline attribute}
1601 \DWATinlineDEFN{} attribute whose value is an
1602 \livelink{chap:classconstant}{integer constant}. The
1603 set of values for the \DWATinline{} attribute is given in
1604 Table \refersec{tab:inlinecodes}.
1608 \caption{Inline codes}
1609 \label{tab:inlinecodes}
1610 \begin{tabular}{l|P{8cm}}
1612 Name&Meaning\\ \hline
1613 \DWINLnotinlinedTARG{} & Not declared inline nor inlined by the
1614 \mbox{compiler} (equivalent to the absence of the
1615 containing \DWATinline{} attribute) \\
1616 \DWINLinlinedTARG{} & Not declared inline but inlined by the \mbox{compiler} \\
1617 \DWINLdeclarednotinlinedTARG{} & Declared inline but
1618 not inlined by the \mbox{compiler} \\
1619 \DWINLdeclaredinlinedTARG{} & Declared inline and inlined by the
1625 \textit{In \addtoindex{C++}, a function or a constructor declared with
1626 \addttindex{constexpr} is implicitly declared inline. The abstract
1627 instance (see Section \refersec{chap:abstractinstances})
1628 is represented by a debugging information
1629 entry with the tag \DWTAGsubprogram. Such an entry has a
1630 \DWATinline{} attribute whose value is \DWINLinlined.}
1633 \subsubsection{Abstract Instances}
1634 \label{chap:abstractinstances}
1635 Any subroutine entry that contains a
1636 \DWATinlineDEFN{} attribute\addtoindexx{inline attribute}
1637 whose value is other than
1639 is known as an \definition{abstract instance root}.
1640 \addtoindexx{abstract instance!root}
1641 \hypertarget{chap:DWATinlineabstracttinstance}{}
1642 Any debugging information entry that is owned (either
1643 directly or indirectly) by an abstract instance root
1645 \definition{abstract instance entry.}\addtoindexx{abstract instance!entry}
1646 Any set of abstract instance entries that are all
1647 children (either directly or indirectly) of some abstract
1648 instance root, together with the root itself, is known as an
1649 \definition{abstract instance tree.}\addtoindexx{abstract instance!tree}
1650 However, in the case where an abstract instance tree is
1651 nested within another abstract instance tree, the entries in the
1652 \addtoindex{nested abstract instance}
1653 tree are not considered to be entries in the outer abstract
1657 Each abstract instance root is either part of a larger
1658 \addtoindexx{abstract instance!root}
1659 tree (which gives a context for the root) or
1660 \addtoindexx{specification attribute}
1662 \DWATspecification{}
1663 to refer to the declaration in context.
1665 \textit{For example, in \addtoindex{C++} the context might be a namespace
1666 declaration or a class declaration.}
1668 \textit{Abstract instance trees are defined so that no entry is part
1669 of more than one abstract instance tree.}
1671 Attributes and children in an abstract instance are shared
1672 by all concrete instances (see Section \refersec{chap:concreteinstances}).
1674 A debugging information entry that is a member of an abstract
1679 not contain any attributes which describe
1680 aspects of the subroutine which vary between distinct inlined
1681 expansions or distinct out-of-line expansions.
1684 \textit{For example,
1685 \addtoindexx{entry pc attribute!and abstract instance}
1686 the \DWATlowpc,\addtoindexx{low PC attribute!and abstract instance}
1687 \DWAThighpc,\addtoindexx{high PC attribute!and abstract instance}
1688 \DWATranges,\addtoindexx{ranges attribute!and abstract instance}
1689 \DWATentrypc,\addtoindexx{entry PC attribute!and abstract instance}
1690 \DWATlocation,\addtoindexx{location attribute!and abstract instance}
1691 \DWATreturnaddr,\addtoindexx{return address attribute!and abstract instance}
1692 \DWATstartscope,\addtoindexx{start scope attribute!and abstract instance}
1694 \DWATsegment{}\addtoindexx{segment attribute!and abstract instance}
1695 attributes typically should be omitted; however, this list is not
1700 \textit{It would not make sense normally to put these attributes into
1701 abstract instance entries since such entries do not represent
1702 actual (concrete) instances and thus do not actually exist at
1703 run\dash time. However,
1704 see Appendix \refersec{app:inlineouteronenormalinner}
1705 for a contrary example.}
1707 The rules for the relative location of entries belonging to
1708 abstract instance trees are exactly the same as for other
1709 similar types of entries that are not abstract. Specifically,
1710 the rule that requires that an entry representing a declaration
1711 be a direct child of the entry representing the scope of the
1712 declaration applies equally to both abstract and non-abstract
1713 entries. Also, the ordering rules for formal parameter entries,
1714 member entries, and so on, all apply regardless of whether
1715 or not a given entry is abstract.
1718 \subsubsection{Concrete Instances}
1719 \label{chap:concreteinstances}
1721 Each inline expansion of a subroutine is represented
1722 by a debugging information entry with the
1723 tag \DWTAGinlinedsubroutineTARG.
1729 child of the entry that represents the scope within which
1730 the inlining occurs.
1733 Each inlined subroutine entry may have either a
1735 and \DWAThighpc{} pair of attributes
1736 \addtoindexx{high PC attribute}
1737 \addtoindexx{low PC attribute}
1738 or a \DWATranges{}\addtoindexx{ranges attribute}
1739 attribute whose values encode the contiguous or non-contiguous
1740 address ranges, respectively, of the machine instructions
1741 generated for the inlined subroutine (see
1742 Section \referfol{chap:codeaddressesandranges}).
1743 An\hypertarget{chap:DWATentrypcentryaddressofinlinedsubprogram}{}
1744 inlined subroutine entry may
1745 \addtoindexx{inlined subprogram entry!in concrete instance}
1747 \addtoindexx{inlined subprogram entry}
1749 \addtoindexx{entry PC attribute!for inlined subprogram}
1752 attribute, representing the first executable instruction of
1753 the inline expansion (see
1754 Section \refersec{chap:entryaddress}).
1756 % Positions of the 3 targets here is a bit arbitrary.
1757 An inlined\hypertarget{chap:DWATcalllinelinenumberofinlinedsubroutinecall}{}
1758 subroutine\hypertarget{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}{}
1759 entry\hypertarget{chap:DWATcallfilefilecontaininginlinedsubroutinecall}{}
1760 may also have \DWATcallfileDEFN,
1761 \DWATcalllineDEFN{} and \DWATcallcolumnDEFN{} attributes,
1762 \addtoindexx{inlined call location attributes}
1764 value is an \livelink{chap:classconstant}{integer constant}.
1765 These attributes represent the
1766 source file, source line number, and source column number,
1767 respectively, of the first character of the statement or
1768 expression that caused the inline expansion. The call file,
1769 call line, and call column attributes are interpreted in
1770 the same way as the declaration file, declaration line, and
1771 declaration column attributes, respectively (see
1772 Section \refersec{chap:declarationcoordinates}).
1774 \textit{The call file, call line and call column coordinates do not
1775 describe the coordinates of the subroutine declaration that
1776 was inlined, rather they describe the coordinates of the call.
1779 An inlined subroutine entry may have
1780 a\hypertarget{chap:DWATconstexprcompiletimeconstantfunction}{}
1781 \DWATconstexprDEFN{} attribute,\addtoindexx{constant expression attribute}
1782 which is a \livelink{chap:classflag}{flag}
1783 whose presence indicates that the
1784 subroutine has been evaluated as a compile\dash time constant. Such
1785 an entry may also have a \DWATconstvalue{} attribute,
1786 whose value may be of any form that is appropriate for the
1787 representation of the subroutine's return value. The value of
1788 this attribute is the actual return value of the subroutine,
1789 represented as it would be on the target architecture.
1791 \textit{In \addtoindex{C++}, if a function or a constructor declared with
1792 \addttindex{constexpr}
1793 is called with constant expressions, then the corresponding
1794 concrete inlined instance has a
1795 \DWATconstexpr{} attribute,
1796 as well as a \DWATconstvalue{} attribute whose value represents
1797 the actual return value of the concrete inlined instance.}
1799 Any debugging information entry that is owned (either
1800 directly or indirectly) by a debugging information entry
1801 with the tag \DWTAGinlinedsubroutine{} is referred to as a
1802 \doublequote{concrete inlined instance entry.} Any entry that has
1804 \DWTAGinlinedsubroutine{}
1805 is known as a \doublequote{concrete inlined instance root.}
1806 Any set of concrete inlined instance
1807 entries that are all children (either directly or indirectly)
1808 of some concrete inlined instance root, together with the root
1809 itself, is known as a \doublequote{concrete inlined instance tree.}
1810 However, in the case where a concrete inlined instance tree
1811 is nested within another concrete instance tree, the entries
1812 in the \addtoindex{nested concrete inline instance} tree
1813 are not considered to
1814 be entries in the outer concrete instance tree.
1817 \textit{Concrete inlined instance trees are defined so that no entry
1818 is part of more than one concrete inlined instance tree. This
1819 simplifies later descriptions.}
1821 Each concrete inlined instance tree is uniquely associated
1822 with one (and only one) abstract instance tree.
1824 \textit{Note, however, that the reverse is not true. Any given abstract
1825 instance tree may be associated with several different concrete
1826 inlined instance trees, or may even be associated with zero
1827 concrete inlined instance trees.}
1829 Concrete inlined instance entries may omit attributes that
1830 are not specific to the concrete instance (but present in
1831 the abstract instance) and need include only attributes that
1832 are specific to the concrete instance (but omitted in the
1833 abstract instance). In place of these omitted attributes,
1834 each\hypertarget{chap:DWATabstractorigininlineinstance}{}
1835 concrete inlined instance entry has a
1836 \addtoindexx{abstract origin attribute}
1837 \DWATabstractoriginDEFN{}
1838 attribute that may be used to obtain the missing information
1839 (indirectly) from the associated abstract instance entry. The
1840 value of the abstract origin attribute is a reference to the
1841 associated abstract instance entry.
1843 If an entry within a concrete inlined instance tree contains
1844 attributes describing the
1845 \addtoindexx{declaration coordinates!in concrete instance}
1846 \livelink{chap:declarationcoordinates}{declaration coordinates}
1847 of that entry, then those attributes
1849 refer to the file, line
1850 and column of the original declaration of the subroutine,
1851 not to the point at which it was inlined. As a consequence,
1852 they may usually be omitted from any entry that has an abstract
1856 For each pair of entries that are associated via a
1857 \addtoindexx{abstract origin attribute}
1858 \DWATabstractorigin{} attribute, both members of the pair
1859 have the same tag. So, for example, an entry with the tag
1860 \DWTAGvariable{} can only be associated with another entry
1861 that also has the tag \DWTAGvariable. The only exception
1862 to this rule is that the root of a concrete instance tree
1863 (which must always have the tag \DWTAGinlinedsubroutine)
1864 can only be associated with the root of its associated abstract
1865 instance tree (which must have the tag \DWTAGsubprogram).
1868 In general, the structure and content of any given concrete
1869 inlined instance tree will be closely analogous to the
1870 structure and content of its associated abstract instance
1871 tree. There are a few exceptions:
1873 \begin{enumerate}[1. ]
1874 \item An entry in the concrete instance tree may be omitted if
1876 \addtoindexx{abstract origin attribute}
1877 \DWATabstractorigin{} attribute and either
1878 has no children, or its children are omitted. Such entries
1879 would provide no useful information. In C\dash like languages,
1880 such entries frequently include types, including structure,
1881 union, class, and interface types; and members of types. If any
1882 entry within a concrete inlined instance tree needs to refer
1883 to an entity declared within the scope of the relevant inlined
1884 subroutine and for which no concrete instance entry exists,
1889 to the abstract instance entry.
1892 \item Entries in the concrete instance tree which are associated
1893 with entries in the abstract instance tree such that neither
1894 has a \DWATname{} attribute,
1895 \addtoindexx{name attribute}
1896 and neither is referenced by
1897 any other debugging information entry, may be omitted. This
1898 may happen for debugging information entries in the abstract
1899 instance trees that became unnecessary in the concrete instance
1900 tree because of additional information available there. For
1901 example, an anonymous variable might have been created and
1902 described in the abstract instance tree, but because of
1903 the actual parameters for a particular inlined expansion,
1904 it could be described as a constant value without the need
1905 for that separate debugging information entry.
1908 \item A concrete instance tree may contain entries which do
1909 not correspond to entries in the abstract instance tree
1910 to describe new entities that are specific to a particular
1911 inlined expansion. In that case, they will not have associated
1912 entries in the abstract instance tree,
1917 \addtoindexx{abstract origin attribute}
1918 \DWATabstractorigin{} attributes, and must contain all their
1919 own attributes directly. This allows an abstract instance tree
1920 to omit debugging information entries for anonymous entities
1921 that are unlikely to be needed in most inlined expansions. In
1922 any expansion which deviates from that expectation, the
1923 entries can be described in its concrete inlined instance tree.
1927 \subsubsection{Out-of-Line Instances of Inlined Subroutines}
1928 \label{chap:outoflineinstancesofinlinedsubroutines}
1929 Under some conditions, compilers may need to generate concrete
1930 executable instances of inlined subroutines other than at
1931 points where those subroutines are actually called. Such
1932 concrete instances of inlined subroutines are referred to as
1933 \doublequote{concrete out\dash of\dash line instances.}
1935 \textit{In \addtoindex{C++}, for example,
1936 taking the address of a function declared
1937 to be inline can necessitate the generation of a concrete
1938 out\dash of\dash line instance of the given function.}
1940 The DWARF representation of a concrete out-of-line instance
1941 of an inlined subroutine is essentially the same as for a
1942 concrete inlined instance of that subroutine (as described in
1943 the preceding section). The representation of such a concrete
1944 % It is critical that the hypertarget and livelink be
1945 % separated to avoid problems with latex.
1947 \addtoindexx{abstract origin attribute}
1949 \hypertarget{chap:DWATabstractoriginoutoflineinstance}{}
1951 \DWATabstractoriginDEFN{}
1952 attributes in exactly the same way as they are used for
1953 a concrete inlined instance (that is, as references to
1954 corresponding entries within the associated abstract instance
1957 The differences between the DWARF representation of a
1958 concrete out\dash of\dash line instance of a given subroutine and the
1959 representation of a concrete inlined instance of that same
1960 subroutine are as follows:
1961 \begin{enumerate}[1. ]
1962 \item The root entry for a concrete out\dash of\dash line instance
1963 of a given inlined subroutine has the same tag as does its
1964 associated (abstract) inlined subroutine entry (that is, tag
1965 \DWTAGsubprogram{} rather than \DWTAGinlinedsubroutine).
1967 \item The root entry for a concrete out\dash of\dash line instance tree
1968 is normally owned by the same parent entry that also owns
1969 the root entry of the associated abstract instance. However,
1970 it is not required that the abstract and out\dash of\dash line instance
1971 trees be owned by the same parent entry.
1975 \subsubsection{Nested Inlined Subroutines}
1976 \label{nestedinlinedsubroutines}
1977 Some languages and compilers may permit the logical nesting of
1978 a subroutine within another subroutine, and may permit either
1979 the outer or the nested subroutine, or both, to be inlined.
1981 For a non-inlined subroutine nested within an inlined
1982 subroutine, the nested subroutine is described normally in
1983 both the abstract and concrete inlined instance trees for
1984 the outer subroutine. All rules pertaining to the abstract
1985 and concrete instance trees for the outer subroutine apply
1986 also to the abstract and concrete instance entries for the
1990 For an inlined subroutine nested within another inlined
1991 subroutine, the following rules apply to their abstract and
1992 \addtoindexx{abstract instance!nested}
1993 \addtoindexx{concrete instance!nested}
1994 concrete instance trees:
1996 \begin{enumerate}[1. ]
1997 \item The abstract instance tree for the nested subroutine is
1998 described within the abstract instance tree for the outer
1999 subroutine according to the rules in
2000 Section \refersec{chap:abstractinstances}, and
2001 without regard to the fact that it is within an outer abstract
2004 \item Any abstract instance tree for a nested subroutine is
2005 always omitted within the concrete instance tree for an
2008 \item A concrete instance tree for a nested subroutine is
2009 always omitted within the abstract instance tree for an
2012 \item The concrete instance tree for any inlined or
2013 \addtoindexx{out-of-line instance}
2015 \addtoindexx{out-of-line instance|see{\textit{also} concrete out-of-line instance}}
2016 expansion of the nested subroutine is described within a
2017 concrete instance tree for the outer subroutine according
2019 Sections \refersec{chap:concreteinstances} or
2020 \referfol{chap:outoflineinstancesofinlinedsubroutines}
2022 and without regard to the fact that it is within an outer
2023 concrete instance tree.
2026 \textit{See Appendix \refersec{app:inliningexamples}
2027 for discussion and examples.}
2029 \subsection{Trampolines}
2030 \label{chap:trampolines}
2032 \textit{A trampoline is a compiler\dash generated subroutine that serves
2033 as\hypertarget{chap:DWATtrampolinetargetsubroutine}{}
2034 an intermediary in making a call to another subroutine. It may
2035 adjust parameters and/or the result (if any) as appropriate
2036 to the combined calling and called execution contexts.}
2038 A trampoline is represented by a debugging information entry
2039 \addtoindexx{trampoline (subprogram) entry}
2040 with the tag \DWTAGsubprogram{} or \DWTAGinlinedsubroutine{}
2042 \addtoindexx{trampoline attribute}
2043 a \DWATtrampolineDEFN{} attribute.
2045 attribute indicates the target subroutine of the trampoline,
2046 that is, the subroutine to which the trampoline passes
2047 control. (A trampoline entry may but need not also have a
2048 \DWATartificial{} attribute.)
2051 The value of the trampoline attribute may be represented
2052 using any of the following forms:
2055 \item If the value is of class \CLASSreference{}, then the value
2056 specifies the debugging information entry of the target
2059 \item If the value is of class \CLASSaddress{}, then the value is
2060 the relocated address of the target subprogram.
2063 \item If the value is of class \CLASSstring{}, then the value is the
2064 (possibly mangled) \addtoindexx{mangled names}
2065 name of the target subprogram.
2067 \item If the value is of class \CLASSflag, then the value true
2068 indicates that the containing subroutine is a trampoline but
2069 that the target subroutine is not known.
2073 The target subprogram may itself be a trampoline. (A sequence
2074 of trampolines necessarily ends with a non-trampoline
2077 \textit{In \addtoindex{C++}, trampolines may be used to implement
2078 derived virtual member functions; such trampolines typically
2080 \texttt{this} parameter\index{this parameter@\texttt{this} parameter}
2081 in the course of passing control.
2082 Other languages and environments may use trampolines in a manner
2083 sometimes known as transfer functions or transfer vectors.}
2085 \textit{Trampolines may sometimes pass control to the target
2086 subprogram using a branch or jump instruction instead of a
2087 call instruction, thereby leaving no trace of their existence
2088 in the subsequent execution context. }
2090 \textit{This attribute helps make it feasible for a debugger to arrange
2091 that stepping into a trampoline or setting a breakpoint in
2092 a trampoline will result in stepping into or setting the
2093 breakpoint in the target subroutine instead. This helps to
2094 hide the compiler generated subprogram from the user. }
2096 \section{Call Site Entries and Parameters}
2097 \label{chap:callsiteentriesandparameters}
2099 A call site entry describes a call from one subprogram to another in the
2100 source program. It provides information about the actual parameters of
2101 the call so that they may be more easily accessed by a debugger. When
2102 used together with call frame information
2103 (see Section \refersec{chap:callframeinformation}),
2104 call site entries can be useful for computing the value of an actual parameter
2105 passed by a caller, even when the location description for the callee's
2106 corresponding formal parameter does not provide a current location for
2107 the formal parameter.}
2109 \textit{The DWARF expression for computing the value of an actual parameter at
2110 a call site may refer to registers or memory locations. The expression
2111 assumes these contain the values they would have at the point where the
2112 call is executed. After the called subprogram has been entered, these
2113 registers and memory locations might have been modified. In order to
2114 recover the values that existed at the point of the call (to allow
2115 evaluation of the DWARF expression for the actual parameter), a debugger
2116 may virtually unwind the subprogram activation
2117 (see Section \refersec{chap:callframeinformation}). Any
2118 register or memory location that cannot be recovered is referred to as
2119 "clobbered by the call."}
2121 A source call can be compiled into different types of machine code:
2124 A \textit{normal call} uses a call-like instruction which transfers
2125 control to the start of some subprogram and preserves the call site
2126 location for use by the callee.
2129 A \textit{tail call} uses a jump-like instruction which
2130 transfers control to the start of some subprogram, but
2131 there is no call site location address to preserve
2132 (and thus none is available using the
2133 virtual unwind information).
2136 A \textit{tail recursion call} is a call
2137 to the current subroutine which is compiled as a jump
2138 to the current subroutine.
2142 An \textit{inline (or inlined) call} is a call to an inlined subprogram,
2143 where at least one instruction has the location of the inlined subprogram
2144 or any of its blocks or inlined subprograms.
2148 There are also different types of \doublequote{optimized out} calls:
2151 An \textit{optimized out (normal) call} is a call that is in unreachable code that
2152 has not been emitted (such as, for example, the call to \texttt{foo} in
2153 \texttt{if (0) foo();}).
2155 An \textit{optimized out inline call}
2156 is a call to an inlined subprogram which either did not expand to any instructions
2157 or only parts of instructions belong to it and for debug information purposes those
2158 instructions are given a location in the caller.
2161 \DWTAGcallsite{} entries describe normal and tail calls but not tail recursion calls,
2162 while \DWTAGinlinedsubroutine{} entries describe inlined calls
2163 (see Section \refersec{chap:inlinedsubroutines}).
2164 Call site entries cannot describe tail recursion or optimized out calls.
2166 \subsection{Call Site Entries}
2167 \label{chap:callsiteentries}
2168 A call site is represented by a debugging information entry with the tag
2169 \DWTAGcallsiteTARG{}\addtoindexx{call site entry}.
2170 The entry for a call site is owned by the innermost
2171 debugging information entry representing the scope within which the
2172 call is present in the source program.
2175 \textit{A scope entry (for example, a lexical block) that would not
2176 otherwise be present in the debugging information of a subroutine
2177 need not be introduced solely to represent the immediately containing scope
2180 The call site entry may have a
2181 \DWATcallreturnpcDEFN{}\addtoindexx{call site return pc attribute}
2182 \livetargi{chap:DWATcallreturnpcofcallsite}{attribute}{call return pc attribute}
2183 which is the return address after the call.
2184 The value of this attribute corresponds to the return address
2185 computed by call frame information in the called subprogram
2186 (see Section \refersec{datarep:callframeinformation}).
2188 \textit{On many architectures the return address is the
2189 address immediately following the call instruction, but
2190 on architectures with delay slots it might
2191 be an address after the delay slot of the call.}
2193 The call site entry may have a
2194 \DWATcallpcDEFN{}\addtoindexx{call pc attribute}
2195 \livetargi{chap:DWATcallpcofcallsite}{attribute}{call pc attribute}
2196 which is the address of the
2197 call-like instruction for a normal call or the jump-like
2198 instruction for a tail call.
2200 If the call site entry corresponds to a tail call, it has the
2201 \DWATcalltailcallDEFN{}\addtoindexx{call tail call attribute}
2202 \livetargi{chap:DWATcalltailcallofcallsite}{attribute}{call tail call attribute},
2203 which is a \CLASSflag.
2205 The call site entry may have a
2206 \DWATcalloriginDEFN{}\addtoindexx{call origin attribute}
2207 \livetargi{chap:DWATcalloriginofcallsite}{attribute}{call origin attribute}
2208 which is a \CLASSreference. For direct calls or jumps where the called
2209 subprogram is known it is a reference to the called subprogram's debugging
2210 information entry. For indirect calls it may be a reference to a
2211 \DWTAGvariable{}, \DWTAGformalparameter{} or \DWTAGmember{} entry representing
2212 the subroutine pointer that is called.
2215 The call site may have a
2216 \DWATcalltargetDEFN{}\addtoindexx{call target attribute}
2217 \livetargi{chap:DWATcalltargetofcallsite}{attribute}{call target attribute} which is
2218 a DWARF expression. For indirect calls or jumps where it is unknown at
2219 compile time which subprogram will be called the expression computes the
2220 address of the subprogram that will be called.
2223 \textit{The DWARF expression should
2224 not use register or memory locations that might be clobbered by the call.}
2228 The call site entry may have a
2229 \DWATcalltargetclobberedDEFN{}\addtoindexx{call target clobbered attribute}
2230 \livetargi{chap:DWATcalltargetclobberedofcallsite}{attribute}{call target clobbered attribute}
2231 which is a DWARF expression. For indirect calls or jumps where the
2232 address is not computable without use of registers or memory locations that
2233 might be clobbered by the call the \DWATcalltargetclobberedNAME{}
2234 attribute is used instead of the \DWATcalltarget{} attribute.
2236 \textit{The expression of a call target clobbered attribute may only be
2237 valid at the time the call or call-like transfer of control is executed.}
2239 The call site entry may have a \DWATtypeDEFN{}\addtoindexx{call type attribute}
2240 \livetargi{chap:DWATtypeofcallsite}{attribute}{type attribute!of call site entry}
2241 referencing a debugging information entry for the type of the called function.
2243 \textit{When \DWATcallorigin{} is present, \DWATtypeNAME{} is usually omitted.}
2245 The call site entry may have
2246 \DWATcallfileDEFN{}\addtoindexx{call file attribute},
2247 \DWATcalllineDEFN{}\addtoindexx{call line attribute} and
2248 \DWATcallcolumnDEFN{}\addtoindexx{call column attribute}
2249 \livetargi{chap:DWATcallfileofcallsite}{attributes,}{call file attribute!of call site entry}
2250 \livetargi{chap:DWATcalllineofcallsite}{}{call line attribute!of call site entry}
2251 \livetargi{chap:DWATcallcolumnofcallsite}{}{call column attribute!of call site entry}
2252 each of whose value is an integer constant.
2253 These attributes represent the source file, source line number, and source
2254 column number, respectively, of the first character of the call statement or
2255 expression. The call file, call line, and call column attributes are
2256 interpreted in the same way as the declaration file, declaration
2257 line, and declaration column attributes, respectively
2258 (see Section \refersec{chap:declarationcoordinates}).
2260 \textit{The call file, call line and call column coordinates do
2261 not describe the coordinates of the subroutine declaration that
2262 was called, rather they describe the coordinates of the call.}
2265 \subsection{Call Site Parameters}
2266 \label{chap:callsiteparameters}
2267 The call site entry may own
2268 \DWTAGcallsiteparameterTARG{}\index{call site parameter entry}
2269 debugging information entries representing the parameters passed
2271 Call site parameter entries occur in the same order as the
2272 corresponding parameters in the source.
2273 Each such entry has a \DWATlocation{} attribute which is a location
2274 description. This location description
2275 describes where the parameter is passed
2276 (usually either some register, or a memory location expressible as
2277 the contents of the stack register plus some offset).
2280 Each \DWTAGcallsiteparameter{} entry may have a
2281 \DWATcallvalueDEFN{}\addtoindexx{call value attribute}
2282 \livetargi{chap:DWATcallvalueofcallparameter}{attribute}{call value attribute}
2283 which is a DWARF expression
2284 which when evaluated yields the value of the parameter at the time of the call.
2286 \textit{\bbeb If it is not
2287 possible to avoid registers or memory locations that might be clobbered by
2288 the call in the expression, then the \DWATcallvalueNAME{} attribute should
2289 not be provided. The reason for the restriction is that the value of the parameter may be
2290 needed in the midst of the callee, where the call clobbered registers or
2291 memory might be already clobbered, and if the consumer is not assured by
2292 the producer it can safely use those values, the consumer can not safely
2293 use the values at all.}
2295 For parameters passed by reference, where the code passes a pointer to
2296 a location which contains the parameter, or for reference type parameters,
2297 the \DWTAGcallsiteparameter{} entry may also have a
2298 \DWATcalldatalocationDEFN{}\addtoindexx{call data location attribute}
2299 \livetargi{chap:DWATcalldatalocationofcallparameter}{attribute}{call data location attribute}
2300 whose value is a location description and a
2301 \DWATcalldatavalueDEFN{}\addtoindexx{call data value attribute}
2302 \livetargi{chap:DWATcalldatavalueofcallparameter}{attribute}{call data value attribute}
2303 whose value is a DWARF expression. The \DWATcalldatalocationNAME{} attribute
2304 \addtoindexx{call data location attribute}
2305 describes where the referenced value lives during the call. If it is just
2306 \DWOPpushobjectaddress{}, it may be left out. The
2307 \DWATcalldatavalueNAME{} attribute describes the value in that location.
2308 The expression should not use registers or memory
2309 locations that might be clobbered by the call, as it might be evaluated after
2310 virtually unwinding from the called function back to the caller.
2313 Each call site parameter entry may also have a
2314 \DWATcallparameterDEFN{}\addtoindexx{call parameter attribute}
2315 \livetargi{chap:DWATcallparameterofcallparameter}{attribute}{call parameter attribute}
2316 which contains a reference to a \DWTAGformalparameter{} entry,
2317 \DWATtype{} attribute referencing the type of the parameter or
2318 \DWATname{} attribute describing the parameter's name.
2320 \textit{Examples using call site entries and related attributes are
2321 found in Appendix \refersec{app:callsiteexamples}.}
2324 \section{Lexical Block Entries}
2325 \label{chap:lexicalblockentries}
2328 lexical \livetargi{chap:lexicalblock}{block}{lexical block}
2330 \addtoindexx{lexical block}
2331 a bracketed sequence of source statements
2332 that may contain any number of declarations. In some languages
2333 (including \addtoindex{C} and \addtoindex{C++}),
2334 \nolink{blocks} can be nested within other
2335 \nolink{blocks} to any depth.}
2337 % We do not need to link to the preceding paragraph.
2338 A lexical \nolink{block} is represented by a debugging information
2340 tag \DWTAGlexicalblockTARG.
2342 The lexical \livetargi{chap:lexicalblockentry}{block}{lexical block entry}
2344 either a \DWATlowpc{} and
2345 \DWAThighpc{} pair of
2347 \addtoindexx{high PC attribute}
2349 \addtoindexx{low PC attribute}
2351 \DWATranges{} attribute
2352 \addtoindexx{ranges attribute}
2353 whose values encode the contiguous or non-contiguous address
2354 ranges, respectively, of the machine instructions generated
2355 for the lexical \nolink{block}
2356 (see Section \refersec{chap:codeaddressesandranges}).
2358 A\hypertarget{chap:DWATentrypcoflexicalblock}{}
2359 lexical block entry may also have a
2360 \addtoindexx{entry PC attribute!for lexical block}
2361 \DWATentrypc{} attribute
2362 whose value is the address of the first executable instruction
2363 of the lexical block (see
2364 Section \refersec{chap:entryaddress}).
2366 If a name has been given to the lexical \nolink{block}
2367 in the source program, then the corresponding
2368 lexical \nolink{block} entry has a
2369 \DWATname{} attribute whose
2370 \addtoindexx{name attribute}
2371 value is a null-terminated string
2372 containing the name of the lexical \nolink{block}.
2374 \textit{This is not the same as a \addtoindex{C} or
2375 \addtoindex{C++} label (see Section \refersec{chap:labelentries}).}
2377 The lexical \nolink{block} entry owns debugging
2378 information entries that describe the declarations
2379 within that lexical \nolink{block}. There is
2380 one such debugging information entry for each local declaration
2381 of an identifier or inner lexical \nolink{block}.
2384 \section{Label Entries}
2385 \label{chap:labelentries}
2386 \textit{A label is a way of identifying a source location.
2387 A labeled statement is usually the target of one or more
2388 \doublequote{go to} statements.}
2391 A label is represented by a debugging information entry with
2392 \addtoindexx{label entry} the tag \DWTAGlabelTARG.
2393 The entry for a label
2398 the debugging information entry representing the scope within
2399 which the name of the label could be legally referenced within
2402 The label entry has a \DWATlowpc{} attribute whose value
2403 is the address of the first executable instruction for the
2404 location identified by the label in
2405 the source program. The label entry also has a
2406 \DWATname{} attribute
2407 \addtoindexx{name attribute}
2408 whose value is a null-terminated string containing
2409 the name of the label.
2412 \section{With Statement Entries}
2413 \label{chap:withstatemententries}
2415 \textit{Both \addtoindex{Pascal} and
2416 \addtoindexx{Modula-2}
2417 Modula-2 support the concept of a \doublequote{with}
2418 statement. The with statement specifies a sequence of
2419 executable statements within which the fields of a record
2420 variable may be referenced, unqualified by the name of the
2423 A with statement is represented by a
2424 \addtoindexi{debugging information entry}{with statement entry}
2425 with the tag \DWTAGwithstmtTARG.
2427 A with statement entry may have either a
2429 \DWAThighpc{} pair of attributes
2430 \addtoindexx{low PC attribute}
2431 \addtoindexx{high PC attribute}
2433 \DWATranges{} attribute
2434 \addtoindexx{ranges attribute}
2435 whose values encode the contiguous or non-contiguous address
2436 ranges, respectively, of the machine instructions generated
2437 for the with statement
2438 (see Section \refersec{chap:codeaddressesandranges}).
2440 A\hypertarget{chap:DWATentrypcofwithstmt}{}
2441 with statement entry may also have a
2442 \addtoindexx{entry PC attribute!for with statement}
2443 \DWATentrypc{} attribute
2444 whose value is the address of the first executable instruction
2445 of the with statement (see
2446 Section \refersec{chap:entryaddress}).
2449 The with statement entry has a
2450 \addtoindexx{type attribute}
2451 \DWATtype{} attribute, denoting
2452 the type of record whose fields may be referenced without full
2453 qualification within the body of the statement. It also has
2454 \addtoindexx{location attribute}
2455 a \DWATlocation{} attribute, describing how to find the base
2456 address of the record object referenced within the body of
2460 \section{Try and Catch Block Entries}
2461 \label{chap:tryandcatchblockentries}
2462 \livetarg{chap:tryandcatchblockentries}{}
2463 \textit{In \addtoindex{C++}, a \livelink{chap:lexicalblock}{lexical block} may be
2464 designated as a \doublequote{catch \nolink{block}.}
2465 A catch \nolink{block} is an exception handler that
2466 handles exceptions thrown by an immediately preceding
2467 \doublequote{try \nolink{block}.}
2468 A catch \nolink{block}
2469 designates the type of the exception that it can handle.}
2471 A \livetarg{chap:tryblock}{try block} is represented
2472 by a debugging information entry
2473 \addtoindexx{try block entry}
2474 with the tag \DWTAGtryblockTARG.
2475 A \livetarg{chap:catchblock}{catch block} is represented by
2476 a debugging information entry
2477 \addtoindexx{catch block entry}
2478 with the tag \DWTAGcatchblockTARG.
2480 Both try and catch \nolink{block} entries may have either a
2482 \DWAThighpc{} pair of attributes
2483 \addtoindexx{low PC attribute}
2484 \addtoindexx{high PC attribute}
2486 \DWATranges{} attribute
2487 \addtoindexx{ranges attribute}
2488 whose values encode the contiguous
2489 or non-contiguous address ranges, respectively, of the
2490 machine instructions generated for the \nolink{block}
2491 (see Section \refersec{chap:codeaddressesandranges}).
2493 A\hypertarget{chap:DWATentrypcoftryblock}{}
2494 try or catch\hypertarget{chap:DWATentrypcofcatchblock}{}
2495 block entry may also have a
2496 \addtoindexx{entry PC attribute!for try block}
2497 \addtoindexx{entry PC attribute!for catch block}
2498 \DWATentrypc{} attribute
2499 whose value is the address of the first executable instruction
2500 of the try or catch block
2501 (see Section \refersec{chap:entryaddress}).
2504 Catch \nolink{block} entries have at least one child entry,
2505 an entry representing the type of exception accepted by
2506 that catch \nolink{block}.
2507 This child entry has one of the tags
2508 \DWTAGformalparameter{}\addtoindexx{formal parameter entry!in catch block}
2510 \DWTAGunspecifiedparameters{},
2511 \addtoindexx{unspecified parameters entry!in catch block}
2512 and will have the same form as other parameter entries.
2514 The siblings immediately following a try \nolink{block}
2515 entry are its corresponding catch \nolink{block} entries.
2518 \section{Declarations with Reduced Scope}
2519 \label{declarationswithreducedscope}
2520 \hypertarget{chap:DWATstartscopeofdeclaration}{}
2521 Any debugging information entry for a declaration
2522 (including objects, subprograms, types and modules) whose scope
2523 has an address range that is a subset of the address range for
2524 the lexical scope most closely enclosing the declared entity
2526 \DWATstartscopeDEFN{}\addtoindexx{start scope attribute}
2527 attribute to specify that reduced range of addresses.
2529 There are two cases:
2530 \begin{enumerate}[1. ]
2531 \item If the address range for the scope of the entry
2532 includes all of addresses for the containing scope except
2533 for a contiguous sequence of bytes at the beginning of the
2534 address range for the containing scope, then the address is
2535 specified using a value of class \CLASSconstant.
2537 \begin{enumerate}[a) ]
2538 \item If the address
2539 range of the containing scope is contiguous, the value of
2540 this attribute is the offset in bytes of the beginning of
2541 the address range for the scope of the object from the low
2542 PC value of the debugging information entry that defines
2543 that containing scope.
2544 \item If the address range of the containing
2545 scope is non-contiguous
2546 (see \refersec{chap:noncontiguousaddressranges})
2547 the value of this attribute is the offset in bytes of the
2548 beginning of the address range for the scope of the entity
2549 from the beginning of the first \addtoindex{range list} entry
2550 for the containing scope that is not a base
2552 address entry, a default location
2554 entry or an end-of-list entry.
2558 \item Otherwise, the set of addresses for the scope of the
2559 entity is specified using a value of class \CLASSrnglistsptr{}.
2560 This value indicates the beginning of a \addtoindex{range list}
2561 (see Section \refersec{chap:noncontiguousaddressranges}).
2564 \textit{For example, the scope of a variable may begin somewhere
2565 in the midst of a lexical \livelink{chap:lexicalblock}{block} in a
2566 language that allows executable code in a
2567 \nolink{block} before a variable declaration, or where one declaration
2568 containing initialization code may change the scope of a
2569 subsequent declaration.}
2572 \textit{Consider the following example \addtoindex{C} code:}
2584 \textit{\addtoindex{C} scoping rules require that the value of the
2585 variable \texttt{x} assigned to the variable \texttt{f} in the
2586 initialization sequence is the value of the global variable \texttt{x},
2587 rather than the local \texttt{x}, because the scope of the local variable
2588 \texttt{x} only starts after the full declarator for the local \texttt{x}.}
2590 \textit{Due to optimization, the scope of an object may be
2591 non-contiguous and require use of a \addtoindex{range list} even when
2592 the containing scope is contiguous. Conversely, the scope of
2593 an object may not require its own \addtoindex{range list} even when the
2594 containing scope is non-contiguous.}