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.
120 \textit{A full compilation unit typically represents the text and
121 data contributed to an executable by a single relocatable
122 object file. It may be derived from several source files,
123 including pre-processed header files.
124 A \addtoindex{partial compilation unit} typically represents a part
125 of the text and data of a relocatable object file, in a manner that
126 can potentially be shared with the results of other compilations
127 to save space. It may be derived from an \doublequote{include file,}
128 template instantiation, or other implementation-dependent
129 portion of a compilation. A full compilation unit can also
130 function in a manner similar to a partial compilation unit
132 See Appendix \refersec{app:dwarfcompressionandduplicateeliminationinformative}
133 for discussion of related compression techniques.}
135 A compilation unit entry owns debugging information
136 entries that represent all or part of the declarations
137 made in the corresponding compilation. In the case of a
138 partial compilation unit, the containing scope of its owned
139 declarations is indicated by imported unit entries in one
140 or more other compilation unit entries that refer to that
141 partial compilation unit (see
142 Section \refersec{chap:importedunitentries}).
144 Compilation unit entries may have the following
146 \begin{enumerate}[1. ]
147 \item Either a \DWATlowpc{} and
148 \DWAThighpc{} pair of
149 \addtoindexx{high PC attribute}
151 \addtoindexx{low PC attribute}
153 \addtoindexx{ranges attribute}
155 \DWATranges{} attribute
156 \addtoindexx{ranges attribute}
158 \addtoindexx{discontiguous address ranges|see{non-contiguous address ranges}}
160 non-contiguous address ranges, respectively,
161 of the machine instructions generated for the compilation
162 unit (see Section \refersec{chap:codeaddressesandranges}).
164 A \DWATlowpc{} attribute
165 may also be specified in combination
166 \addtoindexx{ranges attribute}
168 \DWATranges{} to specify the
169 \addtoindexx{ranges attribute}
170 default base address for use in
171 \addtoindexx{location list}
172 location lists (see Section
173 \refersec{chap:locationlists}) and range lists
174 \addtoindexx{range list}
175 (see Section \refersec{chap:noncontiguousaddressranges}).
177 \item \hypertarget{chap:DWATnamepathnameofcompilationsource}{}
178 A \DWATnameDEFN{} attribute \addtoindexx{name attribute}
179 whose value is a null-terminated string
180 containing the full or relative path name
181 (relative to the value of the \DWATcompdir{} attribute,
182 see below) of the primary
183 source file from which the compilation unit was derived.
185 \item \hypertarget{chap:DWATlanguageprogramminglanguage}{}
186 A \DWATlanguageDEFN{} attribute\addtoindexx{language attribute}
187 whose constant value is an integer code
188 indicating the source language of the compilation
189 unit. The set of language names and their meanings are given
190 in Table \refersec{tab:languagenames}.
193 \setlength{\extrarowheight}{0.1cm}
194 \begin{longtable}{l|l}
195 \caption{Language names} \label{tab:languagenames} \\
196 \hline \bfseries Language name & \bfseries Meaning \\ \hline
198 \bfseries Language name & \bfseries Meaning \\ \hline
200 \hline \emph{Continued on next page}
203 \addtoindexx{ISO-defined language names}
204 \DWLANGAdaeightythreeTARG{} \dag & ISO Ada:1983 \addtoindexx{Ada:1983 (ISO)} \\
205 \DWLANGAdaninetyfiveTARG{} \dag & ISO Ada:1995 \addtoindexx{Ada:1995 (ISO)} \\
206 \DWLANGCTARG & Non-standardized C, such as K\&R \addtoindexx{C!non-standard} \\*
207 \DWLANGCeightynineTARG & ISO C:1989 \addtoindexx{C:1989 (ISO)} \\*
208 \DWLANGCninetynineTARG & ISO C:1999 \addtoindexx{C:1999 (ISO)} \\*
209 \DWLANGCelevenTARG & ISO C:2011 \addtoindexx{C:2011 (ISO)} \\*
210 \DWLANGCplusplusTARG & ISO C++98 \addtoindexx{C++98 (ISO)} \\
211 \DWLANGCpluspluszerothreeTARG & ISO C++03 \addtoindexx{C++03 (ISO)} \\
212 \DWLANGCpluspluselevenTARG & ISO C++11 \addtoindexx{C++11 (ISO)} \\
213 \DWLANGCplusplusfourteenTARG & ISO C++14 \addtoindexx{C++14 (ISO)}
215 \DWLANGCobolseventyfourTARG & ISO COBOL:1974 \addtoindexx{COBOL:1974 (ISO)} \\
216 \DWLANGCoboleightyfiveTARG & ISO COBOL:1985 \addtoindexx{COBOL:1985 (ISO)} \\
217 \DWLANGDTARG{}~\dag & D \addtoindexx{D language} \\
218 \DWLANGDylanTARG~\dag & Dylan \addtoindexx{Dylan} \\
219 \DWLANGFortranseventysevenTARG & ISO FORTRAN:1977 \addtoindexx{FORTRAN:1977 (ISO)} \\
220 \DWLANGFortranninetyTARG & ISO Fortran:1990 \addtoindexx{Fortran:1990 (ISO)} \\
221 \DWLANGFortranninetyfiveTARG & ISO Fortran:1995 \addtoindexx{Fortran:1995 (ISO)} \\
222 \DWLANGFortranzerothreeTARG & ISO Fortran:2004 \addtoindexx{Fortran:2004 (ISO)} \\
223 \DWLANGFortranzeroeightTARG & ISO Fortran:2010 \addtoindexx{Fortran:2010 (ISO)} \\
224 \DWLANGGoTARG{}~\dag & \addtoindex{Go} \\
225 \DWLANGHaskellTARG{} \dag & \addtoindex{Haskell} \\
226 \DWLANGJavaTARG{} & \addtoindex{Java}\\
227 \DWLANGJuliaTARG{}~\dag & \addtoindex{Julia} \\
228 \DWLANGModulatwoTARG & ISO Modula\dash 2:1996 \addtoindexx{Modula-2:1996 (ISO)} \\
229 \DWLANGModulathreeTARG & \addtoindex{Modula-3} \\
230 \DWLANGObjCTARG{} & \addtoindex{Objective C} \\
231 \DWLANGObjCplusplusTARG{} & \addtoindex{Objective C++} \\
232 \DWLANGOCamlTARG{}~\dag & \addtoindex{OCaml}\index{Objective Caml|see{OCaml}} \\
233 \DWLANGOpenCLTARG{}~\dag & \addtoindex{OpenCL} \\
234 \DWLANGPascaleightythreeTARG & ISO Pascal:1983 \addtoindexx{Pascal:1983 (ISO)} \\
235 \DWLANGPLITARG{}~\dag & ANSI PL/I:1976 \addtoindexx{PL/I:1976 (ANSI)} \\
236 \DWLANGPythonTARG{}~\dag & \addtoindex{Python} \\
237 \DWLANGRenderScriptTARG~\dag & \addtoindex{RenderScript Kernal Language}
239 \DWLANGRustTARG{}~\dag & \addtoindex{Rust} \\
241 & \addtoindex{Swift} \\
242 \DWLANGUPCTARG{} & UPC (Unified Parallel C) \addtoindexx{UPC}
243 \index{Unified Parallel C|see{UPC}} \\
245 \dag \ \ \textit{Support for these languages is limited}& \\
250 \item \hypertarget{chap:DWATstmtlistlinenumberinformationforunit}{}
251 A \DWATstmtlistDEFN{}\addtoindexx{statement list attribute}
252 attribute whose value is a
253 \addtoindexx{section offset!in statement list attribute}
254 section offset to the line number information for this compilation
257 This information is placed in a separate object file
258 section from the debugging information entries themselves. The
259 value of the statement list attribute is the offset in the
260 \dotdebugline{} section of the first byte of the line number
261 information for this compilation unit
262 (see Section \refersec{chap:linenumberinformation}).
264 \item A \DWATmacrosDEFN{}\hypertarget{chap:DWATmacrosmacroinformation}{}
266 \addtoindexx{macro information attribute}
268 \addtoindexx{section offset!in macro information attribute}
269 section offset to the macro information for this compilation unit.
271 This information is placed in a separate object file section
272 from the debugging information entries themselves. The
273 value of the macro information attribute is the offset in
274 the \dotdebugmacro{} section of the first byte of the macro
275 information for this compilation unit
276 (see Section \refersec{chap:macroinformation}).
278 \textit{The \DWATmacrosNAME{} attribute is new in \DWARFVersionV,
280 \DWATmacroinfoDEFN{} attribute of earlier DWARF versions.
281 \livetarg{chap:DWATmacroinfomacroinformation}{}
282 While \DWATmacrosNAME{} and \DWATmacroinfoNAME{} attributes cannot both occur in the same
283 compilation unit, both may be found in the set of units that make up an executable
284 or shared object file. The two attributes have distinct encodings to facilitate such
288 \item \hypertarget{chap:DWATcompdircompilationdirectory}{}
289 A \DWATcompdirDEFN{} attribute\addtoindexx{compilation directory attribute}
291 null-terminated string containing the current working directory
292 of the compilation command that produced this compilation
293 unit in whatever form makes sense for the host system.
295 \item \hypertarget{chap:DWATproducercompileridentification}{}
296 A \DWATproducerDEFN{} attribute\addtoindexx{producer attribute}
297 whose value is a null-terminated string containing
298 information about the compiler that produced the compilation unit.
301 \textit{The actual contents of
302 the string will be specific to each producer, but should
303 begin with the name of the compiler vendor or some other
304 identifying character sequence that will avoid confusion
305 with other producer values.}
309 \item \hypertarget{chap:DWATidentifiercaseidentifiercaserule}{}
310 A \DWATidentifiercaseDEFN{} attribute
311 \addtoindexx{identifier case attribute} whose integer
312 constant value is a code describing the treatment
313 of identifiers within this compilation unit. The
314 set of identifier case codes is given in
315 Table \refersec{tab:identifiercasecodes}.
317 \begin{simplenametable}{Identifier case codes}{tab:identifiercasecodes}
318 \DWIDcasesensitive{} \\
321 \DWIDcaseinsensitive{} \\
322 \end{simplenametable}
324 \DWIDcasesensitiveTARG{} is the default for all compilation units
325 that do not have this attribute. It indicates that names given
326 as the values of \DWATname{} attributes
327 \addtoindexx{name attribute}
328 in debugging information
329 entries for the compilation unit reflect the names as they
330 appear in the source program.
333 \textit{A debugger should be sensitive
334 to the case of \addtoindex{identifier names} when doing identifier
339 \DWIDupcaseTARG{} means that the
340 producer of the debugging
341 information for this compilation unit converted all source
342 names to upper case. The values of the name attributes may not
343 reflect the names as they appear in the source program.
346 \textit{A debugger should convert all names to upper case
350 \DWIDdowncaseTARG{} means that the producer of the debugging
351 information for this compilation unit converted all source
352 names to lower case. The values of the name attributes may not
353 reflect the names as they appear in the source program.
356 \textit{A debugger should convert all names to lower case
361 \DWIDcaseinsensitiveTARG{} means that the values of the name
362 attributes reflect the names as they appear in the source
363 program but that case is not significant.
366 \textit{A debugger should ignore case when doing lookups.}
371 \item \hypertarget{chap:DWATbasetypesprimitivedatatypesofcompilationunit}{}
372 A \DWATbasetypesDEFN{} attribute\addtoindexx{base types attribute}
373 whose value is a \livelink{chap:classreference}{reference}.
374 This attribute points to a debugging information entry
375 representing another compilation unit. It may be used
376 to specify the compilation unit containing the base type
377 entries used by entries in the current compilation unit
378 (see Section \refersec{chap:basetypeentries}).
381 \textit{This attribute provides a consumer a way to find the definition
382 of base types for a compilation unit that does not itself
383 contain such definitions. This allows a consumer, for example,
384 to interpret a type conversion to a base type correctly.}
386 \item \hypertarget{chap:DWATuseUTF8compilationunitusesutf8strings}{}
387 A \DWATuseUTFeightDEFN{} attribute,
388 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
389 which is a \livelink{chap:classflag}{flag} whose
390 presence indicates that all strings (such as the names of
391 declared entities in the source program, or filenames in the line number table)
392 are represented using the UTF-8 representation.
396 \hypertarget{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}{}
397 A \DWATmainsubprogramDEFN{} attribute,\addtoindexx{main subprogram attribute}
398 which is a \livelink{chap:classflag}{flag},
399 whose presence indicates that the compilation unit contains a
400 subprogram that has been identified as the starting
401 subprogram of the program. If more than one compilation unit contains
402 this \nolink{flag}, any one of them may contain the starting
405 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
407 to specify and provide a user-specified name for the main
408 subroutine of a program.
409 \addtoindex{C} uses the name \doublequote{main} to identify
410 the main subprogram of a program. Some other languages provide
411 similar or other means to identify the main subprogram of
412 a program. The \DWATmainsubprogram{} attribute may also be used to
413 identify such subprograms (see
414 Section \refersec{chap:generalsubroutineandentrypointinformation}).}
417 \hypertarget{chap:DWATentrypcofcompileunit}{}
418 \hypertarget{chap:DWATentrypcofpartialunit}{}
419 A \DWATentrypc{} attribute whose value is the address of the first
420 \addtoindexx{entry pc attribute}
421 executable instruction of the unit (see
422 Section \refersec{chap:entryaddress}).
425 \item \hypertarget{chap:DWATstroffsetbaseforindirectstringtable}{}
426 A \DWATstroffsetsbaseDEFN\addtoindexx{string offset base attribute}
427 attribute, whose value is of class \CLASSstroffsetsptr.
428 This attribute points to the first string
429 offset of the compilation unit's contribution to the
430 \dotdebugstroffsets{} (or \dotdebugstroffsetsdwo{}) section.
431 Indirect string references
432 (using \DWFORMstrx) within the compilation unit are
433 interpreted as indices relative to this base.
436 \item \hypertarget{chap:DWATaddrbaseforaddresstable}{}
437 A \DWATaddrbaseDEFN\addtoindexx{address table base attribute}
438 attribute, whose value is of class \CLASSaddrptr.
439 This attribute points to the beginning of the compilation
440 unit's contribution to the \dotdebugaddr{} section.
441 Indirect references (using \DWFORMaddrx, \DWOPaddrx,
443 \DWOPconstx, \DWLLEbaseaddressx{},
444 \DWLLEstartxendx{} or \DWLLEstartxlength)
446 within the compilation unit are interpreted as indices
447 relative to this base.
450 \item \hypertarget{chap:DWATrnglistsbaseforrnglists}{}
452 A \DWATrnglistsbaseDEFN\addtoindexx{ranges table base attribute}
453 attribute, whose value is of class \CLASSrnglistsptr.
454 This attribute points to the base of the compilation
455 unit's contribution to the \dotdebugrnglists{} section.
456 References to range lists (using \DWFORMrnglistx)
457 within the compilation unit are
458 interpreted relative to this base.
461 \item \hypertarget{chap:DWATloclistsbaseinlocationlist}{}
463 A \DWATloclistsbase{}\addtoindexx{location table base attribute}
464 attribute, whose value is of class \CLASSloclistsptr.
465 This attribute points to the base of the compilation
466 unit’s contribution to the \dotdebugloclists{} section. References
467 to location lists (using \DWFORMloclistx) within the compilation
468 unit are interpreted relative to this base.
472 The base address of a compilation unit is defined as the
473 value of the \DWATlowpc{} attribute, if present; otherwise,
474 it is undefined. If the base address is undefined, then any
475 DWARF entry or structure defined in terms of the base address
476 of that compilation unit is not valid.
479 \subsection{Skeleton Compilation Unit Entries}
480 \label{chap:skeletoncompilationunitentries}
481 \addtoindexx{compilation unit!skeleton}
482 \addtoindexx{skeleton compilation unit}
483 When generating a \splitDWARFobjectfile{} (see
484 Section \refersec{datarep:splitdwarfobjectfiles}), the
485 compilation unit in the \dotdebuginfo{} section is a "skeleton"
486 compilation unit with the tag
487 \DWTAGskeletonunitTARG, which contains a
488 \DWATdwoname{} attribute as well as a subset of the
489 attributes of a full or partial compilation unit. In general,
490 it contains those attributes that are necessary for the consumer
491 to locate the object file where the split full compilation unit
492 can be found, and for the consumer to interpret references to
493 addresses in the program.
496 A skeleton compilation unit has no children.
498 A skeleton compilation unit has a \DWATdwoname{} attribute:
500 \begin{enumerate}[1. ]
502 \item \livetarg{chap:DWATdwonameforunit}{}
503 A \DWATdwonameDEFN{} attribute
504 \addtoindexx{split DWARF object file name attribute}
506 null-terminated string containing the full or relative
507 path name (relative to the value of the \DWATcompdir{} attribute,
508 see below) of the object file that contains the full
511 The value in the \HFNdwoid{} field of the unit header for
512 this unit is the same as the value in the \HFNdwoid{} field
513 of the unit header of the corresponding full compilation
514 unit (see Section \refersec{datarep:unitheaders}).
516 \textit{The means of determining a compilation unit ID does
517 not need to be similar or related to the means of
518 determining a \TUsignature. However, it should
519 be suitable for detecting file version skew or other
520 kinds of mismatched files and for looking up a full
521 split unit in a DWARF package file
522 (see Section \refersec{datarep:dwarfpackagefiles}).}
526 A skeleton compilation unit may have additional attributes,
527 which are the same as for conventional compilation unit entries
528 except as noted, from among the following:
529 \begin{enumerate}[1. ]
530 \addtocounter{enumi}{1}
531 \item Either a \DWATlowpc{} and \DWAThighpc{} pair of attributes
532 or a \DWATranges{} attribute.
533 \item A \DWATstmtlist{} attribute.
534 \item A \DWATcompdir{} attribute.
537 \item A \DWATuseUTFeight{} attribute.
539 \textit{This attribute applies to strings referred to by the skeleton
540 compilation unit entry itself, and strings in the associated line
542 The representation for strings in the object file referenced
543 by the \DWATdwoname{} attribute is determined by the presence
544 of a \DWATuseUTFeight{} attribute in the full compilation unit
545 (see Section \refersec{chap:splitfullcompilationunitentries}).}
547 \item A \DWATstroffsetsbase{} attribute, for indirect strings references
548 from the skeleton compilation unit.
549 \item A \DWATaddrbase{} attribute.
555 All other attributes of a compilation unit entry (described
556 in Section \refersec{chap:fullandpartialcompilationunitentries})
560 placed in the split full compilation unit
561 (see \refersec{chap:splitfullcompilationunitentries}).
562 The attributes provided by the skeleton compilation
563 unit entry do not need to be repeated in the full compilation
566 \textit{The \DWATaddrbase{}
568 and \DWATstroffsetsbase{} attributes provide context that may be
569 necessary to interpret the contents
570 of the corresponding \splitDWARFobjectfile.}
572 \textit{The \DWATbasetypes{} attribute is not defined for a
573 skeleton compilation unit.}
576 \subsection{Split Full Compilation Unit Entries}
577 \label{chap:splitfullcompilationunitentries}
578 A \definition{split full compilation unit} is represented by a
579 debugging information entry with tag \DWTAGcompileunit.
580 It is very similar to a conventional full compilation unit but
581 is logically paired with a specific skeleton compilation unit while
582 being physically separate.
584 A split full compilation unit
585 may have the following attributes,
586 which are the same as for conventional compilation unit entries
588 \begin{enumerate}[1. ]
589 \item A \DWATname{} attribute.
590 \item A \DWATlanguage{} attribute.
591 \item A \DWATmacros{} attribute.
592 The value of this attribute is of class \CLASSmacptr{}, which is
593 an offset relative to the \dotdebugmacrodwo{} section.
595 \item A \DWATproducer{} attribute.
596 \item A \DWATidentifiercase{} attribute.
597 \item A \DWATmainsubprogram{} attribute.
598 \item A \DWATentrypc{} attribute.
599 \item A \DWATuseUTFeight{} attribute.
603 \textit{The following attributes are not part of a
604 split full compilation unit entry but instead are inherited
605 (if present) from the corresponding skeleton compilation unit:
606 \DWATlowpc, \DWAThighpc, \DWATranges, \DWATstmtlist, \DWATcompdir,
607 \DWATstroffsetsbase, \DWATaddrbase{} and
609 \DWATrnglistsbase.\eb}
611 \textit{The \DWATbasetypes{} attribute is not defined for a
612 split full compilation unit.}
616 \subsection{Type Unit Entries}
617 \label{chap:typeunitentries}
618 \addtoindexx{type unit}
619 \addtoindexx{type unit|see{\textit{also} compilation unit}}
620 \addtoindexx{compilation unit!\textit{see also} type unit}
621 An object file may contain any number of separate type
622 unit entries, each representing a single complete type
624 Each \addtoindex{type unit} must be uniquely identified by
625 an 8-byte signature, stored as part of the type unit, which
626 can be used to reference the type definition from debugging
627 information entries in other compilation units and type units.
629 Conventional and split type units are identical except for
630 the sections in which they are represented
631 (see \refersec{datarep:splitdwarfobjectfiles} for details).
632 \addtoindexx{conventional type unit}
633 \addtoindexx{split type unit}
634 Moreover, the \DWATstroffsetsbase{} attribute (see below) is not
635 used in a split type unit.
637 A type unit is represented by a debugging information entry
638 with the tag \DWTAGtypeunitTARG.
639 A \addtoindex{type unit entry} owns debugging
640 information entries that represent the definition of a single
641 type, plus additional debugging information entries that may
642 be necessary to include as part of the definition of the type.
645 A type unit entry may have the following attributes:
646 \begin{enumerate}[1. ]
649 \DWATlanguage{} attribute,
651 \addtoindexx{language attribute}
652 constant value is an integer code indicating the source
653 language used to define the type. The set of language names
654 and their meanings are given in Table \refersec{tab:languagenames}.
657 \item A \DWATstmtlist{} attribute\addtoindexx{statement list attribute}
658 whose value of class \CLASSlineptr{} points to the line number
659 information for this type unit.
661 \textit{Because type units do not describe any code, they
662 do not actually need a line number table, but the line number
663 headers contain a list of directories and file names that
664 may be referenced by the \DWATdeclfile{} attribute of the
665 type or part of its description.}
667 \textit{In an object file with a conventional compilation
668 unit entry, the type unit entries may refer to (share) the
669 line number table used by the compilation unit. In a type
670 unit located in a split compilation unit, the
671 \DWATstmtlistNAME{} attribute refers to a \doublequote{specialized}
672 line number table in the \dotdebuglinedwo{} section, which
673 contains only the list of directories and file names.}
675 \textit{All type unit entries in a \splitDWARFobjectfile{} may
676 (but are not required to) refer to the same
677 \addtoindex{specialized line number table}.}
679 \item A \DWATuseUTFeight{} attribute, which is a flag
680 whose presence indicates that all strings referred to by this type
681 unit entry, its children, and its associated
682 \addtoindex{specialized line number table},
683 are represented using the UTF-8 representation.
686 \item A \DWATstroffsetsbase\addtoindexx{string offsets base attribute}
687 attribute, whose value is of class \CLASSstroffsetsptr.
688 This attribute points
689 to the first string offset of the type unit's contribution to
690 the \dotdebugstroffsets{} section. Indirect string references
691 (using \DWFORMstrx) within the type unit are interpreted
692 as indices relative to this base.
696 A \addtoindex{type unit} entry for a given type T owns a debugging
697 information entry that represents a defining declaration
698 of type T. If the type is nested within enclosing types or
699 namespaces, the debugging information entry for T is nested
700 within debugging information entries describing its containers;
701 otherwise, T is a direct child of the type unit entry.
703 A type unit entry may also own additional debugging information
704 entries that represent declarations of additional types that
705 are referenced by type T and have not themselves been placed in
706 separate type units. Like T, if an additional type U is nested
707 within enclosing types or namespaces, the debugging information
708 entry for U is nested within entries describing its containers;
709 otherwise, U is a direct child of the type unit entry.
711 The containing entries for types T and U are declarations,
712 and the outermost containing entry for any given type T or
713 U is a direct child of the type unit entry. The containing
714 entries may be shared among the additional types and between
715 T and the additional types.
717 \textit{Examples of these kinds of relationships are found in
718 Section \refersec{app:signaturecomputationexample} and
719 Section \refersec{app:declarationscompletingnondefiningdeclarations}.}
722 \textit{Types are not required to be placed in type units. In general,
723 only large types such as structure, class, enumeration, and
724 union types included from header files should be considered
725 for separate type units. Base types and other small types
726 are not usually worth the overhead of placement in separate
727 type units. Types that are unlikely to be replicated, such
728 as those defined in the main source file, are also better
729 left in the main compilation unit.}
731 \section{Module, Namespace and Importing Entries}
732 \textit{Modules and namespaces provide a means to collect related
733 entities into a single entity and to manage the names of
737 \subsection{Module Entries}
738 \label{chap:moduleentries}
739 \textit{Several languages have the concept of a \doublequote{module.}
740 \addtoindexx{Modula-2}
741 A Modula\dash 2 definition module
742 \addtoindexx{Modula-2!definition module}
743 may be represented by a module
745 \addtoindex{declaration attribute}
746 (\DWATdeclaration). A
747 \addtoindex{Fortran 90} module
748 \addtoindexx{Fortran!module (Fortran 90)}
749 may also be represented by a module entry
750 (but no declaration attribute is warranted because \addtoindex{Fortran}
751 has no concept of a corresponding module body).}
753 A module is represented by a debugging information entry
755 tag \DWTAGmoduleTARG.
756 Module entries may own other
757 debugging information entries describing program entities
758 whose declaration scopes end at the end of the module itself.
760 If the module has a name, the module entry has a
761 \DWATname{} attribute
762 \addtoindexx{name attribute}
763 whose value is a null\dash terminated string containing
766 The \addtoindex{module entry} may have either a
770 \addtoindexx{high PC attribute}
772 \addtoindexx{low PC attribute}
774 \DWATranges{} attribute
775 \addtoindexx{ranges attribute}
776 whose values encode the contiguous or non-contiguous address
777 ranges, respectively, of the machine instructions generated for
778 the module initialization
779 code\hypertarget{chap:DWATentrypcentryaddressofmoduleinitialization}{}
780 (see Section \refersec{chap:codeaddressesandranges}).
782 \addtoindexx{entry PC attribute!for module initialization}
783 \DWATentrypc{} attribute whose value is the address of
784 the first executable instruction of that initialization code
785 (see Section \refersec{chap:entryaddress}).
788 If\hypertarget{chap:DWATprioritymodulepriority}{}
789 the module has been assigned a priority, it may have a
790 \addtoindexx{priority attribute}
791 \DWATpriorityDEFN{} attribute.
792 The value of this attribute is a
793 reference to another debugging information entry describing
794 a variable with a constant value. The value of this variable
795 is the actual constant value of the module\textquoteright s priority,
796 represented as it would be on the target architecture.
798 \subsection{Namespace Entries}
799 \label{chap:namespaceentries}
800 \textit{\addtoindex{C++} has the notion of a namespace, which provides a way to
801 \addtoindexx{namespace (C++)}
802 implement name hiding, so that names of unrelated things
803 do not accidentally clash in the
804 \addtoindex{global namespace} when an
805 application is linked together.}
807 A namespace is represented by a debugging information entry
808 with the tag \DWTAGnamespaceTARG. A namespace extension
809 is\hypertarget{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}{}
810 represented by a \DWTAGnamespaceNAME{} entry with a
811 \DWATextensionDEFN{}\addtoindexx{extension attribute}
812 attribute referring to the previous extension, or if there
813 is no previous extension, to the original
814 \DWTAGnamespaceNAME{}
815 entry. A namespace extension entry does not need to duplicate
816 information in a previous extension entry of the namespace
817 nor need it duplicate information in the original namespace
818 entry. (Thus, for a namespace with a name,
819 a \DWATname{} attribute
820 \addtoindexx{name attribute}
821 need only be attached directly to the original
822 \DWTAGnamespaceNAME{} entry.)
825 Namespace and namespace extension entries may own
826 \addtoindexx{namespace extension entry}
828 \addtoindexx{namespace declaration entry}
829 debugging information entries describing program entities
830 whose declarations occur in the namespace.
832 A namespace may have a
833 \DWATexportsymbolsDEFN{}\livetarg{chap:DWATexportsymbolsofnamespace}{}
834 attribute\addtoindexx{export symbols attribute}
835 \addtoindexx{inline namespace|see{\textit{also} export symbols attribute}}
836 which is a \CLASSflag{} which
837 indicates that all member names defined within the
838 namespace may be referenced as if they were defined within
839 the containing namespace.
841 \textit{This may be used to describe an \addtoindex{inline namespace} in \addtoindex{C++}}.
843 If a type, variable, or function declared in a namespace is
844 defined outside of the body of the namespace declaration,
845 that type, variable, or function definition entry has a
846 \DWATspecification{} attribute
847 \addtoindexx{specification attribute}
848 whose value is a \livelink{chap:classreference}{reference} to the
849 debugging information entry representing the declaration of
850 the type, variable or function. Type, variable, or function
852 \DWATspecification{} attribute
853 \addtoindexx{specification attribute}
855 to duplicate information provided by the declaration entry
856 referenced by the specification attribute.
858 \textit{The \addtoindex{C++} \addtoindex{global namespace}
860 \addtoindexx{global namespace|see{namespace (C++), global}}
862 \addtoindexx{namespace (C++)!global}
864 \texttt{::f}, for example) is not explicitly represented in
865 DWARF with a namespace entry (thus mirroring the situation
866 in \addtoindex{C++} source).
867 Global items may be simply declared with no
868 reference to a namespace.}
870 \textit{The \addtoindex{C++}
871 compilation unit specific \doublequote{unnamed namespace} may
872 \addtoindexx{namespace (C++)!unnamed}
873 \addtoindexx{unnamed namespace|see {namespace (C++), unnamed}}
874 be represented by a namespace entry with no name attribute in
875 the original namespace declaration entry (and therefore no name
876 attribute in any namespace extension entry of this namespace).
878 C++ states that declarations in the unnamed namespace are
879 implicitly available in the containing scope; a producer
880 should make this effect explicit with the \DWATexportsymbols{}
881 attribute, or by using a \DWTAGimportedmodule{} that is a
882 sibling of the namespace entry and references it.
886 \textit{A compiler emitting namespace information may choose to
887 explicitly represent namespace extensions, or to represent the
888 final namespace declaration of a compilation unit; this is a
889 quality-of-implementation issue and no specific requirements
890 are given here. If only the final namespace is represented,
891 \addtoindexx{namespace (C++)!using declaration}
892 it is impossible for a debugger to interpret using declaration
893 references in exactly the manner defined by the
894 \addtoindex{C++} language.}
896 \textit{For \addtoindex{C++} namespace examples,
897 see Appendix \refersec{app:namespaceexamples}.}
901 \subsection{Imported (or Renamed) Declaration Entries}
902 \label{chap:importedorrenameddeclarationentries}
904 \textit{Some languages support the concept of importing into or
905 making accessible in a given unit certain declarations that occur
906 in a different module or scope. An imported declaration may
907 sometimes be given another name.}
910 An imported declaration is represented by one or
911 \addtoindexx{imported declaration entry}
912 more debugging information entries with the
913 tag \DWTAGimporteddeclarationTARG.
914 When\hypertarget{chap:DWATimportimporteddeclaration}{}
915 an overloaded entity is imported, there is one imported
916 declaration entry for each overloading.
917 Each imported declaration entry has a
918 \DWATimportDEFN{} attribute,\addtoindexx{import attribute}
919 whose value is a \livelink{chap:classreference}{reference} to the
920 debugging information entry representing the declaration that
923 An imported declaration may also have a \DWATname{}
924 attribute\addtoindexx{name attribute}
925 whose value is a null-terminated string containing the
927 imported entity is to be known in the context of the imported
928 declaration entry (which may be different than the name of
929 the entity being imported). If no name is present, then the
930 name by which the entity is to be known is the same as the
931 name of the entity being imported.
933 An imported declaration entry with a name attribute may be
934 used as a general means to rename or provide an alias for
935 \addtoindexx{alias declaration|see{imported declaration entry}}
936 an entity, regardless of the context in which the importing
937 declaration or the imported entity occurs.
939 \textit{A \addtoindex{C++}
940 namespace alias\hypertarget{chap:DWATimportnamespacealias}{}
941 may be represented by an imported declaration entry
942 \addtoindexx{namespace (C++)!alias}
943 with a name attribute whose value is
944 a null-terminated string containing the alias name
945 and a \DWATimportDEFN{} attribute
946 whose value is a \livelink{chap:classreference}{reference} to the
947 applicable original namespace or namespace extension entry.}
949 \textit{A \addtoindex{C++} using declaration may be represented
951 imported\hypertarget{chap:DWATimportnamespaceusingdeclaration}{}
952 \addtoindexx{namespace (C++)!using declaration}
953 declaration entries. When the using declaration
954 refers to an overloaded function, there is one imported
955 declaration entry corresponding to each overloading. Each
956 imported declaration entry has no name attribute but it does
957 have a \DWATimportDEFN{} attribute that refers to the entry for the
958 entity being imported. (\addtoindex{C++}
959 provides no means to \doublequote{rename}
960 an imported entity, other than a namespace).}
963 \textit{A \addtoindex{Fortran} use statement
964 \addtoindexx{Fortran!use statement}
965 \addtoindexx{use statement|see {Fortran, use statement}}
966 with an \doublequote{only list} may be
967 represented by a series of imported declaration entries,
968 one (or more) for each entity that is imported. An entity
969 \addtoindexx{renamed declaration|see{imported declaration entry}}
970 that is renamed in the importing context may be represented
971 by an imported declaration entry with a name attribute that
972 specifies the new local name.
975 \subsection{Imported Module Entries}
976 \label{chap:importedmoduleentries}
978 \textit{Some languages support the concept of importing into or making
979 accessible in a given unit all of the declarations contained
980 within a separate module or namespace.
983 An imported module declaration is represented by a debugging
984 information entry with
985 \addtoindexx{imported module attribute}
987 \addtoindexx{imported module entry}
988 tag \DWTAGimportedmoduleTARG.
990 imported module entry contains a
991 \DWATimport{} attribute
992 \addtoindexx{import attribute}
993 whose value is a \livelink{chap:classreference}{reference}
994 to the module or namespace entry
995 containing the definition and/or declaration entries for
996 the entities that are to be imported into the context of the
997 imported module entry.
999 An imported module declaration may own a set of imported
1000 declaration entries, each of which refers to an entry in the
1001 module whose corresponding entity is to be known in the context
1002 of the imported module declaration by a name other than its
1003 name in that module. Any entity in the module that is not
1004 renamed in this way is known in the context of the imported
1005 module entry by the same name as it is declared in the module.
1007 \textit{A \addtoindex{C++} using directive
1008 \addtoindexx{namespace (C++)!using directive}
1009 \addtoindexx{using directive|see {namespace (C++), using directive}}
1010 may be represented by an imported
1011 module\hypertarget{chap:DWATimportnamespaceusingdirective}{}
1012 entry, with a \DWATimportDEFN{} attribute referring to the namespace
1013 entry of the appropriate extension of the namespace (which
1014 might be the original namespace entry) and no owned entries.
1017 \textit{A \addtoindex{Fortran} use statement
1018 \addtoindexx{Fortran!use statement}
1019 with a \doublequote{rename list} may be
1020 represented by an imported module entry with an import
1021 attribute referring to the module and owned entries
1022 corresponding to those entities that are renamed as part of
1026 \textit{A \addtoindex{Fortran} use statement
1027 \addtoindexx{Fortran!use statement}
1028 with neither a \doublequote{rename list} nor
1029 an \doublequote{only list} may be represented by an imported module
1030 entry with an import attribute referring to the module and
1031 no owned child entries.
1034 \textit{A use statement with an \doublequote{only list} is represented by a
1035 series of individual imported declaration entries as described
1036 in Section \refersec{chap:importedorrenameddeclarationentries}.
1040 \textit{A \addtoindex{Fortran} use statement for an entity in a module that is
1041 \addtoindexx{Fortran!use statement}
1042 itself imported by a use statement without an explicit mention
1043 may be represented by an imported declaration entry that refers
1044 to the original debugging information entry. For example, given
1061 \textit{the imported declaration entry for Q within module C refers
1062 directly to the variable declaration entry for X in module A
1063 because there is no explicit representation for X in module B.
1066 \textit{A similar situation arises for a \addtoindex{C++} using declaration
1067 \addtoindexx{namespace (C++)!using declaration}
1068 \addtoindexx{using declaration|see {namespace (C++), using declaration}}
1069 that imports an entity in terms of a namespace alias. See
1070 Appendix \refersec{app:namespaceexamples}
1074 \subsection{Imported Unit Entries}
1075 \label{chap:importedunitentries}
1076 \hypertarget{chap:DWATimportimportedunit}{}
1077 The place where a normal or partial compilation unit is imported is
1078 represented by a debugging information entry with the
1079 \addtoindexx{imported unit entry}
1080 tag \DWTAGimportedunitTARG.
1081 An imported unit entry contains a
1082 \DWATimportDEFN{} attribute\addtoindexx{import attribute}
1083 whose value is a \livelink{chap:classreference}{reference} to the
1084 normal or partial compilation unit whose declarations logically
1085 belong at the place of the imported unit entry.
1087 \textit{An imported unit entry does not necessarily correspond to
1088 any entity or construct in the source program. It is merely
1089 \doublequote{glue} used to relate a partial unit, or a compilation
1090 unit used as a partial unit, to a place in some other
1093 \section{Subroutine and Entry Point Entries}
1094 \label{chap:subroutineandentrypointentries}
1096 The following tags exist to describe
1097 debugging information entries
1098 \addtoindexx{function entry|see{subroutine entry}}
1100 \addtoindexx{subroutine entry}
1102 \addtoindexx{subprogram entry}
1104 % FIXME: is entry point entry the right index 'entry'?
1105 \addtoindexx{entry point entry}
1108 \begin{tabular}{lp{9.0cm}}
1109 \DWTAGsubprogramTARG{} & A subroutine or function \\
1110 \DWTAGinlinedsubroutine{} & A particular inlined
1111 \addtoindexx{inlined subprogram entry}
1112 instance of a subroutine or function \\
1113 \DWTAGentrypointTARG{} & An alternate entry point \\
1118 \subsection{General Subroutine and Entry Point Information}
1119 \label{chap:generalsubroutineandentrypointinformation}
1120 The subroutine or entry point entry has a \DWATname{}
1121 attribute whose value is a null-terminated string containing the
1122 subroutine or entry point name.
1123 It may also have a \DWATlinkagename{} attribute as
1124 described in Section \refersec{chap:linkagenames}.
1126 If the name of the subroutine described by an entry with the
1127 \addtoindexx{subprogram entry}
1128 tag \DWTAGsubprogram{}\hypertarget{chap:DWATexternalexternalsubroutine}{}
1129 is visible outside of its containing
1130 compilation unit, that entry has a
1131 \DWATexternalDEFN{} attribute,\addtoindexx{external attribute}
1132 which is a \livelink{chap:classflag}{flag}.
1134 \textit{Additional attributes for functions that are members of a
1135 class or structure are described in
1136 Section \refersec{chap:memberfunctionentries}.
1139 A\hypertarget{chap:DWATmainsubprogrammainorstartingsubprogram}{}
1140 subroutine entry may contain a
1141 \DWATmainsubprogramDEFN{} attribute
1142 \addtoindexx{main subprogram attribute}
1144 a \CLASSflag{} whose presence indicates that the
1145 subroutine has been identified as the starting function of
1146 the program. If more than one subprogram contains this
1148 any one of them may be the starting subroutine of the program.
1150 \textit{See also Section \refersec{chap:unitentries}) regarding the
1151 related use of this attribute to indicate that a compilation
1152 unit contains the main subroutine of a program.}
1154 \subsubsection{Calling Convention Information}
1155 \hypertarget{chap:DWATcallingconventionforsubprograms}{}
1156 A subroutine entry may contain a
1157 \DWATcallingconventionDEFN{}
1158 \addtoindexx{calling convention attribute!for subprogram}
1159 attribute, whose value is an
1160 \livelink{chap:classconstant}{integer constant}. The set of
1161 \addtoindexi{calling convention codes for subroutines}{calling convention codes!for subroutines}
1162 is given in Table \refersec{tab:callingconventioncodesforsubroutines}.
1164 \begin{simplenametable}[1.4in]{Calling convention codes for subroutines}{tab:callingconventioncodesforsubroutines}
1168 \end{simplenametable}
1170 If this attribute is not present, or its value is the constant
1171 \DWCCnormalTARG, then the subroutine may be safely called by
1172 obeying the \doublequote{standard} calling conventions of the target
1173 architecture. If the value of the calling convention attribute
1174 is the constant \DWCCnocallTARG, the subroutine does not obey
1175 standard calling conventions, and it may not be safe for the
1176 debugger to call this subroutine.
1178 \textit{Note that \DWCCnormal{} is also used as a calling convention
1179 code for certain types
1180 (see Table \refersec{tab:callingconventioncodesfortypes}).}
1182 If the semantics of the language of the compilation unit
1183 containing the subroutine entry distinguishes between ordinary
1184 subroutines and subroutines that can serve as the \doublequote{main
1185 program,} that is, subroutines that cannot be called
1186 directly according to the ordinary calling conventions,
1187 then the debugging information entry for such a subroutine
1188 may have a calling convention attribute whose value is the
1189 constant \DWCCprogramTARG.
1191 \textit{A common debugger feature is to allow the debugger user to call
1192 a subroutine within the subject program. In certain cases,
1193 however, the generated code for a subroutine will not obey
1194 the standard calling conventions for the target architecture
1195 and will therefore not be safe to call from within a debugger.}
1197 \textit{The \DWCCprogram{}
1198 value is intended to support \addtoindex{Fortran} main
1199 \addtoindexx{Fortran!main program}
1200 programs which in some implementations may not be callable
1201 or which must be invoked in a special way. It is not intended
1202 as a way of finding the entry address for the program.}
1205 \subsubsection{Miscellaneous Subprogram Properties}
1206 \textit{In \addtoindex{C}
1207 there is a difference between the types of functions
1208 declared using function prototype style declarations and
1209 those declared using non-prototype declarations.}
1211 A subroutine entry declared with a function prototype style
1212 declaration may have a
1213 \addtoindexx{prototyped attribute}
1214 \DWATprototypedDEFN{} attribute, which is
1216 The attribute indicates whether a subroutine entry point corresponds
1217 to a function declaration that includes parameter prototype information.
1219 A subprogram entry may have
1220 a\hypertarget{chap:DWATelementalelementalpropertyofasubroutine}{}
1221 \DWATelementalDEFN{} attribute,\addtoindexx{elemental attribute}
1222 which is a \livelink{chap:classflag}{flag}.
1223 The attribute indicates whether the subroutine
1224 or entry point was declared with the \doublequote{elemental} keyword
1227 A\hypertarget{chap:DWATpurepurepropertyofasubroutine}{}
1228 subprogram entry may have a
1229 \addtoindexx{pure attribute}
1230 \DWATpureDEFN{} attribute, which is
1231 a \livelink{chap:classflag}{flag}.
1232 The attribute indicates whether the subroutine was
1233 declared with the \doublequote{pure} keyword or property.
1235 A\hypertarget{chap:DWATrecursiverecursivepropertyofasubroutine}{}
1236 subprogram entry may have a
1237 \addtoindexx{recursive attribute}
1238 \DWATrecursiveDEFN{} attribute, which
1239 is a \livelink{chap:classflag}{flag}.
1240 The attribute indicates whether the subroutine
1241 or entry point was declared with the \doublequote{recursive} keyword
1244 A subprogram entry may have a
1246 \livetargi{chap:DWATnoreturnofsubprogram}{attribute}{noreturn attribute},
1247 which is a \CLASSflag. The attribute
1248 indicates whether the subprogram was declared with the \doublequote{noreturn} keyword or property
1249 indicating that the subprogram can be called, but will never return to its caller.
1252 \textit{The \addtoindex{Fortran}
1253 language allows the keywords \texttt{elemental}, \texttt{pure}
1254 and \texttt{recursive} to be included as part of the declaration of
1255 a subroutine; these attributes reflect that usage. These
1256 attributes are not relevant for languages that do not support
1257 similar keywords or syntax. In particular, the \DWATrecursiveNAME{}
1258 attribute is neither needed nor appropriate in languages such
1259 as \addtoindex{C} where functions support recursion by default.}
1262 \subsubsection{Call Site-Related Attributes}
1263 \textit{While subprogram attributes in the previous section provide
1264 information about the subprogram and its entry point(s) as a whole,
1265 the following attributes provide summary information about the calls
1266 that occur within a subprogram.}
1268 A subroutine entry may have \DWATcallalltailcalls,
1269 \DWATcallallcalls{} and/or \DWATcallallsourcecalls{}
1270 attributes, each of which is a \CLASSflag.
1271 \addtoindexx{call site summary information}
1272 \addtoindexx{subroutine call site summary attributes}
1273 These flags indicate the completeness of the call site
1274 information provided by call site entries (see
1275 Section \refersec{chap:callsiteentries}) within the subprogram.
1277 The \DWATcallalltailcallsDEFN{}
1278 \livetargi{chap:DWATcallalltailcallsofasubprogram}{attribute}{all tail calls summary attribute}
1279 indicates that every tail call
1280 that occurs in the code for the subprogram is described by a
1281 \DWTAGcallsite{} entry.
1282 (There may or may not be other non-tail calls to some of the same
1283 target subprograms.)
1285 The \DWATcallallcallsDEFN{}
1286 \livetargi{chap:DWATcallallcallsofasubprogram}{attribute}{all calls summary attribute}
1287 indicates that every non-inlined call
1288 (either a tail call or a normal call) that occurs in the code for the subprogram
1289 is described by a \DWTAGcallsite{} entry.
1291 The \DWATcallallsourcecallsDEFN{}
1292 \livetargi{chap:DWATcallallsourcecallsofasubprogram}{attribute}{all source calls summary attribute}
1293 indicates that every call that occurs in the
1294 code for the subprogram, including every call inlined into it, is described by either a
1295 \DWTAGcallsite{} entry or a \DWTAGinlinedsubroutine{} entry; further, any call
1296 that is optimized out is nonetheless also described using a \DWTAGcallsite{} entry
1297 that has neither a \DWATcallpc{} nor \DWATcallreturnpc{} attribute.
1299 \textit{The \DWATcallallsourcecallsNAME{} attribute is intended for debugging
1300 information format consumers that analyze call graphs.}
1302 If the the \DWATcallallsourcecalls{} attribute is present then the
1303 \DWATcallallcalls{} and \DWATcallalltailcalls{} attributes are
1304 also implicitly present. Similarly, if the
1305 \DWATcallallcalls{} attribute is present then the \DWATcallalltailcalls{}
1306 attribute is implicitly present.
1309 \subsection{Subroutine and Entry Point Return Types}
1310 \label{chap:subroutineandentrypointreturntypes}
1312 If\hypertarget{chap:DWATtypetypeofsubroutinereturn}{}
1313 the subroutine or entry point
1314 \addtoindexx{return type of subroutine}
1315 is a function that returns a
1316 value, then its debugging information entry has
1317 \addtoindexx{type attribute}
1318 a \DWATtypeDEFN{} attribute
1319 to denote the type returned by that function.
1321 \textit{Debugging information entries for
1322 \addtoindex{C} void functions should
1323 not have an attribute for the return type. }
1325 \textit{Debugging information entries for declarations of \addtoindex{C++}
1326 member functions with an
1327 \autoreturntype{} specifier should use an unspecified type entry (see
1328 Section \refersec{chap:unspecifiedtypeentries}).
1329 The debugging information entry for the corresponding definition
1330 should provide the deduced return type. This practice causes the description of
1331 the containing class to be consistent across compilation units, allowing the class
1332 declaration to be placed into a separate type unit if desired.}
1335 \subsection{Subroutine and Entry Point Locations}
1336 \label{chap:subroutineandentrypointlocations}
1338 A subroutine entry may have either a \DWATlowpc{} and
1339 \DWAThighpc{} pair of attributes or a \DWATranges{} attribute
1340 \addtoindexx{ranges attribute}
1342 \addtoindexx{high PC attribute}
1344 \addtoindexx{low PC attribute}
1345 encode the contiguous or non-contiguous address
1346 ranges, respectively, of the machine instructions generated
1347 for the subroutine (see
1348 Section \refersec{chap:codeaddressesandranges}).
1350 A\hypertarget{chap:DWATentrypcentryaddressofsubprogram}{}
1351 subroutine entry may also have a
1352 \addtoindexx{entry PC attribute!for subroutine}
1353 \DWATentrypc{} attribute
1354 whose value is the address of the first executable instruction
1355 of the subroutine (see
1356 Section \refersec{chap:entryaddress}).
1358 An entry point has a \DWATlowpc{} attribute whose value is the
1359 relocated address of the first machine instruction generated
1360 for the entry point.
1363 %\textit{While the \DWATentrypc{} attribute
1364 %\addtoindexx{entry pc attribute!for subroutine}
1365 %might also seem appropriate for this purpose, historically the
1366 %\DWATlowpc{} attribute was used before the
1367 %\DWATentrypc{} was introduced (in
1368 %\addtoindex{DWARF Version 3}).
1369 %There is insufficient reason to change this.}
1371 Subroutines and entry points may also have
1372 \DWATsegment{}\hypertarget{chap:DWATaddressclasssubroutineorsubroutinetype}{}
1373 \addtoindexx{segment attribute} and
1374 \DWATaddressclassDEFN{}\addtoindexx{address class attribute}
1375 attributes, as appropriate, to specify
1376 which segments the code for the subroutine resides in and
1377 the addressing mode to be used in calling that subroutine.
1379 A subroutine entry representing a subroutine declaration
1380 that is not also a definition does not have code address or
1384 \subsection{Declarations Owned by Subroutines and Entry Points}
1385 \label{chap:declarationsownedbysubroutinesandentrypoints}
1386 \addtoindexx{subroutine formal parameters}
1387 The declarations enclosed by a subroutine or entry point are
1388 represented by debugging information entries that are owned
1389 by the subroutine or entry point entry. Entries representing
1390 \addtoindexx{formal parameter}
1391 the formal parameters of the subroutine or entry point appear
1392 in the same order as the corresponding declarations in the
1396 \textit{There is no ordering requirement for entries for declarations
1397 other than formal parameters. The formal parameter
1398 entries may be interspersed with other entries used by formal
1399 parameter entries, such as type entries.}
1401 The unspecified (sometimes called \doublequote{varying})
1402 parameters of a subroutine parameter list are
1403 represented by a debugging information
1404 entry\addtoindexx{unspecified parameters entry}
1405 with the tag \DWTAGunspecifiedparametersTARG.
1408 The entry for a subroutine that includes a
1409 \addtoindex{Fortran}
1410 \addtoindexx{Fortran!common block}
1411 \livelink{chap:fortrancommonblock}{common}
1412 \livelink{chap:commonblockentry}{block}
1413 \addtoindexx{common block|see{Fortran common block}}
1414 has a child entry with the
1415 tag \DWTAGcommoninclusionTARG.
1416 The\hypertarget{chap:commonreferencecommonblockusage}{}
1417 common inclusion entry has a
1418 \DWATcommonreferenceDEFN{} attribute
1419 \addtoindexx{common block reference attribute}
1420 whose value is a \livelink{chap:classreference}{reference}
1421 to the debugging information entry
1422 for the common \nolink{block} being included
1423 (see Section \refersec{chap:commonblockentries}).
1425 \subsection{Low-Level Information}
1426 \label{chap:lowlevelinformation}
1428 A\hypertarget{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}{}
1429 subroutine or entry point entry may have a
1430 \addtoindexx{return address attribute}
1431 \DWATreturnaddrDEFN{}
1432 attribute, whose value is a location description. The location
1433 specified is the place where the return address for the
1434 subroutine or entry point is stored.
1436 A\hypertarget{chap:DWATframebasesubroutineframebaseaddress}{}
1437 subroutine or entry point entry may also have a
1438 \addtoindexx{frame base attribute}
1439 \DWATframebaseDEFN{} attribute, whose value is a location
1440 description that describes the \doublequote{frame base} for the
1441 subroutine or entry point. If the location description is
1442 a simple register location description, the given register
1443 contains the frame base address. If the location description is
1444 a DWARF expression, the result of evaluating that expression
1445 is the frame base address. Finally, for a
1446 \addtoindex{location list},
1447 this interpretation applies to each location description
1448 contained in the list of \addtoindex{location list} entries.
1450 \textit{The use of one of the \DWOPregn{}
1451 operations in this context is equivalent to using
1452 \DWOPbregn(0) but more
1453 compact. However, these are not equivalent in general.}
1456 \textit{The frame base for a subprogram is typically an address
1457 relative to the first unit of storage allocated for the
1458 subprogram\textquoteright s stack frame. The \DWATframebase{} attribute
1459 can be used in several ways:}
1460 \begin{enumerate}[1. ]
1461 \item \textit{In subprograms that need
1462 \addtoindexx{location list}
1463 location lists to locate local
1464 variables, the \DWATframebase{} can hold the needed location
1465 list, while all variables\textquoteright\ location descriptions can be
1466 simpler ones involving the frame base.}
1468 \item \textit{It can be used in resolving \doublequote{up\dash level} addressing
1469 within nested routines.
1470 (See also \DWATstaticlink, below)}
1474 \textit{Some languages support nested subroutines. In such languages,
1475 it is possible to reference the local variables of an
1476 outer subroutine from within an inner subroutine. The
1477 \DWATstaticlink{} and \DWATframebase{} attributes allow
1478 debuggers to support this same kind of referencing.}
1480 If\hypertarget{chap:DWATstaticlinklocationofuplevelframe}{}
1481 a subroutine or entry point is nested, it may have a
1482 \addtoindexx{address!uplevel|see {static link attribute}}
1483 \addtoindexx{uplevel address|see {static link attribute}}
1484 \DWATstaticlinkDEFN{} attribute, whose value is a location
1485 description that computes the frame base of the relevant
1486 instance of the subroutine that immediately encloses the
1487 subroutine or entry point.
1489 In the context of supporting nested subroutines, the
1490 \DWATframebase{} attribute value
1494 the following constraints:
1496 \begin{enumerate}[1. ]
1501 a value that does not change during the
1502 life of the subprogram, and
1504 \item The computed value
1508 unique among instances of
1509 the same subroutine.
1512 \textit{For typical \DWATframebase{} use, this
1513 means that a recursive subroutine\textquoteright s stack frame must have
1519 \textit{If a debugger is attempting to resolve an up\dash level reference
1520 to a variable, it uses the nesting structure of DWARF to
1521 determine which subroutine is the lexical parent and the
1522 \DWATstaticlink{} value to identify the appropriate active
1523 frame of the parent. It can then attempt to find the reference
1524 within the context of the parent.}
1528 \subsection{Types Thrown by Exceptions}
1529 \label{chap:typesthrownbyexceptions}
1531 \textit{In \addtoindex{C++} a subroutine may declare a set of types which
1532 it may validly throw.}
1534 If a subroutine explicitly declares that it may throw
1535 \addtoindexx{exception thrown|see{thrown type entry}}
1537 \addtoindexx{thrown exception|see{thrown type entry}}
1538 exception of one or more types, each such type is
1539 represented by a debugging information entry with
1540 \addtoindexx{thrown type entry}
1542 \DWTAGthrowntypeTARG.
1543 Each such entry is a child of the entry
1544 representing the subroutine that may throw this type. Each
1545 thrown type entry contains
1546 \addtoindexx{type attribute}
1547 a \DWATtype{} attribute, whose
1548 value is a \livelink{chap:classreference}{reference}
1549 to an entry describing the type of the
1550 exception that may be thrown.
1552 \subsection{Function Template Instantiations}
1553 \label{chap:functiontemplateinstantiations}
1555 \textit{In \addtoindex{C++}, a function template is a generic definition of
1556 a function that is instantiated differently for calls with
1557 values of different types. DWARF does not represent the generic
1558 template definition, but does represent each instantiation.}
1561 A \addtoindex{function template instantiation}\addtoindexx{template instantiation!function}
1562 is represented by a debugging information entry with the
1563 \addtoindexx{subprogram entry!use for template instantiation}
1564 tag \DWTAGsubprogram.
1566 exceptions, such an entry will contain the same attributes and
1567 will have the same types of child entries as would an entry
1568 for a subroutine defined explicitly using the instantiation
1569 types and values. The exceptions are:
1571 \begin{enumerate}[1. ]
1572 \item Template parameters are described and referenced as specified in
1573 Section \refersec{chap:templateparameters}.
1576 \item If the compiler has generated a separate compilation unit
1577 to hold the template instantiation and that compilation unit
1578 has a different name from the compilation unit containing
1579 the template definition, the name attribute for the debugging
1580 information entry representing that compilation unit is empty
1583 \item If the subprogram entry representing the template
1584 instantiation or any of its child entries contain declaration
1585 coordinate attributes, those attributes refer to the source
1586 for the template definition, not to any source generated
1587 artificially by the compiler for this instantiation.
1592 \subsection{Inlinable and Inlined Subroutines}
1593 \label{chap:inlinedsubroutines}
1594 A declaration or a definition of an inlinable subroutine
1595 is represented by a debugging information entry with the
1596 tag \DWTAGsubprogram.
1597 The entry for a subroutine
1598 \addtoindexx{subprogram entry!use in inlined subprogram}
1599 that is\hypertarget{chap:DWATinlineinlinedsubroutine}{}
1600 explicitly declared to be available for inline expansion or
1601 that was expanded inline implicitly by the compiler has a
1602 \addtoindexx{inline attribute}
1603 \DWATinlineDEFN{} attribute whose value is an
1604 \livelink{chap:classconstant}{integer constant}. The
1605 set of values for the \DWATinline{} attribute is given in
1606 Table \refersec{tab:inlinecodes}.
1610 \caption{Inline codes}
1611 \label{tab:inlinecodes}
1612 \begin{tabular}{l|P{8cm}}
1614 Name&Meaning\\ \hline
1615 \DWINLnotinlinedTARG{} & Not declared inline nor inlined by the
1616 \mbox{compiler} (equivalent to the absence of the
1617 containing \DWATinline{} attribute) \\
1618 \DWINLinlinedTARG{} & Not declared inline but inlined by the \mbox{compiler} \\
1619 \DWINLdeclarednotinlinedTARG{} & Declared inline but
1620 not inlined by the \mbox{compiler} \\
1621 \DWINLdeclaredinlinedTARG{} & Declared inline and inlined by the
1627 \textit{In \addtoindex{C++}, a function or a constructor declared with
1628 \addttindex{constexpr} is implicitly declared inline. The abstract
1629 instance (see Section \refersec{chap:abstractinstances})
1630 is represented by a debugging information
1631 entry with the tag \DWTAGsubprogram. Such an entry has a
1632 \DWATinline{} attribute whose value is \DWINLinlined.}
1635 \subsubsection{Abstract Instances}
1636 \label{chap:abstractinstances}
1637 Any subroutine entry that contains a
1638 \DWATinlineDEFN{} attribute\addtoindexx{inline attribute}
1639 whose value is other than
1641 is known as an \definition{abstract instance root}.
1642 \addtoindexx{abstract instance!root}
1643 \hypertarget{chap:DWATinlineabstracttinstance}{}
1644 Any debugging information entry that is owned (either
1645 directly or indirectly) by an abstract instance root
1647 \definition{abstract instance entry.}\addtoindexx{abstract instance!entry}
1648 Any set of abstract instance entries that are all
1649 children (either directly or indirectly) of some abstract
1650 instance root, together with the root itself, is known as an
1651 \definition{abstract instance tree.}\addtoindexx{abstract instance!tree}
1652 However, in the case where an abstract instance tree is
1653 nested within another abstract instance tree, the entries in the
1654 \addtoindex{nested abstract instance}
1655 tree are not considered to be entries in the outer abstract
1659 Each abstract instance root is either part of a larger
1660 \addtoindexx{abstract instance!root}
1661 tree (which gives a context for the root) or
1662 \addtoindexx{specification attribute}
1664 \DWATspecification{}
1665 to refer to the declaration in context.
1667 \textit{For example, in \addtoindex{C++} the context might be a namespace
1668 declaration or a class declaration.}
1670 \textit{Abstract instance trees are defined so that no entry is part
1671 of more than one abstract instance tree.}
1673 Attributes and children in an abstract instance are shared
1674 by all concrete instances (see Section \refersec{chap:concreteinstances}).
1676 A debugging information entry that is a member of an abstract
1681 not contain any attributes which describe
1682 aspects of the subroutine which vary between distinct inlined
1683 expansions or distinct out-of-line expansions.
1686 \textit{For example,
1687 \addtoindexx{entry pc attribute!and abstract instance}
1688 the \DWATlowpc,\addtoindexx{low PC attribute!and abstract instance}
1689 \DWAThighpc,\addtoindexx{high PC attribute!and abstract instance}
1690 \DWATranges,\addtoindexx{ranges attribute!and abstract instance}
1691 \DWATentrypc,\addtoindexx{entry PC attribute!and abstract instance}
1692 \DWATlocation,\addtoindexx{location attribute!and abstract instance}
1693 \DWATreturnaddr,\addtoindexx{return address attribute!and abstract instance}
1694 \DWATstartscope,\addtoindexx{start scope attribute!and abstract instance}
1696 \DWATsegment{}\addtoindexx{segment attribute!and abstract instance}
1697 attributes typically should be omitted; however, this list is not
1702 \textit{It would not make sense normally to put these attributes into
1703 abstract instance entries since such entries do not represent
1704 actual (concrete) instances and thus do not actually exist at
1705 run\dash time. However,
1706 see Appendix \refersec{app:inlineouteronenormalinner}
1707 for a contrary example.}
1709 The rules for the relative location of entries belonging to
1710 abstract instance trees are exactly the same as for other
1711 similar types of entries that are not abstract. Specifically,
1712 the rule that requires that an entry representing a declaration
1713 be a direct child of the entry representing the scope of the
1714 declaration applies equally to both abstract and non-abstract
1715 entries. Also, the ordering rules for formal parameter entries,
1716 member entries, and so on, all apply regardless of whether
1717 or not a given entry is abstract.
1720 \subsubsection{Concrete Instances}
1721 \label{chap:concreteinstances}
1723 Each inline expansion of a subroutine is represented
1724 by a debugging information entry with the
1725 tag \DWTAGinlinedsubroutineTARG.
1731 child of the entry that represents the scope within which
1732 the inlining occurs.
1735 Each inlined subroutine entry may have either a
1737 and \DWAThighpc{} pair of attributes
1738 \addtoindexx{high PC attribute}
1739 \addtoindexx{low PC attribute}
1740 or a \DWATranges{}\addtoindexx{ranges attribute}
1741 attribute whose values encode the contiguous or non-contiguous
1742 address ranges, respectively, of the machine instructions
1743 generated for the inlined subroutine (see
1744 Section \referfol{chap:codeaddressesandranges}).
1745 An\hypertarget{chap:DWATentrypcentryaddressofinlinedsubprogram}{}
1746 inlined subroutine entry may
1747 \addtoindexx{inlined subprogram entry!in concrete instance}
1749 \addtoindexx{inlined subprogram entry}
1751 \addtoindexx{entry PC attribute!for inlined subprogram}
1754 attribute, representing the first executable instruction of
1755 the inline expansion (see
1756 Section \refersec{chap:entryaddress}).
1758 % Positions of the 3 targets here is a bit arbitrary.
1759 An inlined\hypertarget{chap:DWATcalllinelinenumberofinlinedsubroutinecall}{}
1760 subroutine\hypertarget{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}{}
1761 entry\hypertarget{chap:DWATcallfilefilecontaininginlinedsubroutinecall}{}
1762 may also have \DWATcallfileDEFN,
1763 \DWATcalllineDEFN{} and \DWATcallcolumnDEFN{} attributes,
1764 \addtoindexx{inlined call location attributes}
1766 value is an \livelink{chap:classconstant}{integer constant}.
1767 These attributes represent the
1768 source file, source line number, and source column number,
1769 respectively, of the first character of the statement or
1770 expression that caused the inline expansion. The call file,
1771 call line, and call column attributes are interpreted in
1772 the same way as the declaration file, declaration line, and
1773 declaration column attributes, respectively (see
1774 Section \refersec{chap:declarationcoordinates}).
1776 \textit{The call file, call line and call column coordinates do not
1777 describe the coordinates of the subroutine declaration that
1778 was inlined, rather they describe the coordinates of the call.
1781 An inlined subroutine entry may have
1782 a\hypertarget{chap:DWATconstexprcompiletimeconstantfunction}{}
1783 \DWATconstexprDEFN{} attribute,\addtoindexx{constant expression attribute}
1784 which is a \livelink{chap:classflag}{flag}
1785 whose presence indicates that the
1786 subroutine has been evaluated as a compile\dash time constant. Such
1787 an entry may also have a \DWATconstvalue{} attribute,
1788 whose value may be of any form that is appropriate for the
1789 representation of the subroutine's return value. The value of
1790 this attribute is the actual return value of the subroutine,
1791 represented as it would be on the target architecture.
1793 \textit{In \addtoindex{C++}, if a function or a constructor declared with
1794 \addttindex{constexpr}
1795 is called with constant expressions, then the corresponding
1796 concrete inlined instance has a
1797 \DWATconstexpr{} attribute,
1798 as well as a \DWATconstvalue{} attribute whose value represents
1799 the actual return value of the concrete inlined instance.}
1802 Any debugging information entry that is owned (either
1803 directly or indirectly) by a debugging information entry
1804 with the tag \DWTAGinlinedsubroutine{} is referred to as a
1805 \doublequote{concrete inlined instance entry.} Any entry that has
1807 \DWTAGinlinedsubroutine{}
1808 is known as a \doublequote{concrete inlined instance root.}
1809 Any set of concrete inlined instance
1810 entries that are all children (either directly or indirectly)
1811 of some concrete inlined instance root, together with the root
1812 itself, is known as a \doublequote{concrete inlined instance tree.}
1813 However, in the case where a concrete inlined instance tree
1814 is nested within another concrete instance tree, the entries
1815 in the \addtoindex{nested concrete inline instance} tree
1816 are not considered to
1817 be entries in the outer concrete instance tree.
1820 \textit{Concrete inlined instance trees are defined so that no entry
1821 is part of more than one concrete inlined instance tree. This
1822 simplifies later descriptions.}
1824 Each concrete inlined instance tree is uniquely associated
1825 with one (and only one) abstract instance tree.
1827 \textit{Note, however, that the reverse is not true. Any given abstract
1828 instance tree may be associated with several different concrete
1829 inlined instance trees, or may even be associated with zero
1830 concrete inlined instance trees.}
1832 Concrete inlined instance entries may omit attributes that
1833 are not specific to the concrete instance (but present in
1834 the abstract instance) and need include only attributes that
1835 are specific to the concrete instance (but omitted in the
1836 abstract instance). In place of these omitted attributes,
1837 each\hypertarget{chap:DWATabstractorigininlineinstance}{}
1838 concrete inlined instance entry has a
1839 \addtoindexx{abstract origin attribute}
1840 \DWATabstractoriginDEFN{}
1841 attribute that may be used to obtain the missing information
1842 (indirectly) from the associated abstract instance entry. The
1843 value of the abstract origin attribute is a reference to the
1844 associated abstract instance entry.
1846 If an entry within a concrete inlined instance tree contains
1847 attributes describing the
1848 \addtoindexx{declaration coordinates!in concrete instance}
1849 \livelink{chap:declarationcoordinates}{declaration coordinates}
1850 of that entry, then those attributes
1852 refer to the file, line
1853 and column of the original declaration of the subroutine,
1854 not to the point at which it was inlined. As a consequence,
1855 they may usually be omitted from any entry that has an abstract
1859 For each pair of entries that are associated via a
1860 \addtoindexx{abstract origin attribute}
1861 \DWATabstractorigin{} attribute, both members of the pair
1862 have the same tag. So, for example, an entry with the tag
1863 \DWTAGvariable{} can only be associated with another entry
1864 that also has the tag \DWTAGvariable. The only exception
1865 to this rule is that the root of a concrete instance tree
1866 (which must always have the tag \DWTAGinlinedsubroutine)
1867 can only be associated with the root of its associated abstract
1868 instance tree (which must have the tag \DWTAGsubprogram).
1871 In general, the structure and content of any given concrete
1872 inlined instance tree will be closely analogous to the
1873 structure and content of its associated abstract instance
1874 tree. There are a few exceptions:
1876 \begin{enumerate}[1. ]
1877 \item An entry in the concrete instance tree may be omitted if
1879 \addtoindexx{abstract origin attribute}
1880 \DWATabstractorigin{} attribute and either
1881 has no children, or its children are omitted. Such entries
1882 would provide no useful information. In C\dash like languages,
1883 such entries frequently include types, including structure,
1884 union, class, and interface types; and members of types. If any
1885 entry within a concrete inlined instance tree needs to refer
1886 to an entity declared within the scope of the relevant inlined
1887 subroutine and for which no concrete instance entry exists,
1892 to the abstract instance entry.
1895 \item Entries in the concrete instance tree which are associated
1896 with entries in the abstract instance tree such that neither
1897 has a \DWATname{} attribute,
1898 \addtoindexx{name attribute}
1899 and neither is referenced by
1900 any other debugging information entry, may be omitted. This
1901 may happen for debugging information entries in the abstract
1902 instance trees that became unnecessary in the concrete instance
1903 tree because of additional information available there. For
1904 example, an anonymous variable might have been created and
1905 described in the abstract instance tree, but because of
1906 the actual parameters for a particular inlined expansion,
1907 it could be described as a constant value without the need
1908 for that separate debugging information entry.
1911 \item A concrete instance tree may contain entries which do
1912 not correspond to entries in the abstract instance tree
1913 to describe new entities that are specific to a particular
1914 inlined expansion. In that case, they will not have associated
1915 entries in the abstract instance tree,
1920 \addtoindexx{abstract origin attribute}
1921 \DWATabstractorigin{} attributes, and must contain all their
1922 own attributes directly. This allows an abstract instance tree
1923 to omit debugging information entries for anonymous entities
1924 that are unlikely to be needed in most inlined expansions. In
1925 any expansion which deviates from that expectation, the
1926 entries can be described in its concrete inlined instance tree.
1930 \subsubsection{Out-of-Line Instances of Inlined Subroutines}
1931 \label{chap:outoflineinstancesofinlinedsubroutines}
1932 Under some conditions, compilers may need to generate concrete
1933 executable instances of inlined subroutines other than at
1934 points where those subroutines are actually called. Such
1935 concrete instances of inlined subroutines are referred to as
1936 \doublequote{concrete out\dash of\dash line instances.}
1938 \textit{In \addtoindex{C++}, for example,
1939 taking the address of a function declared
1940 to be inline can necessitate the generation of a concrete
1941 out\dash of\dash line instance of the given function.}
1943 The DWARF representation of a concrete out-of-line instance
1944 of an inlined subroutine is essentially the same as for a
1945 concrete inlined instance of that subroutine (as described in
1946 the preceding section). The representation of such a concrete
1947 % It is critical that the hypertarget and livelink be
1948 % separated to avoid problems with latex.
1950 \addtoindexx{abstract origin attribute}
1952 \hypertarget{chap:DWATabstractoriginoutoflineinstance}{}
1954 \DWATabstractoriginDEFN{}
1955 attributes in exactly the same way as they are used for
1956 a concrete inlined instance (that is, as references to
1957 corresponding entries within the associated abstract instance
1960 The differences between the DWARF representation of a
1961 concrete out\dash of\dash line instance of a given subroutine and the
1962 representation of a concrete inlined instance of that same
1963 subroutine are as follows:
1964 \begin{enumerate}[1. ]
1965 \item The root entry for a concrete out\dash of\dash line instance
1966 of a given inlined subroutine has the same tag as does its
1967 associated (abstract) inlined subroutine entry (that is, tag
1968 \DWTAGsubprogram{} rather than \DWTAGinlinedsubroutine).
1970 \item The root entry for a concrete out\dash of\dash line instance tree
1971 is normally owned by the same parent entry that also owns
1972 the root entry of the associated abstract instance. However,
1973 it is not required that the abstract and out\dash of\dash line instance
1974 trees be owned by the same parent entry.
1978 \subsubsection{Nested Inlined Subroutines}
1979 \label{nestedinlinedsubroutines}
1980 Some languages and compilers may permit the logical nesting of
1981 a subroutine within another subroutine, and may permit either
1982 the outer or the nested subroutine, or both, to be inlined.
1984 For a non-inlined subroutine nested within an inlined
1985 subroutine, the nested subroutine is described normally in
1986 both the abstract and concrete inlined instance trees for
1987 the outer subroutine. All rules pertaining to the abstract
1988 and concrete instance trees for the outer subroutine apply
1989 also to the abstract and concrete instance entries for the
1993 For an inlined subroutine nested within another inlined
1994 subroutine, the following rules apply to their abstract and
1995 \addtoindexx{abstract instance!nested}
1996 \addtoindexx{concrete instance!nested}
1997 concrete instance trees:
1999 \begin{enumerate}[1. ]
2000 \item The abstract instance tree for the nested subroutine is
2001 described within the abstract instance tree for the outer
2002 subroutine according to the rules in
2003 Section \refersec{chap:abstractinstances}, and
2004 without regard to the fact that it is within an outer abstract
2007 \item Any abstract instance tree for a nested subroutine is
2008 always omitted within the concrete instance tree for an
2011 \item A concrete instance tree for a nested subroutine is
2012 always omitted within the abstract instance tree for an
2015 \item The concrete instance tree for any inlined or
2016 \addtoindexx{out-of-line instance}
2018 \addtoindexx{out-of-line instance|see{\textit{also} concrete out-of-line instance}}
2019 expansion of the nested subroutine is described within a
2020 concrete instance tree for the outer subroutine according
2022 Sections \refersec{chap:concreteinstances} or
2023 \referfol{chap:outoflineinstancesofinlinedsubroutines}
2025 and without regard to the fact that it is within an outer
2026 concrete instance tree.
2029 \textit{See Appendix \refersec{app:inliningexamples}
2030 for discussion and examples.}
2032 \subsection{Trampolines}
2033 \label{chap:trampolines}
2035 \textit{A trampoline is a compiler\dash generated subroutine that serves
2036 as\hypertarget{chap:DWATtrampolinetargetsubroutine}{}
2037 an intermediary in making a call to another subroutine. It may
2038 adjust parameters and/or the result (if any) as appropriate
2039 to the combined calling and called execution contexts.}
2041 A trampoline is represented by a debugging information entry
2042 \addtoindexx{trampoline (subprogram) entry}
2043 with the tag \DWTAGsubprogram{} or \DWTAGinlinedsubroutine{}
2045 \addtoindexx{trampoline attribute}
2046 a \DWATtrampolineDEFN{} attribute.
2048 attribute indicates the target subroutine of the trampoline,
2049 that is, the subroutine to which the trampoline passes
2050 control. (A trampoline entry may but need not also have a
2051 \DWATartificial{} attribute.)
2054 The value of the trampoline attribute may be represented
2055 using any of the following forms:
2058 \item If the value is of class \CLASSreference{}, then the value
2059 specifies the debugging information entry of the target
2062 \item If the value is of class \CLASSaddress{}, then the value is
2063 the relocated address of the target subprogram.
2066 \item If the value is of class \CLASSstring{}, then the value is the
2067 (possibly mangled) \addtoindexx{mangled names}
2068 name of the target subprogram.
2070 \item If the value is of class \CLASSflag, then the value true
2071 indicates that the containing subroutine is a trampoline but
2072 that the target subroutine is not known.
2076 The target subprogram may itself be a trampoline. (A sequence
2077 of trampolines necessarily ends with a non-trampoline
2080 \textit{In \addtoindex{C++}, trampolines may be used to implement
2081 derived virtual member functions; such trampolines typically
2083 \texttt{this} parameter\index{this parameter@\texttt{this} parameter}
2084 in the course of passing control.
2085 Other languages and environments may use trampolines in a manner
2086 sometimes known as transfer functions or transfer vectors.}
2088 \textit{Trampolines may sometimes pass control to the target
2089 subprogram using a branch or jump instruction instead of a
2090 call instruction, thereby leaving no trace of their existence
2091 in the subsequent execution context. }
2093 \textit{This attribute helps make it feasible for a debugger to arrange
2094 that stepping into a trampoline or setting a breakpoint in
2095 a trampoline will result in stepping into or setting the
2096 breakpoint in the target subroutine instead. This helps to
2097 hide the compiler generated subprogram from the user. }
2099 \section{Call Site Entries and Parameters}
2100 \label{chap:callsiteentriesandparameters}
2102 A call site entry describes a call from one subprogram to another in the
2103 source program. It provides information about the actual parameters of
2104 the call so that they may be more easily accessed by a debugger. When
2105 used together with call frame information
2106 (see Section \refersec{chap:callframeinformation}),
2107 call site entries can be useful for computing the value of an actual parameter
2108 passed by a caller, even when the location description for the callee's
2109 corresponding formal parameter does not provide a current location for
2110 the formal parameter.}
2112 \textit{The DWARF expression for computing the value of an actual parameter at
2113 a call site may refer to registers or memory locations. The expression
2114 assumes these contain the values they would have at the point where the
2115 call is executed. After the called subprogram has been entered, these
2116 registers and memory locations might have been modified. In order to
2117 recover the values that existed at the point of the call (to allow
2118 evaluation of the DWARF expression for the actual parameter), a debugger
2119 may virtually unwind the subprogram activation
2120 (see Section \refersec{chap:callframeinformation}). Any
2121 register or memory location that cannot be recovered is referred to as
2122 "clobbered by the call."}
2124 A source call can be compiled into different types of machine code:
2127 A \textit{normal call} uses a call-like instruction which transfers
2128 control to the start of some subprogram and preserves the call site
2129 location for use by the callee.
2132 A \textit{tail call} uses a jump-like instruction which
2133 transfers control to the start of some subprogram, but
2134 there is no call site location address to preserve
2135 (and thus none is available using the
2136 virtual unwind information).
2139 A \textit{tail recursion call} is a call
2140 to the current subroutine which is compiled as a jump
2141 to the current subroutine.
2145 An \textit{inline (or inlined) call} is a call to an inlined subprogram,
2146 where at least one instruction has the location of the inlined subprogram
2147 or any of its blocks or inlined subprograms.
2151 There are also different types of \doublequote{optimized out} calls:
2154 An \textit{optimized out (normal) call} is a call that is in unreachable code that
2155 has not been emitted (such as, for example, the call to \texttt{foo} in
2156 \texttt{if (0) foo();}).
2158 An \textit{optimized out inline call}
2159 is a call to an inlined subprogram which either did not expand to any instructions
2160 or only parts of instructions belong to it and for debug information purposes those
2161 instructions are given a location in the caller.
2164 \DWTAGcallsite{} entries describe normal and tail calls but not tail recursion calls,
2165 while \DWTAGinlinedsubroutine{} entries describe inlined calls
2166 (see Section \refersec{chap:inlinedsubroutines}).
2167 Call site entries cannot describe tail recursion or optimized out calls.
2169 \subsection{Call Site Entries}
2170 \label{chap:callsiteentries}
2171 A call site is represented by a debugging information entry with the tag
2172 \DWTAGcallsiteTARG{}\addtoindexx{call site entry}.
2173 The entry for a call site is owned by the innermost
2174 debugging information entry representing the scope within which the
2175 call is present in the source program.
2178 \textit{A scope entry (for example, a lexical block) that would not
2179 otherwise be present in the debugging information of a subroutine
2180 need not be introduced solely to represent the immediately containing scope
2183 The call site entry may have a
2184 \DWATcallreturnpcDEFN{}\addtoindexx{call site return pc attribute}
2185 \livetargi{chap:DWATcallreturnpcofcallsite}{attribute}{call return pc attribute}
2186 which is the return address after the call.
2187 The value of this attribute corresponds to the return address
2188 computed by call frame information in the called subprogram
2189 (see Section \refersec{datarep:callframeinformation}).
2191 \textit{On many architectures the return address is the
2192 address immediately following the call instruction, but
2193 on architectures with delay slots it might
2194 be an address after the delay slot of the call.}
2196 The call site entry may have a
2197 \DWATcallpcDEFN{}\addtoindexx{call pc attribute}
2198 \livetargi{chap:DWATcallpcofcallsite}{attribute}{call pc attribute}
2199 which is the address of the
2200 call-like instruction for a normal call or the jump-like
2201 instruction for a tail call.
2203 If the call site entry corresponds to a tail call, it has the
2204 \DWATcalltailcallDEFN{}\addtoindexx{call tail call attribute}
2205 \livetargi{chap:DWATcalltailcallofcallsite}{attribute}{call tail call attribute},
2206 which is a \CLASSflag.
2208 The call site entry may have a
2209 \DWATcalloriginDEFN{}\addtoindexx{call origin attribute}
2210 \livetargi{chap:DWATcalloriginofcallsite}{attribute}{call origin attribute}
2211 which is a \CLASSreference. For direct calls or jumps where the called
2212 subprogram is known it is a reference to the called subprogram's debugging
2213 information entry. For indirect calls it may be a reference to a
2214 \DWTAGvariable{}, \DWTAGformalparameter{} or \DWTAGmember{} entry representing
2215 the subroutine pointer that is called.
2218 The call site may have a
2219 \DWATcalltargetDEFN{}\addtoindexx{call target attribute}
2220 \livetargi{chap:DWATcalltargetofcallsite}{attribute}{call target attribute} which is
2221 a DWARF expression. For indirect calls or jumps where it is unknown at
2222 compile time which subprogram will be called the expression computes the
2223 address of the subprogram that will be called.
2226 \textit{The DWARF expression should
2227 not use register or memory locations that might be clobbered by the call.}
2231 The call site entry may have a
2232 \DWATcalltargetclobberedDEFN{}\addtoindexx{call target clobbered attribute}
2233 \livetargi{chap:DWATcalltargetclobberedofcallsite}{attribute}{call target clobbered attribute}
2234 which is a DWARF expression. For indirect calls or jumps where the
2235 address is not computable without use of registers or memory locations that
2236 might be clobbered by the call the \DWATcalltargetclobberedNAME{}
2237 attribute is used instead of the \DWATcalltarget{} attribute.
2239 \textit{The expression of a call target clobbered attribute may only be
2240 valid at the time the call or call-like transfer of control is executed.}
2242 The call site entry may have a \DWATtypeDEFN{}\addtoindexx{call type attribute}
2243 \livetargi{chap:DWATtypeofcallsite}{attribute}{type attribute!of call site entry}
2244 referencing a debugging information entry for the type of the called function.
2246 \textit{When \DWATcallorigin{} is present, \DWATtypeNAME{} is usually omitted.}
2248 The call site entry may have
2249 \DWATcallfileDEFN{}\addtoindexx{call file attribute},
2250 \DWATcalllineDEFN{}\addtoindexx{call line attribute} and
2251 \DWATcallcolumnDEFN{}\addtoindexx{call column attribute}
2252 \livetargi{chap:DWATcallfileofcallsite}{attributes,}{call file attribute!of call site entry}
2253 \livetargi{chap:DWATcalllineofcallsite}{}{call line attribute!of call site entry}
2254 \livetargi{chap:DWATcallcolumnofcallsite}{}{call column attribute!of call site entry}
2255 each of whose value is an integer constant.
2256 These attributes represent the source file, source line number, and source
2257 column number, respectively, of the first character of the call statement or
2258 expression. The call file, call line, and call column attributes are
2259 interpreted in the same way as the declaration file, declaration
2260 line, and declaration column attributes, respectively
2261 (see Section \refersec{chap:declarationcoordinates}).
2263 \textit{The call file, call line and call column coordinates do
2264 not describe the coordinates of the subroutine declaration that
2265 was called, rather they describe the coordinates of the call.}
2268 \subsection{Call Site Parameters}
2269 \label{chap:callsiteparameters}
2270 The call site entry may own
2271 \DWTAGcallsiteparameterTARG{}\index{call site parameter entry}
2272 debugging information entries representing the parameters passed
2274 Call site parameter entries occur in the same order as the
2275 corresponding parameters in the source.
2276 Each such entry has a \DWATlocation{} attribute which is a location
2277 description. This location description
2278 describes where the parameter is passed
2279 (usually either some register, or a memory location expressible as
2280 the contents of the stack register plus some offset).
2283 Each \DWTAGcallsiteparameter{} entry may have a
2284 \DWATcallvalueDEFN{}\addtoindexx{call value attribute}
2285 \livetargi{chap:DWATcallvalueofcallparameter}{attribute}{call value attribute}
2286 which is a DWARF expression
2287 which when evaluated yields the value of the parameter at the time of the call.
2289 \textit{\bbeb If it is not
2290 possible to avoid registers or memory locations that might be clobbered by
2291 the call in the expression, then the \DWATcallvalueNAME{} attribute should
2292 not be provided. The reason for the restriction is that the value of the parameter may be
2293 needed in the midst of the callee, where the call clobbered registers or
2294 memory might be already clobbered, and if the consumer is not assured by
2295 the producer it can safely use those values, the consumer can not safely
2296 use the values at all.}
2298 For parameters passed by reference, where the code passes a pointer to
2299 a location which contains the parameter, or for reference type parameters,
2300 the \DWTAGcallsiteparameter{} entry may also have a
2301 \DWATcalldatalocationDEFN{}\addtoindexx{call data location attribute}
2302 \livetargi{chap:DWATcalldatalocationofcallparameter}{attribute}{call data location attribute}
2303 whose value is a location description and a
2304 \DWATcalldatavalueDEFN{}\addtoindexx{call data value attribute}
2305 \livetargi{chap:DWATcalldatavalueofcallparameter}{attribute}{call data value attribute}
2306 whose value is a DWARF expression. The \DWATcalldatalocationNAME{} attribute
2307 \addtoindexx{call data location attribute}
2308 describes where the referenced value lives during the call. If it is just
2309 \DWOPpushobjectaddress{}, it may be left out. The
2310 \DWATcalldatavalueNAME{} attribute describes the value in that location.
2311 The expression should not use registers or memory
2312 locations that might be clobbered by the call, as it might be evaluated after
2313 virtually unwinding from the called function back to the caller.
2316 Each call site parameter entry may also have a
2317 \DWATcallparameterDEFN{}\addtoindexx{call parameter attribute}
2318 \livetargi{chap:DWATcallparameterofcallparameter}{attribute}{call parameter attribute}
2319 which contains a reference to a \DWTAGformalparameter{} entry,
2320 \DWATtype{} attribute referencing the type of the parameter or
2321 \DWATname{} attribute describing the parameter's name.
2323 \textit{Examples using call site entries and related attributes are
2324 found in Appendix \refersec{app:callsiteexamples}.}
2327 \section{Lexical Block Entries}
2328 \label{chap:lexicalblockentries}
2331 lexical \livetargi{chap:lexicalblock}{block}{lexical block}
2333 \addtoindexx{lexical block}
2334 a bracketed sequence of source statements
2335 that may contain any number of declarations. In some languages
2336 (including \addtoindex{C} and \addtoindex{C++}),
2337 \nolink{blocks} can be nested within other
2338 \nolink{blocks} to any depth.}
2340 % We do not need to link to the preceding paragraph.
2341 A lexical \nolink{block} is represented by a debugging information
2343 tag \DWTAGlexicalblockTARG.
2345 The lexical \livetargi{chap:lexicalblockentry}{block}{lexical block entry}
2347 either a \DWATlowpc{} and
2348 \DWAThighpc{} pair of
2350 \addtoindexx{high PC attribute}
2352 \addtoindexx{low PC attribute}
2354 \DWATranges{} attribute
2355 \addtoindexx{ranges attribute}
2356 whose values encode the contiguous or non-contiguous address
2357 ranges, respectively, of the machine instructions generated
2358 for the lexical \nolink{block}
2359 (see Section \refersec{chap:codeaddressesandranges}).
2361 A\hypertarget{chap:DWATentrypcoflexicalblock}{}
2362 lexical block entry may also have a
2363 \addtoindexx{entry PC attribute!for lexical block}
2364 \DWATentrypc{} attribute
2365 whose value is the address of the first executable instruction
2366 of the lexical block (see
2367 Section \refersec{chap:entryaddress}).
2369 If a name has been given to the lexical \nolink{block}
2370 in the source program, then the corresponding
2371 lexical \nolink{block} entry has a
2372 \DWATname{} attribute whose
2373 \addtoindexx{name attribute}
2374 value is a null-terminated string
2375 containing the name of the lexical \nolink{block}.
2377 \textit{This is not the same as a \addtoindex{C} or
2378 \addtoindex{C++} label (see Section \refersec{chap:labelentries}).}
2380 The lexical \nolink{block} entry owns debugging
2381 information entries that describe the declarations
2382 within that lexical \nolink{block}. There is
2383 one such debugging information entry for each local declaration
2384 of an identifier or inner lexical \nolink{block}.
2387 \section{Label Entries}
2388 \label{chap:labelentries}
2389 \textit{A label is a way of identifying a source location.
2390 A labeled statement is usually the target of one or more
2391 \doublequote{go to} statements.}
2394 A label is represented by a debugging information entry with
2395 \addtoindexx{label entry} the tag \DWTAGlabelTARG.
2396 The entry for a label
2401 the debugging information entry representing the scope within
2402 which the name of the label could be legally referenced within
2405 The label entry has a \DWATlowpc{} attribute whose value
2406 is the address of the first executable instruction for the
2407 location identified by the label in
2408 the source program. The label entry also has a
2409 \DWATname{} attribute
2410 \addtoindexx{name attribute}
2411 whose value is a null-terminated string containing
2412 the name of the label.
2415 \section{With Statement Entries}
2416 \label{chap:withstatemententries}
2418 \textit{Both \addtoindex{Pascal} and
2419 \addtoindexx{Modula-2}
2420 Modula-2 support the concept of a \doublequote{with}
2421 statement. The with statement specifies a sequence of
2422 executable statements within which the fields of a record
2423 variable may be referenced, unqualified by the name of the
2426 A with statement is represented by a
2427 \addtoindexi{debugging information entry}{with statement entry}
2428 with the tag \DWTAGwithstmtTARG.
2430 A with statement entry may have either a
2432 \DWAThighpc{} pair of attributes
2433 \addtoindexx{low PC attribute}
2434 \addtoindexx{high PC attribute}
2436 \DWATranges{} attribute
2437 \addtoindexx{ranges attribute}
2438 whose values encode the contiguous or non-contiguous address
2439 ranges, respectively, of the machine instructions generated
2440 for the with statement
2441 (see Section \refersec{chap:codeaddressesandranges}).
2443 A\hypertarget{chap:DWATentrypcofwithstmt}{}
2444 with statement entry may also have a
2445 \addtoindexx{entry PC attribute!for with statement}
2446 \DWATentrypc{} attribute
2447 whose value is the address of the first executable instruction
2448 of the with statement (see
2449 Section \refersec{chap:entryaddress}).
2452 The with statement entry has a
2453 \addtoindexx{type attribute}
2454 \DWATtype{} attribute, denoting
2455 the type of record whose fields may be referenced without full
2456 qualification within the body of the statement. It also has
2457 \addtoindexx{location attribute}
2458 a \DWATlocation{} attribute, describing how to find the base
2459 address of the record object referenced within the body of
2463 \section{Try and Catch Block Entries}
2464 \label{chap:tryandcatchblockentries}
2465 \livetarg{chap:tryandcatchblockentries}{}
2466 \textit{In \addtoindex{C++}, a \livelink{chap:lexicalblock}{lexical block} may be
2467 designated as a \doublequote{catch \nolink{block}.}
2468 A catch \nolink{block} is an exception handler that
2469 handles exceptions thrown by an immediately preceding
2470 \doublequote{try \nolink{block}.}
2471 A catch \nolink{block}
2472 designates the type of the exception that it can handle.}
2474 A \livetarg{chap:tryblock}{try block} is represented
2475 by a debugging information entry
2476 \addtoindexx{try block entry}
2477 with the tag \DWTAGtryblockTARG.
2478 A \livetarg{chap:catchblock}{catch block} is represented by
2479 a debugging information entry
2480 \addtoindexx{catch block entry}
2481 with the tag \DWTAGcatchblockTARG.
2483 Both try and catch \nolink{block} entries may have either a
2485 \DWAThighpc{} pair of attributes
2486 \addtoindexx{low PC attribute}
2487 \addtoindexx{high PC attribute}
2489 \DWATranges{} attribute
2490 \addtoindexx{ranges attribute}
2491 whose values encode the contiguous
2492 or non-contiguous address ranges, respectively, of the
2493 machine instructions generated for the \nolink{block}
2494 (see Section \refersec{chap:codeaddressesandranges}).
2496 A\hypertarget{chap:DWATentrypcoftryblock}{}
2497 try or catch\hypertarget{chap:DWATentrypcofcatchblock}{}
2498 block entry may also have a
2499 \addtoindexx{entry PC attribute!for try block}
2500 \addtoindexx{entry PC attribute!for catch block}
2501 \DWATentrypc{} attribute
2502 whose value is the address of the first executable instruction
2503 of the try or catch block
2504 (see Section \refersec{chap:entryaddress}).
2507 Catch \nolink{block} entries have at least one child entry,
2508 an entry representing the type of exception accepted by
2509 that catch \nolink{block}.
2510 This child entry has one of the tags
2511 \DWTAGformalparameter{}\addtoindexx{formal parameter entry!in catch block}
2513 \DWTAGunspecifiedparameters{},
2514 \addtoindexx{unspecified parameters entry!in catch block}
2515 and will have the same form as other parameter entries.
2517 The siblings immediately following a try \nolink{block}
2518 entry are its corresponding catch \nolink{block} entries.
2521 \section{Declarations with Reduced Scope}
2522 \label{declarationswithreducedscope}
2523 \hypertarget{chap:DWATstartscopeofdeclaration}{}
2524 Any debugging information entry for a declaration
2525 (including objects, subprograms, types and modules) whose scope
2526 has an address range that is a subset of the address range for
2527 the lexical scope most closely enclosing the declared entity
2529 \DWATstartscopeDEFN{}\addtoindexx{start scope attribute}
2530 attribute to specify that reduced range of addresses.
2532 There are two cases:
2533 \begin{enumerate}[1. ]
2534 \item If the address range for the scope of the entry
2535 includes all of addresses for the containing scope except
2536 for a contiguous sequence of bytes at the beginning of the
2537 address range for the containing scope, then the address is
2538 specified using a value of class \CLASSconstant.
2540 \begin{enumerate}[a) ]
2541 \item If the address
2542 range of the containing scope is contiguous, the value of
2543 this attribute is the offset in bytes of the beginning of
2544 the address range for the scope of the object from the low
2545 PC value of the debugging information entry that defines
2546 that containing scope.
2547 \item If the address range of the containing
2548 scope is non-contiguous
2549 (see \refersec{chap:noncontiguousaddressranges})
2550 the value of this attribute is the offset in bytes of the
2551 beginning of the address range for the scope of the entity
2552 from the beginning of the first \addtoindex{range list} entry
2553 for the containing scope that is not a base
2555 address entry, a default location
2557 entry or an end-of-list entry.
2561 \item Otherwise, the set of addresses for the scope of the
2562 entity is specified using a value of class \CLASSrnglistsptr{}.
2563 This value indicates the beginning of a \addtoindex{range list}
2564 (see Section \refersec{chap:noncontiguousaddressranges}).
2567 \textit{For example, the scope of a variable may begin somewhere
2568 in the midst of a lexical \livelink{chap:lexicalblock}{block} in a
2569 language that allows executable code in a
2570 \nolink{block} before a variable declaration, or where one declaration
2571 containing initialization code may change the scope of a
2572 subsequent declaration.}
2575 \textit{Consider the following example \addtoindex{C} code:}
2587 \textit{\addtoindex{C} scoping rules require that the value of the
2588 variable \texttt{x} assigned to the variable \texttt{f} in the
2589 initialization sequence is the value of the global variable \texttt{x},
2590 rather than the local \texttt{x}, because the scope of the local variable
2591 \texttt{x} only starts after the full declarator for the local \texttt{x}.}
2593 \textit{Due to optimization, the scope of an object may be
2594 non-contiguous and require use of a \addtoindex{range list} even when
2595 the containing scope is contiguous. Conversely, the scope of
2596 an object may not require its own \addtoindex{range list} even when the
2597 containing scope is non-contiguous.}