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.
300 \textit{The actual contents of
301 the string will be specific to each producer, but should
302 begin with the name of the compiler vendor or some other
303 identifying character sequence that will avoid confusion
304 with other producer values.}
307 \item \hypertarget{chap:DWATidentifiercaseidentifiercaserule}{}
308 A \DWATidentifiercaseDEFN{} attribute
309 \addtoindexx{identifier case attribute} whose integer
310 constant value is a code describing the treatment
311 of identifiers within this compilation unit. The
312 set of identifier case codes is given in
313 Table \refersec{tab:identifiercasecodes}.
315 \begin{simplenametable}{Identifier case codes}{tab:identifiercasecodes}
316 \DWIDcasesensitive{} \\
319 \DWIDcaseinsensitive{} \\
320 \end{simplenametable}
322 \DWIDcasesensitiveTARG{} is the default for all compilation units
323 that do not have this attribute. It indicates that names given
324 as the values of \DWATname{} attributes
325 \addtoindexx{name attribute}
326 in debugging information
327 entries for the compilation unit reflect the names as they
328 appear in the source program.
330 \textit{A debugger should be sensitive
331 to the case of \addtoindex{identifier names} when doing identifier
335 \DWIDupcaseTARG{} means that the
336 producer of the debugging
337 information for this compilation unit converted all source
338 names to upper case. The values of the name attributes may not
339 reflect the names as they appear in the source program.
341 \textit{A debugger should convert all names to upper case
344 \DWIDdowncaseTARG{} means that the producer of the debugging
345 information for this compilation unit converted all source
346 names to lower case. The values of the name attributes may not
347 reflect the names as they appear in the source program.
349 \textit{A debugger should convert all names to lower case
353 \DWIDcaseinsensitiveTARG{} means that the values of the name
354 attributes reflect the names as they appear in the source
355 program but that case is not significant.
357 \textit{A debugger should ignore case when doing lookups.}
360 \item \hypertarget{chap:DWATbasetypesprimitivedatatypesofcompilationunit}{}
361 A \DWATbasetypesDEFN{} attribute\addtoindexx{base types attribute}
362 whose value is a \livelink{chap:classreference}{reference}.
363 This attribute points to a debugging information entry
364 representing another compilation unit. It may be used
365 to specify the compilation unit containing the base type
366 entries used by entries in the current compilation unit
367 (see Section \refersec{chap:basetypeentries}).
370 \textit{This attribute provides a consumer a way to find the definition
371 of base types for a compilation unit that does not itself
372 contain such definitions. This allows a consumer, for example,
373 to interpret a type conversion to a base type correctly.}
375 \item \hypertarget{chap:DWATuseUTF8compilationunitusesutf8strings}{}
376 A \DWATuseUTFeightDEFN{} attribute,
377 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
378 which is a \livelink{chap:classflag}{flag} whose
379 presence indicates that all strings (such as the names of
380 declared entities in the source program, or filenames in the line number table)
381 are represented using the UTF-8 representation.
385 \hypertarget{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}{}
386 A \DWATmainsubprogramDEFN{} attribute,\addtoindexx{main subprogram attribute}
387 which is a \livelink{chap:classflag}{flag},
388 whose presence indicates that the compilation unit contains a
389 subprogram that has been identified as the starting
390 subprogram of the program. If more than one compilation unit contains
391 this \nolink{flag}, any one of them may contain the starting
394 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
396 to specify and provide a user-specified name for the main
397 subroutine of a program.
398 \addtoindex{C} uses the name \doublequote{main} to identify
399 the main subprogram of a program. Some other languages provide
400 similar or other means to identify the main subprogram of
401 a program. The \DWATmainsubprogram{} attribute may also be used to
402 identify such subprograms (see
403 Section \refersec{chap:generalsubroutineandentrypointinformation}).}
406 \hypertarget{chap:DWATentrypcofcompileunit}{}
407 \hypertarget{chap:DWATentrypcofpartialunit}{}
408 A \DWATentrypc{} attribute whose value is the address of the first
409 \addtoindexx{entry pc attribute}
410 executable instruction of the unit (see
411 Section \refersec{chap:entryaddress}).
414 \item \hypertarget{chap:DWATstroffsetbaseforindirectstringtable}{}
415 A \DWATstroffsetsbaseDEFN\addtoindexx{string offset base attribute}
416 attribute, whose value is of class \CLASSstroffsetsptr.
417 This attribute points to the first string
418 offset of the compilation unit's contribution to the
419 \dotdebugstroffsets{} (or \dotdebugstroffsetsdwo{}) section.
420 Indirect string references
421 (using \DWFORMstrx) within the compilation unit are
422 interpreted as indices relative to this base.
425 \item \hypertarget{chap:DWATaddrbaseforaddresstable}{}
426 A \DWATaddrbaseDEFN\addtoindexx{address table base attribute}
427 attribute, whose value is of class \CLASSaddrptr.
428 This attribute points to the beginning of the compilation
429 unit's contribution to the \dotdebugaddr{} section.
430 Indirect references (using \DWFORMaddrx, \DWOPaddrx,
433 \DWLLEbaseaddressx{}, \DWLLEstartxendx{}, \DWLLEstartxlength{},
434 \DWRLEbaseaddressx{}, \DWRLEstartxendx{} or \DWRLEstartxlength)
436 within the compilation unit are interpreted as indices
437 relative to this base.
440 \item \hypertarget{chap:DWATrnglistsbaseforrnglists}{}
441 A \DWATrnglistsbaseDEFN\addtoindexx{ranges table base attribute}
442 attribute, whose value is of class \CLASSrnglistsptr.
443 This attribute points to the
445 beginning of the offsets table (immediately following the header)
448 unit's contribution to the \dotdebugrnglists{} section.
449 References to range lists (using \DWFORMrnglistx)
450 within the compilation unit are
451 interpreted relative to this base.
453 \item \hypertarget{chap:DWATloclistsbaseinlocationlist}{}
454 A \DWATloclistsbaseDEFN{}\addtoindexx{location table base attribute}
455 attribute, whose value is of class \CLASSloclistsptr.
456 This attribute points to the
458 beginning of the offsets table (immediately following the header)
461 unit's contribution to the \dotdebugloclists{} section. References
462 to location lists (using \DWFORMloclistx) within the compilation
463 unit are interpreted relative to this base.
466 The base address of a compilation unit is defined as the
467 value of the \DWATlowpc{} attribute, if present; otherwise,
468 it is undefined. If the base address is undefined, then any
469 DWARF entry or structure defined in terms of the base address
470 of that compilation unit is not valid.
473 \subsection{Skeleton Compilation Unit Entries}
474 \label{chap:skeletoncompilationunitentries}
475 \addtoindexx{compilation unit!skeleton}
476 \addtoindexx{skeleton compilation unit}
477 When generating a \splitDWARFobjectfile{} (see
478 Section \refersec{datarep:splitdwarfobjectfiles}), the
479 compilation unit in the \dotdebuginfo{} section is a "skeleton"
480 compilation unit with the tag
481 \DWTAGskeletonunitTARG, which contains a
482 \DWATdwoname{} attribute as well as a subset of the
483 attributes of a full or partial compilation unit. In general,
484 it contains those attributes that are necessary for the consumer
485 to locate the object file where the split full compilation unit
486 can be found, and for the consumer to interpret references to
487 addresses in the program.
490 A skeleton compilation unit has no children.
492 A skeleton compilation unit has a \DWATdwoname{} attribute:
494 \begin{enumerate}[1. ]
496 \item \livetarg{chap:DWATdwonameforunit}{}
497 A \DWATdwonameDEFN{} attribute
498 \addtoindexx{split DWARF object file name attribute}
500 null-terminated string containing the full or relative
501 path name (relative to the value of the \DWATcompdir{} attribute,
502 see below) of the object file that contains the full
505 The value in the \HFNdwoid{} field of the unit header for
506 this unit is the same as the value in the \HFNdwoid{} field
507 of the unit header of the corresponding full compilation
508 unit (see Section \refersec{datarep:unitheaders}).
510 \textit{The means of determining a compilation unit ID does
511 not need to be similar or related to the means of
512 determining a \TUsignature. However, it should
513 be suitable for detecting file version skew or other
514 kinds of mismatched files and for looking up a full
515 split unit in a DWARF package file
516 (see Section \refersec{datarep:dwarfpackagefiles}).}
520 A skeleton compilation unit may have additional attributes,
521 which are the same as for conventional compilation unit entries
522 except as noted, from among the following:
523 \begin{enumerate}[1. ]
524 \addtocounter{enumi}{1}
525 \item Either a \DWATlowpc{} and \DWAThighpc{} pair of attributes
526 or a \DWATranges{} attribute.
527 \item A \DWATstmtlist{} attribute.
528 \item A \DWATcompdir{} attribute.
531 \item A \DWATuseUTFeight{} attribute.
533 \textit{This attribute applies to strings referred to by the skeleton
534 compilation unit entry itself, and strings in the associated line
536 The representation for strings in the object file referenced
537 by the \DWATdwoname{} attribute is determined by the presence
538 of a \DWATuseUTFeight{} attribute in the full compilation unit
539 (see Section \refersec{chap:splitfullcompilationunitentries}).}
541 \item A \DWATstroffsetsbase{} attribute, for indirect strings references
542 from the skeleton compilation unit.
543 \item A \DWATaddrbase{} attribute.
547 All other attributes of a compilation unit entry (described
548 in Section \refersec{chap:fullandpartialcompilationunitentries})
549 are placed in the split full compilation unit
550 (see \refersec{chap:splitfullcompilationunitentries}).
551 The attributes provided by the skeleton compilation
552 unit entry do not need to be repeated in the full compilation
555 \textit{The \DWATaddrbase{}
556 and \DWATstroffsetsbase{} attributes provide context that may be
557 necessary to interpret the contents
558 of the corresponding \splitDWARFobjectfile.}
560 \textit{The \DWATbasetypes{} attribute is not defined for a
561 skeleton compilation unit.}
564 \subsection{Split Full Compilation Unit Entries}
565 \label{chap:splitfullcompilationunitentries}
566 A \definition{split full compilation unit} is represented by a
567 debugging information entry with tag \DWTAGcompileunit.
568 It is very similar to a conventional full compilation unit but
569 is logically paired with a specific skeleton compilation unit while
570 being physically separate.
572 A split full compilation unit
573 may have the following attributes,
574 which are the same as for conventional compilation unit entries
576 \begin{enumerate}[1. ]
577 \item A \DWATname{} attribute.
578 \item A \DWATlanguage{} attribute.
579 \item A \DWATmacros{} attribute.
580 The value of this attribute is of class \CLASSmacptr{}, which is
581 an offset relative to the \dotdebugmacrodwo{} section.
583 \item A \DWATproducer{} attribute.
584 \item A \DWATidentifiercase{} attribute.
585 \item A \DWATmainsubprogram{} attribute.
586 \item A \DWATentrypc{} attribute.
587 \item A \DWATuseUTFeight{} attribute.
591 \textit{The following attributes are not part of a
592 split full compilation unit entry but instead are inherited
593 (if present) from the corresponding skeleton compilation unit:
594 \DWATlowpc, \DWAThighpc, \DWATranges, \DWATstmtlist, \DWATcompdir,
595 \DWATstroffsetsbase, \DWATaddrbase{} and
598 \textit{The \DWATbasetypes{} attribute is not defined for a
599 split full compilation unit.}
603 \subsection{Type Unit Entries}
604 \label{chap:typeunitentries}
605 \addtoindexx{type unit}
606 \addtoindexx{type unit|see{\textit{also} compilation unit}}
607 \addtoindexx{compilation unit!\textit{see also} type unit}
608 An object file may contain any number of separate type
609 unit entries, each representing a single complete type
611 Each \addtoindex{type unit} must be uniquely identified by
612 an 8-byte signature, stored as part of the type unit, which
613 can be used to reference the type definition from debugging
614 information entries in other compilation units and type units.
616 Conventional and split type units are identical except for
617 the sections in which they are represented
618 (see \refersec{datarep:splitdwarfobjectfiles} for details).
619 \addtoindexx{conventional type unit}
620 \addtoindexx{split type unit}
621 Moreover, the \DWATstroffsetsbase{} attribute (see below) is not
622 used in a split type unit.
624 A type unit is represented by a debugging information entry
625 with the tag \DWTAGtypeunitTARG.
626 A \addtoindex{type unit entry} owns debugging
627 information entries that represent the definition of a single
628 type, plus additional debugging information entries that may
629 be necessary to include as part of the definition of the type.
632 A type unit entry may have the following attributes:
633 \begin{enumerate}[1. ]
636 \DWATlanguage{} attribute,
638 \addtoindexx{language attribute}
639 constant value is an integer code indicating the source
640 language used to define the type. The set of language names
641 and their meanings are given in Table \refersec{tab:languagenames}.
644 \item A \DWATstmtlist{} attribute\addtoindexx{statement list attribute}
645 whose value of class \CLASSlineptr{} points to the line number
646 information for this type unit.
648 \textit{Because type units do not describe any code, they
649 do not actually need a line number table, but the line number
650 headers contain a list of directories and file names that
651 may be referenced by the \DWATdeclfile{} attribute of the
652 type or part of its description.}
654 \textit{In an object file with a conventional compilation
655 unit entry, the type unit entries may refer to (share) the
656 line number table used by the compilation unit. In a type
657 unit located in a split compilation unit, the
658 \DWATstmtlistNAME{} attribute refers to a \doublequote{specialized}
659 line number table in the \dotdebuglinedwo{} section, which
660 contains only the list of directories and file names.}
662 \textit{All type unit entries in a \splitDWARFobjectfile{} may
663 (but are not required to) refer to the same
664 \addtoindex{specialized line number table}.}
666 \item A \DWATuseUTFeight{} attribute, which is a flag
667 whose presence indicates that all strings referred to by this type
668 unit entry, its children, and its associated
669 \addtoindex{specialized line number table},
670 are represented using the UTF-8 representation.
673 \item A \DWATstroffsetsbase\addtoindexx{string offsets base attribute}
674 attribute, whose value is of class \CLASSstroffsetsptr.
675 This attribute points
676 to the first string offset of the type unit's contribution to
677 the \dotdebugstroffsets{} section. Indirect string references
678 (using \DWFORMstrx) within the type unit are interpreted
679 as indices relative to this base.
683 A \addtoindex{type unit} entry for a given type T owns a debugging
684 information entry that represents a defining declaration
685 of type T. If the type is nested within enclosing types or
686 namespaces, the debugging information entry for T is nested
687 within debugging information entries describing its containers;
688 otherwise, T is a direct child of the type unit entry.
690 A type unit entry may also own additional debugging information
691 entries that represent declarations of additional types that
692 are referenced by type T and have not themselves been placed in
693 separate type units. Like T, if an additional type U is nested
694 within enclosing types or namespaces, the debugging information
695 entry for U is nested within entries describing its containers;
696 otherwise, U is a direct child of the type unit entry.
698 The containing entries for types T and U are declarations,
699 and the outermost containing entry for any given type T or
700 U is a direct child of the type unit entry. The containing
701 entries may be shared among the additional types and between
702 T and the additional types.
704 \textit{Examples of these kinds of relationships are found in
705 Section \refersec{app:signaturecomputationexample} and
706 Section \refersec{app:declarationscompletingnondefiningdeclarations}.}
709 \textit{Types are not required to be placed in type units. In general,
710 only large types such as structure, class, enumeration, and
711 union types included from header files should be considered
712 for separate type units. Base types and other small types
713 are not usually worth the overhead of placement in separate
714 type units. Types that are unlikely to be replicated, such
715 as those defined in the main source file, are also better
716 left in the main compilation unit.}
718 \section{Module, Namespace and Importing Entries}
719 \textit{Modules and namespaces provide a means to collect related
720 entities into a single entity and to manage the names of
724 \subsection{Module Entries}
725 \label{chap:moduleentries}
726 \textit{Several languages have the concept of a \doublequote{module.}
727 \addtoindexx{Modula-2}
728 A Modula\dash 2 definition module
729 \addtoindexx{Modula-2!definition module}
730 may be represented by a module
732 \addtoindex{declaration attribute}
733 (\DWATdeclaration). A
734 \addtoindex{Fortran 90} module
735 \addtoindexx{Fortran!module (Fortran 90)}
736 may also be represented by a module entry
737 (but no declaration attribute is warranted because \addtoindex{Fortran}
738 has no concept of a corresponding module body).}
740 A module is represented by a debugging information entry
742 tag \DWTAGmoduleTARG.
743 Module entries may own other
744 debugging information entries describing program entities
745 whose declaration scopes end at the end of the module itself.
747 If the module has a name, the module entry has a
748 \DWATname{} attribute
749 \addtoindexx{name attribute}
750 whose value is a null\dash terminated string containing
753 The \addtoindex{module entry} may have either a
757 \addtoindexx{high PC attribute}
759 \addtoindexx{low PC attribute}
761 \DWATranges{} attribute
762 \addtoindexx{ranges attribute}
763 whose values encode the contiguous or non-contiguous address
764 ranges, respectively, of the machine instructions generated for
765 the module initialization
766 code\hypertarget{chap:DWATentrypcentryaddressofmoduleinitialization}{}
767 (see Section \refersec{chap:codeaddressesandranges}).
769 \addtoindexx{entry PC attribute!for module initialization}
770 \DWATentrypc{} attribute whose value is the address of
771 the first executable instruction of that initialization code
772 (see Section \refersec{chap:entryaddress}).
775 If\hypertarget{chap:DWATprioritymodulepriority}{}
776 the module has been assigned a priority, it may have a
777 \addtoindexx{priority attribute}
778 \DWATpriorityDEFN{} attribute.
779 The value of this attribute is a
780 reference to another debugging information entry describing
781 a variable with a constant value. The value of this variable
782 is the actual constant value of the module\textquoteright s priority,
783 represented as it would be on the target architecture.
785 \subsection{Namespace Entries}
786 \label{chap:namespaceentries}
787 \textit{\addtoindex{C++} has the notion of a namespace, which provides a way to
788 \addtoindexx{namespace (C++)}
789 implement name hiding, so that names of unrelated things
790 do not accidentally clash in the
791 \addtoindex{global namespace} when an
792 application is linked together.}
794 A namespace is represented by a debugging information entry
795 with the tag \DWTAGnamespaceTARG. A namespace extension
796 is\hypertarget{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}{}
797 represented by a \DWTAGnamespaceNAME{} entry with a
798 \DWATextensionDEFN{}\addtoindexx{extension attribute}
799 attribute referring to the previous extension, or if there
800 is no previous extension, to the original
801 \DWTAGnamespaceNAME{}
802 entry. A namespace extension entry does not need to duplicate
803 information in a previous extension entry of the namespace
804 nor need it duplicate information in the original namespace
805 entry. (Thus, for a namespace with a name,
806 a \DWATname{} attribute
807 \addtoindexx{name attribute}
808 need only be attached directly to the original
809 \DWTAGnamespaceNAME{} entry.)
812 Namespace and namespace extension entries may own
813 \addtoindexx{namespace extension entry}
815 \addtoindexx{namespace declaration entry}
816 debugging information entries describing program entities
817 whose declarations occur in the namespace.
819 A namespace may have a
820 \DWATexportsymbolsDEFN{}\livetarg{chap:DWATexportsymbolsofnamespace}{}
821 attribute\addtoindexx{export symbols attribute}
822 \addtoindexx{inline namespace|see{\textit{also} export symbols attribute}}
823 which is a \CLASSflag{} which
824 indicates that all member names defined within the
825 namespace may be referenced as if they were defined within
826 the containing namespace.
828 \textit{This may be used to describe an \addtoindex{inline namespace} in \addtoindex{C++}}.
830 If a type, variable, or function declared in a namespace is
831 defined outside of the body of the namespace declaration,
832 that type, variable, or function definition entry has a
833 \DWATspecification{} attribute
834 \addtoindexx{specification attribute}
835 whose value is a \livelink{chap:classreference}{reference} to the
836 debugging information entry representing the declaration of
837 the type, variable or function. Type, variable, or function
839 \DWATspecification{} attribute
840 \addtoindexx{specification attribute}
842 to duplicate information provided by the declaration entry
843 referenced by the specification attribute.
845 \textit{The \addtoindex{C++} \addtoindex{global namespace}
847 \addtoindexx{global namespace|see{namespace (C++), global}}
849 \addtoindexx{namespace (C++)!global}
851 \texttt{::f}, for example) is not explicitly represented in
852 DWARF with a namespace entry (thus mirroring the situation
853 in \addtoindex{C++} source).
854 Global items may be simply declared with no
855 reference to a namespace.}
857 \textit{The \addtoindex{C++}
858 compilation unit specific \doublequote{unnamed namespace} may
859 \addtoindexx{namespace (C++)!unnamed}
860 \addtoindexx{unnamed namespace|see {namespace (C++), unnamed}}
861 be represented by a namespace entry with no name attribute in
862 the original namespace declaration entry (and therefore no name
863 attribute in any namespace extension entry of this namespace).
864 C++ states that declarations in the unnamed namespace are
865 implicitly available in the containing scope; a producer
866 should make this effect explicit with the \DWATexportsymbols{}
867 attribute, or by using a \DWTAGimportedmodule{} that is a
868 sibling of the namespace entry and references it.}
870 \textit{A compiler emitting namespace information may choose to
871 explicitly represent namespace extensions, or to represent the
872 final namespace declaration of a compilation unit; this is a
873 quality-of-implementation issue and no specific requirements
874 are given here. If only the final namespace is represented,
875 \addtoindexx{namespace (C++)!using declaration}
876 it is impossible for a debugger to interpret using declaration
877 references in exactly the manner defined by the
878 \addtoindex{C++} language.}
880 \textit{For \addtoindex{C++} namespace examples,
881 see Appendix \refersec{app:namespaceexamples}.}
885 \subsection{Imported (or Renamed) Declaration Entries}
886 \label{chap:importedorrenameddeclarationentries}
888 \textit{Some languages support the concept of importing into or
889 making accessible in a given unit certain declarations that occur
890 in a different module or scope. An imported declaration may
891 sometimes be given another name.}
894 An imported declaration is represented by one or
895 \addtoindexx{imported declaration entry}
896 more debugging information entries with the
897 tag \DWTAGimporteddeclarationTARG.
898 When\hypertarget{chap:DWATimportimporteddeclaration}{}
899 an overloaded entity is imported, there is one imported
900 declaration entry for each overloading.
901 Each imported declaration entry has a
902 \DWATimportDEFN{} attribute,\addtoindexx{import attribute}
903 whose value is a \livelink{chap:classreference}{reference} to the
904 debugging information entry representing the declaration that
907 An imported declaration may also have a \DWATname{}
908 attribute\addtoindexx{name attribute}
909 whose value is a null-terminated string containing the
911 imported entity is to be known in the context of the imported
912 declaration entry (which may be different than the name of
913 the entity being imported). If no name is present, then the
914 name by which the entity is to be known is the same as the
915 name of the entity being imported.
917 An imported declaration entry with a name attribute may be
918 used as a general means to rename or provide an alias for
919 \addtoindexx{alias declaration|see{imported declaration entry}}
920 an entity, regardless of the context in which the importing
921 declaration or the imported entity occurs.
923 \textit{A \addtoindex{C++}
924 namespace alias\hypertarget{chap:DWATimportnamespacealias}{}
925 may be represented by an imported declaration entry
926 \addtoindexx{namespace (C++)!alias}
927 with a name attribute whose value is
928 a null-terminated string containing the alias name
929 and a \DWATimportDEFN{} attribute
930 whose value is a \livelink{chap:classreference}{reference} to the
931 applicable original namespace or namespace extension entry.}
933 \textit{A \addtoindex{C++} using declaration may be represented
935 imported\hypertarget{chap:DWATimportnamespaceusingdeclaration}{}
936 \addtoindexx{namespace (C++)!using declaration}
937 declaration entries. When the using declaration
938 refers to an overloaded function, there is one imported
939 declaration entry corresponding to each overloading. Each
940 imported declaration entry has no name attribute but it does
941 have a \DWATimportDEFN{} attribute that refers to the entry for the
942 entity being imported. (\addtoindex{C++}
943 provides no means to \doublequote{rename}
944 an imported entity, other than a namespace).}
947 \textit{A \addtoindex{Fortran} use statement
948 \addtoindexx{Fortran!use statement}
949 \addtoindexx{use statement|see {Fortran, use statement}}
950 with an \doublequote{only list} may be
951 represented by a series of imported declaration entries,
952 one (or more) for each entity that is imported. An entity
953 \addtoindexx{renamed declaration|see{imported declaration entry}}
954 that is renamed in the importing context may be represented
955 by an imported declaration entry with a name attribute that
956 specifies the new local name.
959 \subsection{Imported Module Entries}
960 \label{chap:importedmoduleentries}
962 \textit{Some languages support the concept of importing into or making
963 accessible in a given unit all of the declarations contained
964 within a separate module or namespace.
967 An imported module declaration is represented by a debugging
968 information entry with
969 \addtoindexx{imported module attribute}
971 \addtoindexx{imported module entry}
972 tag \DWTAGimportedmoduleTARG.
974 imported module entry contains a
975 \DWATimport{} attribute
976 \addtoindexx{import attribute}
977 whose value is a \livelink{chap:classreference}{reference}
978 to the module or namespace entry
979 containing the definition and/or declaration entries for
980 the entities that are to be imported into the context of the
981 imported module entry.
983 An imported module declaration may own a set of imported
984 declaration entries, each of which refers to an entry in the
985 module whose corresponding entity is to be known in the context
986 of the imported module declaration by a name other than its
987 name in that module. Any entity in the module that is not
988 renamed in this way is known in the context of the imported
989 module entry by the same name as it is declared in the module.
991 \textit{A \addtoindex{C++} using directive
992 \addtoindexx{namespace (C++)!using directive}
993 \addtoindexx{using directive|see {namespace (C++), using directive}}
994 may be represented by an imported
995 module\hypertarget{chap:DWATimportnamespaceusingdirective}{}
996 entry, with a \DWATimportDEFN{} attribute referring to the namespace
997 entry of the appropriate extension of the namespace (which
998 might be the original namespace entry) and no owned entries.
1001 \textit{A \addtoindex{Fortran} use statement
1002 \addtoindexx{Fortran!use statement}
1003 with a \doublequote{rename list} may be
1004 represented by an imported module entry with an import
1005 attribute referring to the module and owned entries
1006 corresponding to those entities that are renamed as part of
1010 \textit{A \addtoindex{Fortran} use statement
1011 \addtoindexx{Fortran!use statement}
1012 with neither a \doublequote{rename list} nor
1013 an \doublequote{only list} may be represented by an imported module
1014 entry with an import attribute referring to the module and
1015 no owned child entries.
1018 \textit{A use statement with an \doublequote{only list} is represented by a
1019 series of individual imported declaration entries as described
1020 in Section \refersec{chap:importedorrenameddeclarationentries}.
1024 \textit{A \addtoindex{Fortran} use statement for an entity in a module that is
1025 \addtoindexx{Fortran!use statement}
1026 itself imported by a use statement without an explicit mention
1027 may be represented by an imported declaration entry that refers
1028 to the original debugging information entry. For example, given}
1029 \par % Needed to end paragraph before listing so that it gets a line number
1045 \textit{the imported declaration entry for Q within module C refers
1046 directly to the variable declaration entry for X in module A
1047 because there is no explicit representation for X in module B.
1050 \textit{A similar situation arises for a \addtoindex{C++} using declaration
1051 \addtoindexx{namespace (C++)!using declaration}
1052 \addtoindexx{using declaration|see {namespace (C++), using declaration}}
1053 that imports an entity in terms of a namespace alias. See
1054 Appendix \refersec{app:namespaceexamples}
1058 \subsection{Imported Unit Entries}
1059 \label{chap:importedunitentries}
1060 \hypertarget{chap:DWATimportimportedunit}{}
1061 The place where a normal or partial compilation unit is imported is
1062 represented by a debugging information entry with the
1063 \addtoindexx{imported unit entry}
1064 tag \DWTAGimportedunitTARG.
1065 An imported unit entry contains a
1066 \DWATimportDEFN{} attribute\addtoindexx{import attribute}
1067 whose value is a \livelink{chap:classreference}{reference} to the
1068 normal or partial compilation unit whose declarations logically
1069 belong at the place of the imported unit entry.
1071 \textit{An imported unit entry does not necessarily correspond to
1072 any entity or construct in the source program. It is merely
1073 \doublequote{glue} used to relate a partial unit, or a compilation
1074 unit used as a partial unit, to a place in some other
1077 \section{Subroutine and Entry Point Entries}
1078 \label{chap:subroutineandentrypointentries}
1080 The following tags exist to describe
1081 debugging information entries
1082 \addtoindexx{function entry|see{subroutine entry}}
1084 \addtoindexx{subroutine entry}
1086 \addtoindexx{subprogram entry}
1088 % FIXME: is entry point entry the right index 'entry'?
1089 \addtoindexx{entry point entry}
1093 \begin{tabular}{lp{9.0cm}}
1094 \DWTAGsubprogramTARG{} & A subroutine or function \\
1095 \DWTAGinlinedsubroutine{} & A particular inlined
1096 \addtoindexx{inlined subprogram entry}
1097 instance of a subroutine or function \\
1098 \DWTAGentrypointTARG{} & An alternate entry point \\
1100 \par\condlinenumbers
1103 \subsection{General Subroutine and Entry Point Information}
1104 \label{chap:generalsubroutineandentrypointinformation}
1105 The subroutine or entry point entry has a \DWATname{}
1106 attribute whose value is a null-terminated string containing the
1107 subroutine or entry point name.
1108 It may also have a \DWATlinkagename{} attribute as
1109 described in Section \refersec{chap:linkagenames}.
1111 If the name of the subroutine described by an entry with the
1112 \addtoindexx{subprogram entry}
1113 tag \DWTAGsubprogram{}\hypertarget{chap:DWATexternalexternalsubroutine}{}
1114 is visible outside of its containing
1115 compilation unit, that entry has a
1116 \DWATexternalDEFN{} attribute,\addtoindexx{external attribute}
1117 which is a \livelink{chap:classflag}{flag}.
1119 \textit{Additional attributes for functions that are members of a
1120 class or structure are described in
1121 Section \refersec{chap:memberfunctionentries}.
1124 A\hypertarget{chap:DWATmainsubprogrammainorstartingsubprogram}{}
1125 subroutine entry may contain a
1126 \DWATmainsubprogramDEFN{} attribute
1127 \addtoindexx{main subprogram attribute}
1129 a \CLASSflag{} whose presence indicates that the
1130 subroutine has been identified as the starting function of
1131 the program. If more than one subprogram contains this
1133 any one of them may be the starting subroutine of the program.
1135 \textit{See also Section \refersec{chap:unitentries}) regarding the
1136 related use of this attribute to indicate that a compilation
1137 unit contains the main subroutine of a program.}
1139 \subsubsection{Calling Convention Information}
1140 \hypertarget{chap:DWATcallingconventionforsubprograms}{}
1141 A subroutine entry may contain a
1142 \DWATcallingconventionDEFN{}
1143 \addtoindexx{calling convention attribute!for subprogram}
1144 attribute, whose value is an
1145 \livelink{chap:classconstant}{integer constant}. The set of
1146 \addtoindexi{calling convention codes for subroutines}{calling convention codes!for subroutines}
1147 is given in Table \refersec{tab:callingconventioncodesforsubroutines}.
1149 \begin{simplenametable}[1.4in]{Calling convention codes for subroutines}{tab:callingconventioncodesforsubroutines}
1153 \end{simplenametable}
1155 If this attribute is not present, or its value is the constant
1156 \DWCCnormalTARG, then the subroutine may be safely called by
1157 obeying the \doublequote{standard} calling conventions of the target
1158 architecture. If the value of the calling convention attribute
1159 is the constant \DWCCnocallTARG, the subroutine does not obey
1160 standard calling conventions, and it may not be safe for the
1161 debugger to call this subroutine.
1163 \textit{Note that \DWCCnormal{} is also used as a calling convention
1164 code for certain types
1165 (see Table \refersec{tab:callingconventioncodesfortypes}).}
1167 If the semantics of the language of the compilation unit
1168 containing the subroutine entry distinguishes between ordinary
1169 subroutines and subroutines that can serve as the \doublequote{main
1170 program,} that is, subroutines that cannot be called
1171 directly according to the ordinary calling conventions,
1172 then the debugging information entry for such a subroutine
1173 may have a calling convention attribute whose value is the
1174 constant \DWCCprogramTARG.
1176 \textit{A common debugger feature is to allow the debugger user to call
1177 a subroutine within the subject program. In certain cases,
1178 however, the generated code for a subroutine will not obey
1179 the standard calling conventions for the target architecture
1180 and will therefore not be safe to call from within a debugger.}
1182 \textit{The \DWCCprogram{}
1183 value is intended to support \addtoindex{Fortran} main
1184 \addtoindexx{Fortran!main program}
1185 programs which in some implementations may not be callable
1186 or which must be invoked in a special way. It is not intended
1187 as a way of finding the entry address for the program.}
1190 \subsubsection{Miscellaneous Subprogram Properties}
1191 \textit{In \addtoindex{C}
1192 there is a difference between the types of functions
1193 declared using function prototype style declarations and
1194 those declared using non-prototype declarations.}
1196 A subroutine entry declared with a function prototype style
1197 declaration may have a
1198 \addtoindexx{prototyped attribute}
1199 \DWATprototypedDEFN{} attribute, which is
1201 The attribute indicates whether a subroutine entry point corresponds
1202 to a function declaration that includes parameter prototype information.
1204 A subprogram entry may have
1205 a\hypertarget{chap:DWATelementalelementalpropertyofasubroutine}{}
1206 \DWATelementalDEFN{} attribute,\addtoindexx{elemental attribute}
1207 which is a \livelink{chap:classflag}{flag}.
1208 The attribute indicates whether the subroutine
1209 or entry point was declared with the \doublequote{elemental} keyword
1212 A\hypertarget{chap:DWATpurepurepropertyofasubroutine}{}
1213 subprogram entry may have a
1214 \addtoindexx{pure attribute}
1215 \DWATpureDEFN{} attribute, which is
1216 a \livelink{chap:classflag}{flag}.
1217 The attribute indicates whether the subroutine was
1218 declared with the \doublequote{pure} keyword or property.
1220 A\hypertarget{chap:DWATrecursiverecursivepropertyofasubroutine}{}
1221 subprogram entry may have a
1222 \addtoindexx{recursive attribute}
1223 \DWATrecursiveDEFN{} attribute, which
1224 is a \livelink{chap:classflag}{flag}.
1225 The attribute indicates whether the subroutine
1226 or entry point was declared with the \doublequote{recursive} keyword
1229 A subprogram entry may have a
1231 \livetargi{chap:DWATnoreturnofsubprogram}{attribute}{noreturn attribute},
1232 which is a \CLASSflag. The attribute
1233 indicates whether the subprogram was declared with the \doublequote{noreturn} keyword or property
1234 indicating that the subprogram can be called, but will never return to its caller.
1237 \textit{The \addtoindex{Fortran}
1238 language allows the keywords \texttt{elemental}, \texttt{pure}
1239 and \texttt{recursive} to be included as part of the declaration of
1240 a subroutine; these attributes reflect that usage. These
1241 attributes are not relevant for languages that do not support
1242 similar keywords or syntax. In particular, the \DWATrecursiveNAME{}
1243 attribute is neither needed nor appropriate in languages such
1244 as \addtoindex{C} where functions support recursion by default.}
1247 \subsubsection{Call Site-Related Attributes}
1248 \textit{While subprogram attributes in the previous section provide
1249 information about the subprogram and its entry point(s) as a whole,
1250 the following attributes provide summary information about the calls
1251 that occur within a subprogram.}
1253 A subroutine entry may have \DWATcallalltailcalls,
1254 \DWATcallallcalls{} and/or \DWATcallallsourcecalls{}
1255 attributes, each of which is a \CLASSflag.
1256 \addtoindexx{call site summary information}
1257 \addtoindexx{subroutine call site summary attributes}
1258 These flags indicate the completeness of the call site
1259 information provided by call site entries (see
1260 Section \refersec{chap:callsiteentries}) within the subprogram.
1262 The \DWATcallalltailcallsDEFN{}
1263 \livetargi{chap:DWATcallalltailcallsofasubprogram}{attribute}{all tail calls summary attribute}
1264 indicates that every tail call
1265 that occurs in the code for the subprogram is described by a
1266 \DWTAGcallsite{} entry.
1267 (There may or may not be other non-tail calls to some of the same
1268 target subprograms.)
1270 The \DWATcallallcallsDEFN{}
1271 \livetargi{chap:DWATcallallcallsofasubprogram}{attribute}{all calls summary attribute}
1272 indicates that every non-inlined call
1273 (either a tail call or a normal call) that occurs in the code for the subprogram
1274 is described by a \DWTAGcallsite{} entry.
1276 The \DWATcallallsourcecallsDEFN{}
1277 \livetargi{chap:DWATcallallsourcecallsofasubprogram}{attribute}{all source calls summary attribute}
1278 indicates that every call that occurs in the
1279 code for the subprogram, including every call inlined into it, is described by either a
1280 \DWTAGcallsite{} entry or a \DWTAGinlinedsubroutine{} entry; further, any call
1281 that is optimized out is nonetheless also described using a \DWTAGcallsite{} entry
1282 that has neither a \DWATcallpc{} nor \DWATcallreturnpc{} attribute.
1284 \textit{The \DWATcallallsourcecallsNAME{} attribute is intended for debugging
1285 information format consumers that analyze call graphs.}
1287 If the the \DWATcallallsourcecalls{} attribute is present then the
1288 \DWATcallallcalls{} and \DWATcallalltailcalls{} attributes are
1289 also implicitly present. Similarly, if the
1290 \DWATcallallcalls{} attribute is present then the \DWATcallalltailcalls{}
1291 attribute is implicitly present.
1294 \subsection{Subroutine and Entry Point Return Types}
1295 \label{chap:subroutineandentrypointreturntypes}
1297 If\hypertarget{chap:DWATtypetypeofsubroutinereturn}{}
1298 the subroutine or entry point
1299 \addtoindexx{return type of subroutine}
1300 is a function that returns a
1301 value, then its debugging information entry has
1302 \addtoindexx{type attribute}
1303 a \DWATtypeDEFN{} attribute
1304 to denote the type returned by that function.
1306 \textit{Debugging information entries for
1307 \addtoindex{C} void functions should
1308 not have an attribute for the return type. }
1310 \textit{Debugging information entries for declarations of \addtoindex{C++}
1311 member functions with an
1312 \autoreturntype{} specifier should use an unspecified type entry (see
1313 Section \refersec{chap:unspecifiedtypeentries}).
1314 The debugging information entry for the corresponding definition
1315 should provide the deduced return type. This practice causes the description of
1316 the containing class to be consistent across compilation units, allowing the class
1317 declaration to be placed into a separate type unit if desired.}
1320 \subsection{Subroutine and Entry Point Locations}
1321 \label{chap:subroutineandentrypointlocations}
1323 A subroutine entry may have either a \DWATlowpc{} and
1324 \DWAThighpc{} pair of attributes or a \DWATranges{} attribute
1325 \addtoindexx{ranges attribute}
1327 \addtoindexx{high PC attribute}
1329 \addtoindexx{low PC attribute}
1330 encode the contiguous or non-contiguous address
1331 ranges, respectively, of the machine instructions generated
1332 for the subroutine (see
1333 Section \refersec{chap:codeaddressesandranges}).
1335 A\hypertarget{chap:DWATentrypcentryaddressofsubprogram}{}
1336 subroutine entry may also have a
1337 \addtoindexx{entry PC attribute!for subroutine}
1338 \DWATentrypc{} attribute
1339 whose value is the address of the first executable instruction
1340 of the subroutine (see
1341 Section \refersec{chap:entryaddress}).
1343 An entry point has a \DWATlowpc{} attribute whose value is the
1344 relocated address of the first machine instruction generated
1345 for the entry point.
1348 %\textit{While the \DWATentrypc{} attribute
1349 %\addtoindexx{entry pc attribute!for subroutine}
1350 %might also seem appropriate for this purpose, historically the
1351 %\DWATlowpc{} attribute was used before the
1352 %\DWATentrypc{} was introduced (in
1353 %\addtoindex{DWARF Version 3}).
1354 %There is insufficient reason to change this.}
1356 Subroutines and entry points may also have
1357 \DWATsegment{}\hypertarget{chap:DWATaddressclasssubroutineorsubroutinetype}{}
1358 \addtoindexx{segment attribute} and
1359 \DWATaddressclassDEFN{}\addtoindexx{address class attribute}
1360 attributes, as appropriate, to specify
1361 which segments the code for the subroutine resides in and
1362 the addressing mode to be used in calling that subroutine.
1364 A subroutine entry representing a subroutine declaration
1365 that is not also a definition does not have code address or
1369 \subsection{Declarations Owned by Subroutines and Entry Points}
1370 \label{chap:declarationsownedbysubroutinesandentrypoints}
1371 \addtoindexx{subroutine formal parameters}
1372 The declarations enclosed by a subroutine or entry point are
1373 represented by debugging information entries that are owned
1374 by the subroutine or entry point entry. Entries representing
1375 \addtoindexx{formal parameter}
1376 the formal parameters of the subroutine or entry point appear
1377 in the same order as the corresponding declarations in the
1381 \textit{There is no ordering requirement for entries for declarations
1382 other than formal parameters. The formal parameter
1383 entries may be interspersed with other entries used by formal
1384 parameter entries, such as type entries.}
1386 The unspecified (sometimes called \doublequote{varying})
1387 parameters of a subroutine parameter list are
1388 represented by a debugging information
1389 entry\addtoindexx{unspecified parameters entry}
1390 with the tag \DWTAGunspecifiedparametersTARG.
1393 The entry for a subroutine that includes a
1394 \addtoindex{Fortran}
1395 \addtoindexx{Fortran!common block}
1396 \livelink{chap:fortrancommonblock}{common}
1397 \livelink{chap:commonblockentry}{block}
1398 \addtoindexx{common block|see{Fortran common block}}
1399 has a child entry with the
1400 tag \DWTAGcommoninclusionTARG.
1401 The\hypertarget{chap:commonreferencecommonblockusage}{}
1402 common inclusion entry has a
1403 \DWATcommonreferenceDEFN{} attribute
1404 \addtoindexx{common block reference attribute}
1405 whose value is a \livelink{chap:classreference}{reference}
1406 to the debugging information entry
1407 for the common \nolink{block} being included
1408 (see Section \refersec{chap:commonblockentries}).
1410 \subsection{Low-Level Information}
1411 \label{chap:lowlevelinformation}
1413 A\hypertarget{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}{}
1414 subroutine or entry point entry may have a
1415 \addtoindexx{return address attribute}
1416 \DWATreturnaddrDEFN{}
1417 attribute, whose value is a location description. The location
1418 specified is the place where the return address for the
1419 subroutine or entry point is stored.
1421 A\hypertarget{chap:DWATframebasesubroutineframebaseaddress}{}
1422 subroutine or entry point entry may also have a
1423 \addtoindexx{frame base attribute}
1424 \DWATframebaseDEFN{} attribute, whose value is a location
1425 description that describes the \doublequote{frame base} for the
1426 subroutine or entry point. If the location description is
1427 a simple register location description, the given register
1428 contains the frame base address. If the location description is
1429 a DWARF expression, the result of evaluating that expression
1430 is the frame base address. Finally, for a
1431 \addtoindex{location list},
1432 this interpretation applies to each location description
1433 contained in the list of \addtoindex{location list} entries.
1435 \textit{The use of one of the \DWOPregn{}
1436 operations in this context is equivalent to using
1437 \DWOPbregn(0) but more
1438 compact. However, these are not equivalent in general.}
1441 \textit{The frame base for a subprogram is typically an address
1442 relative to the first unit of storage allocated for the
1443 subprogram\textquoteright s stack frame. The \DWATframebase{} attribute
1444 can be used in several ways:}
1445 \begin{enumerate}[1. ]
1446 \item \textit{In subprograms that need
1447 \addtoindexx{location list}
1448 location lists to locate local
1449 variables, the \DWATframebase{} can hold the needed location
1450 list, while all variables\textquoteright\ location descriptions can be
1451 simpler ones involving the frame base.}
1453 \item \textit{It can be used in resolving \doublequote{up\dash level} addressing
1454 within nested routines.
1455 (See also \DWATstaticlink, below)}
1459 \textit{Some languages support nested subroutines. In such languages,
1460 it is possible to reference the local variables of an
1461 outer subroutine from within an inner subroutine. The
1462 \DWATstaticlink{} and \DWATframebase{} attributes allow
1463 debuggers to support this same kind of referencing.}
1465 If\hypertarget{chap:DWATstaticlinklocationofuplevelframe}{}
1466 a subroutine or entry point is nested, it may have a
1467 \addtoindexx{address!uplevel|see {static link attribute}}
1468 \addtoindexx{uplevel address|see {static link attribute}}
1469 \DWATstaticlinkDEFN{} attribute, whose value is a location
1470 description that computes the frame base of the relevant
1471 instance of the subroutine that immediately encloses the
1472 subroutine or entry point.
1474 In the context of supporting nested subroutines, the
1475 \DWATframebase{} attribute value obeys the following constraints:
1477 \begin{enumerate}[1. ]
1479 It computes a value that does not change during the
1480 life of the subprogram, and
1482 \item The computed value is unique among instances of
1483 the same subroutine.
1485 \textit{For typical \DWATframebase{} use, this
1486 means that a recursive subroutine\textquoteright s stack frame must have
1491 \textit{If a debugger is attempting to resolve an up\dash level reference
1492 to a variable, it uses the nesting structure of DWARF to
1493 determine which subroutine is the lexical parent and the
1494 \DWATstaticlink{} value to identify the appropriate active
1495 frame of the parent. It can then attempt to find the reference
1496 within the context of the parent.}
1500 \subsection{Types Thrown by Exceptions}
1501 \label{chap:typesthrownbyexceptions}
1503 \textit{In \addtoindex{C++} a subroutine may declare a set of types which
1504 it may validly throw.}
1506 If a subroutine explicitly declares that it may throw
1507 \addtoindexx{exception thrown|see{thrown type entry}}
1509 \addtoindexx{thrown exception|see{thrown type entry}}
1510 exception of one or more types, each such type is
1511 represented by a debugging information entry with
1512 \addtoindexx{thrown type entry}
1514 \DWTAGthrowntypeTARG.
1515 Each such entry is a child of the entry
1516 representing the subroutine that may throw this type. Each
1517 thrown type entry contains
1518 \addtoindexx{type attribute}
1519 a \DWATtype{} attribute, whose
1520 value is a \livelink{chap:classreference}{reference}
1521 to an entry describing the type of the
1522 exception that may be thrown.
1524 \subsection{Function Template Instantiations}
1525 \label{chap:functiontemplateinstantiations}
1527 \textit{In \addtoindex{C++}, a function template is a generic definition of
1528 a function that is instantiated differently for calls with
1529 values of different types. DWARF does not represent the generic
1530 template definition, but does represent each instantiation.}
1533 A \addtoindex{function template instantiation}\addtoindexx{template instantiation!function}
1534 is represented by a debugging information entry with the
1535 \addtoindexx{subprogram entry!use for template instantiation}
1536 tag \DWTAGsubprogram.
1538 exceptions, such an entry will contain the same attributes and
1539 will have the same types of child entries as would an entry
1540 for a subroutine defined explicitly using the instantiation
1541 types and values. The exceptions are:
1543 \begin{enumerate}[1. ]
1544 \item Template parameters are described and referenced as specified in
1545 Section \refersec{chap:templateparameters}.
1548 \item If the compiler has generated a separate compilation unit
1549 to hold the template instantiation and that compilation unit
1550 has a different name from the compilation unit containing
1551 the template definition, the name attribute for the debugging
1552 information entry representing that compilation unit is empty
1555 \item If the subprogram entry representing the template
1556 instantiation or any of its child entries contain declaration
1557 coordinate attributes, those attributes refer to the source
1558 for the template definition, not to any source generated
1559 artificially by the compiler for this instantiation.
1564 \subsection{Inlinable and Inlined Subroutines}
1565 \label{chap:inlinedsubroutines}
1566 A declaration or a definition of an inlinable subroutine
1567 is represented by a debugging information entry with the
1568 tag \DWTAGsubprogram.
1569 The entry for a subroutine
1570 \addtoindexx{subprogram entry!use in inlined subprogram}
1571 that is\hypertarget{chap:DWATinlineinlinedsubroutine}{}
1572 explicitly declared to be available for inline expansion or
1573 that was expanded inline implicitly by the compiler has a
1574 \addtoindexx{inline attribute}
1575 \DWATinlineDEFN{} attribute whose value is an
1576 \livelink{chap:classconstant}{integer constant}. The
1577 set of values for the \DWATinline{} attribute is given in
1578 Table \refersec{tab:inlinecodes}.
1582 \caption{Inline codes}
1583 \label{tab:inlinecodes}
1584 \begin{tabular}{l|P{8cm}}
1586 Name&Meaning\\ \hline
1587 \DWINLnotinlinedTARG{} & Not declared inline nor inlined by the
1588 \mbox{compiler} (equivalent to the absence of the
1589 containing \DWATinline{} attribute) \\
1590 \DWINLinlinedTARG{} & Not declared inline but inlined by the \mbox{compiler} \\
1591 \DWINLdeclarednotinlinedTARG{} & Declared inline but
1592 not inlined by the \mbox{compiler} \\
1593 \DWINLdeclaredinlinedTARG{} & Declared inline and inlined by the
1599 \textit{In \addtoindex{C++}, a function or a constructor declared with
1600 \addttindex{constexpr} is implicitly declared inline. The abstract
1601 instance (see Section \refersec{chap:abstractinstances})
1602 is represented by a debugging information
1603 entry with the tag \DWTAGsubprogram. Such an entry has a
1604 \DWATinline{} attribute whose value is \DWINLinlined.}
1607 \subsubsection{Abstract Instances}
1608 \label{chap:abstractinstances}
1609 Any subroutine entry that contains a
1610 \DWATinlineDEFN{} attribute\addtoindexx{inline attribute}
1611 whose value is other than
1613 is known as an \definition{abstract instance root}.
1614 \addtoindexx{abstract instance!root}
1615 \hypertarget{chap:DWATinlineabstracttinstance}{}
1616 Any debugging information entry that is owned (either
1617 directly or indirectly) by an abstract instance root
1619 \definition{abstract instance entry.}\addtoindexx{abstract instance!entry}
1620 Any set of abstract instance entries that are all
1621 children (either directly or indirectly) of some abstract
1622 instance root, together with the root itself, is known as an
1623 \definition{abstract instance tree.}\addtoindexx{abstract instance!tree}
1624 However, in the case where an abstract instance tree is
1625 nested within another abstract instance tree, the entries in the
1626 \addtoindex{nested abstract instance}
1627 tree are not considered to be entries in the outer abstract
1631 Each abstract instance root is either part of a larger
1632 \addtoindexx{abstract instance!root}
1633 tree (which gives a context for the root) or
1634 \addtoindexx{specification attribute}
1636 \DWATspecification{}
1637 to refer to the declaration in context.
1639 \textit{For example, in \addtoindex{C++} the context might be a namespace
1640 declaration or a class declaration.}
1642 \textit{Abstract instance trees are defined so that no entry is part
1643 of more than one abstract instance tree.}
1645 Attributes and children in an abstract instance are shared
1646 by all concrete instances (see Section \refersec{chap:concreteinstances}).
1648 A debugging information entry that is a member of an abstract
1649 instance tree may not contain any attributes which describe
1650 aspects of the subroutine which vary between distinct inlined
1651 expansions or distinct out-of-line expansions.
1653 \textit{For example,
1654 \addtoindexx{entry pc attribute!and abstract instance}
1655 the \DWATlowpc,\addtoindexx{low PC attribute!and abstract instance}
1656 \DWAThighpc,\addtoindexx{high PC attribute!and abstract instance}
1657 \DWATranges,\addtoindexx{ranges attribute!and abstract instance}
1658 \DWATentrypc,\addtoindexx{entry PC attribute!and abstract instance}
1659 \DWATlocation,\addtoindexx{location attribute!and abstract instance}
1660 \DWATreturnaddr,\addtoindexx{return address attribute!and abstract instance}
1661 \DWATstartscope,\addtoindexx{start scope attribute!and abstract instance}
1663 \DWATsegment{}\addtoindexx{segment attribute!and abstract instance}
1664 attributes typically should be omitted; however, this list is not
1668 \textit{It would not make sense normally to put these attributes into
1669 abstract instance entries since such entries do not represent
1670 actual (concrete) instances and thus do not actually exist at
1671 run\dash time. However,
1672 see Appendix \refersec{app:inlineouteronenormalinner}
1673 for a contrary example.}
1675 The rules for the relative location of entries belonging to
1676 abstract instance trees are exactly the same as for other
1677 similar types of entries that are not abstract. Specifically,
1678 the rule that requires that an entry representing a declaration
1679 be a direct child of the entry representing the scope of the
1680 declaration applies equally to both abstract and non-abstract
1681 entries. Also, the ordering rules for formal parameter entries,
1682 member entries, and so on, all apply regardless of whether
1683 or not a given entry is abstract.
1686 \subsubsection{Concrete Instances}
1687 \label{chap:concreteinstances}
1689 Each inline expansion of a subroutine is represented
1690 by a debugging information entry with the
1691 tag \DWTAGinlinedsubroutineTARG. Each such entry is a direct
1692 child of the entry that represents the scope within which
1693 the inlining occurs.
1696 Each inlined subroutine entry may have either a
1698 and \DWAThighpc{} pair of attributes
1699 \addtoindexx{high PC attribute}
1700 \addtoindexx{low PC attribute}
1701 or a \DWATranges{}\addtoindexx{ranges attribute}
1702 attribute whose values encode the contiguous or non-contiguous
1703 address ranges, respectively, of the machine instructions
1704 generated for the inlined subroutine (see
1705 Section \referfol{chap:codeaddressesandranges}).
1706 An\hypertarget{chap:DWATentrypcentryaddressofinlinedsubprogram}{}
1707 inlined subroutine entry may
1708 \addtoindexx{inlined subprogram entry!in concrete instance}
1710 \addtoindexx{inlined subprogram entry}
1712 \addtoindexx{entry PC attribute!for inlined subprogram}
1715 attribute, representing the first executable instruction of
1716 the inline expansion (see
1717 Section \refersec{chap:entryaddress}).
1719 % Positions of the 3 targets here is a bit arbitrary.
1720 An inlined\hypertarget{chap:DWATcalllinelinenumberofinlinedsubroutinecall}{}
1721 subroutine\hypertarget{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}{}
1722 entry\hypertarget{chap:DWATcallfilefilecontaininginlinedsubroutinecall}{}
1723 may also have \DWATcallfileDEFN,
1724 \DWATcalllineDEFN{} and \DWATcallcolumnDEFN{} attributes,
1725 \addtoindexx{inlined call location attributes}
1727 value is an \livelink{chap:classconstant}{integer constant}.
1728 These attributes represent the
1729 source file, source line number, and source column number,
1730 respectively, of the first character of the statement or
1731 expression that caused the inline expansion. The call file,
1732 call line, and call column attributes are interpreted in
1733 the same way as the declaration file, declaration line, and
1734 declaration column attributes, respectively (see
1735 Section \refersec{chap:declarationcoordinates}).
1737 \textit{The call file, call line and call column coordinates do not
1738 describe the coordinates of the subroutine declaration that
1739 was inlined, rather they describe the coordinates of the call.
1742 An inlined subroutine entry may have
1743 a\hypertarget{chap:DWATconstexprcompiletimeconstantfunction}{}
1744 \DWATconstexprDEFN{} attribute,\addtoindexx{constant expression attribute}
1745 which is a \livelink{chap:classflag}{flag}
1746 whose presence indicates that the
1747 subroutine has been evaluated as a compile\dash time constant. Such
1748 an entry may also have a \DWATconstvalue{} attribute,
1749 whose value may be of any form that is appropriate for the
1750 representation of the subroutine's return value. The value of
1751 this attribute is the actual return value of the subroutine,
1752 represented as it would be on the target architecture.
1754 \textit{In \addtoindex{C++}, if a function or a constructor declared with
1755 \addttindex{constexpr}
1756 is called with constant expressions, then the corresponding
1757 concrete inlined instance has a
1758 \DWATconstexpr{} attribute,
1759 as well as a \DWATconstvalue{} attribute whose value represents
1760 the actual return value of the concrete inlined instance.}
1763 Any debugging information entry that is owned (either
1764 directly or indirectly) by a debugging information entry
1765 with the tag \DWTAGinlinedsubroutine{} is referred to as a
1766 \doublequote{concrete inlined instance entry.} Any entry that has
1768 \DWTAGinlinedsubroutine{}
1769 is known as a \doublequote{concrete inlined instance root.}
1770 Any set of concrete inlined instance
1771 entries that are all children (either directly or indirectly)
1772 of some concrete inlined instance root, together with the root
1773 itself, is known as a \doublequote{concrete inlined instance tree.}
1774 However, in the case where a concrete inlined instance tree
1775 is nested within another concrete instance tree, the entries
1776 in the \addtoindex{nested concrete inline instance} tree
1777 are not considered to
1778 be entries in the outer concrete instance tree.
1781 \textit{Concrete inlined instance trees are defined so that no entry
1782 is part of more than one concrete inlined instance tree. This
1783 simplifies later descriptions.}
1785 Each concrete inlined instance tree is uniquely associated
1786 with one (and only one) abstract instance tree.
1788 \textit{Note, however, that the reverse is not true. Any given abstract
1789 instance tree may be associated with several different concrete
1790 inlined instance trees, or may even be associated with zero
1791 concrete inlined instance trees.}
1793 Concrete inlined instance entries may omit attributes that
1794 are not specific to the concrete instance (but present in
1795 the abstract instance) and need include only attributes that
1796 are specific to the concrete instance (but omitted in the
1797 abstract instance). In place of these omitted attributes,
1798 each\hypertarget{chap:DWATabstractorigininlineinstance}{}
1799 concrete inlined instance entry has a
1800 \addtoindexx{abstract origin attribute}
1801 \DWATabstractoriginDEFN{}
1802 attribute that may be used to obtain the missing information
1803 (indirectly) from the associated abstract instance entry. The
1804 value of the abstract origin attribute is a reference to the
1805 associated abstract instance entry.
1807 If an entry within a concrete inlined instance tree contains
1808 attributes describing the
1809 \addtoindexx{declaration coordinates!in concrete instance}
1810 \livelink{chap:declarationcoordinates}{declaration coordinates}
1811 of that entry, then those attributes refer to the file, line
1812 and column of the original declaration of the subroutine,
1813 not to the point at which it was inlined. As a consequence,
1814 they may usually be omitted from any entry that has an abstract
1818 For each pair of entries that are associated via a
1819 \addtoindexx{abstract origin attribute}
1820 \DWATabstractorigin{} attribute, both members of the pair
1821 have the same tag. So, for example, an entry with the tag
1822 \DWTAGvariable{} can only be associated with another entry
1823 that also has the tag \DWTAGvariable. The only exception
1824 to this rule is that the root of a concrete instance tree
1825 (which must always have the tag \DWTAGinlinedsubroutine)
1826 can only be associated with the root of its associated abstract
1827 instance tree (which must have the tag \DWTAGsubprogram).
1830 In general, the structure and content of any given concrete
1831 inlined instance tree will be closely analogous to the
1832 structure and content of its associated abstract instance
1833 tree. There are a few exceptions:
1835 \begin{enumerate}[1. ]
1836 \item An entry in the concrete instance tree may be omitted if
1838 \addtoindexx{abstract origin attribute}
1839 \DWATabstractorigin{} attribute and either
1840 has no children, or its children are omitted. Such entries
1841 would provide no useful information. In C\dash like languages,
1842 such entries frequently include types, including structure,
1843 union, class, and interface types; and members of types. If any
1844 entry within a concrete inlined instance tree needs to refer
1845 to an entity declared within the scope of the relevant inlined
1846 subroutine and for which no concrete instance entry exists,
1847 the reference refers to the abstract instance entry.
1850 \item Entries in the concrete instance tree which are associated
1851 with entries in the abstract instance tree such that neither
1852 has a \DWATname{} attribute,
1853 \addtoindexx{name attribute}
1854 and neither is referenced by
1855 any other debugging information entry, may be omitted. This
1856 may happen for debugging information entries in the abstract
1857 instance trees that became unnecessary in the concrete instance
1858 tree because of additional information available there. For
1859 example, an anonymous variable might have been created and
1860 described in the abstract instance tree, but because of
1861 the actual parameters for a particular inlined expansion,
1862 it could be described as a constant value without the need
1863 for that separate debugging information entry.
1866 \item A concrete instance tree may contain entries which do
1867 not correspond to entries in the abstract instance tree
1868 to describe new entities that are specific to a particular
1869 inlined expansion. In that case, they will not have associated
1870 entries in the abstract instance tree, do not contain
1871 \addtoindexx{abstract origin attribute}
1872 \DWATabstractorigin{} attributes, and must contain all their
1873 own attributes directly. This allows an abstract instance tree
1874 to omit debugging information entries for anonymous entities
1875 that are unlikely to be needed in most inlined expansions. In
1876 any expansion which deviates from that expectation, the
1877 entries can be described in its concrete inlined instance tree.
1881 \subsubsection{Out-of-Line Instances of Inlined Subroutines}
1882 \label{chap:outoflineinstancesofinlinedsubroutines}
1883 Under some conditions, compilers may need to generate concrete
1884 executable instances of inlined subroutines other than at
1885 points where those subroutines are actually called. Such
1886 concrete instances of inlined subroutines are referred to as
1887 \doublequote{concrete out\dash of\dash line instances.}
1889 \textit{In \addtoindex{C++}, for example,
1890 taking the address of a function declared
1891 to be inline can necessitate the generation of a concrete
1892 out\dash of\dash line instance of the given function.}
1894 The DWARF representation of a concrete out-of-line instance
1895 of an inlined subroutine is essentially the same as for a
1896 concrete inlined instance of that subroutine (as described in
1897 the preceding section). The representation of such a concrete
1898 % It is critical that the hypertarget and livelink be
1899 % separated to avoid problems with latex.
1901 \addtoindexx{abstract origin attribute}
1903 \hypertarget{chap:DWATabstractoriginoutoflineinstance}{}
1905 \DWATabstractoriginDEFN{}
1906 attributes in exactly the same way as they are used for
1907 a concrete inlined instance (that is, as references to
1908 corresponding entries within the associated abstract instance
1911 The differences between the DWARF representation of a
1912 concrete out\dash of\dash line instance of a given subroutine and the
1913 representation of a concrete inlined instance of that same
1914 subroutine are as follows:
1915 \begin{enumerate}[1. ]
1916 \item The root entry for a concrete out\dash of\dash line instance
1917 of a given inlined subroutine has the same tag as does its
1918 associated (abstract) inlined subroutine entry (that is, tag
1919 \DWTAGsubprogram{} rather than \DWTAGinlinedsubroutine).
1921 \item The root entry for a concrete out\dash of\dash line instance tree
1922 is normally owned by the same parent entry that also owns
1923 the root entry of the associated abstract instance. However,
1924 it is not required that the abstract and out\dash of\dash line instance
1925 trees be owned by the same parent entry.
1929 \subsubsection{Nested Inlined Subroutines}
1930 \label{nestedinlinedsubroutines}
1931 Some languages and compilers may permit the logical nesting of
1932 a subroutine within another subroutine, and may permit either
1933 the outer or the nested subroutine, or both, to be inlined.
1935 For a non-inlined subroutine nested within an inlined
1936 subroutine, the nested subroutine is described normally in
1937 both the abstract and concrete inlined instance trees for
1938 the outer subroutine. All rules pertaining to the abstract
1939 and concrete instance trees for the outer subroutine apply
1940 also to the abstract and concrete instance entries for the
1944 For an inlined subroutine nested within another inlined
1945 subroutine, the following rules apply to their abstract and
1946 \addtoindexx{abstract instance!nested}
1947 \addtoindexx{concrete instance!nested}
1948 concrete instance trees:
1950 \begin{enumerate}[1. ]
1951 \item The abstract instance tree for the nested subroutine is
1952 described within the abstract instance tree for the outer
1953 subroutine according to the rules in
1954 Section \refersec{chap:abstractinstances}, and
1955 without regard to the fact that it is within an outer abstract
1958 \item Any abstract instance tree for a nested subroutine is
1959 always omitted within the concrete instance tree for an
1962 \item A concrete instance tree for a nested subroutine is
1963 always omitted within the abstract instance tree for an
1966 \item The concrete instance tree for any inlined or
1967 \addtoindexx{out-of-line instance}
1969 \addtoindexx{out-of-line instance|see{\textit{also} concrete out-of-line instance}}
1970 expansion of the nested subroutine is described within a
1971 concrete instance tree for the outer subroutine according
1973 Sections \refersec{chap:concreteinstances} or
1974 \referfol{chap:outoflineinstancesofinlinedsubroutines}
1976 and without regard to the fact that it is within an outer
1977 concrete instance tree.
1980 \textit{See Appendix \refersec{app:inliningexamples}
1981 for discussion and examples.}
1983 \subsection{Trampolines}
1984 \label{chap:trampolines}
1986 \textit{A trampoline is a compiler\dash generated subroutine that serves
1987 as\hypertarget{chap:DWATtrampolinetargetsubroutine}{}
1988 an intermediary in making a call to another subroutine. It may
1989 adjust parameters and/or the result (if any) as appropriate
1990 to the combined calling and called execution contexts.}
1992 A trampoline is represented by a debugging information entry
1993 \addtoindexx{trampoline (subprogram) entry}
1994 with the tag \DWTAGsubprogram{} or \DWTAGinlinedsubroutine{}
1996 \addtoindexx{trampoline attribute}
1997 a \DWATtrampolineDEFN{} attribute.
1999 attribute indicates the target subroutine of the trampoline,
2000 that is, the subroutine to which the trampoline passes
2001 control. (A trampoline entry may but need not also have a
2002 \DWATartificial{} attribute.)
2005 The value of the trampoline attribute may be represented
2006 using any of the following forms:
2009 \item If the value is of class \CLASSreference{}, then the value
2010 specifies the debugging information entry of the target
2013 \item If the value is of class \CLASSaddress{}, then the value is
2014 the relocated address of the target subprogram.
2017 \item If the value is of class \CLASSstring{}, then the value is the
2018 (possibly mangled) \addtoindexx{mangled names}
2019 name of the target subprogram.
2021 \item If the value is of class \CLASSflag, then the value true
2022 indicates that the containing subroutine is a trampoline but
2023 that the target subroutine is not known.
2027 The target subprogram may itself be a trampoline. (A sequence
2028 of trampolines necessarily ends with a non-trampoline
2031 \textit{In \addtoindex{C++}, trampolines may be used to implement
2032 derived virtual member functions; such trampolines typically
2034 \texttt{this} parameter\index{this parameter@\texttt{this} parameter}
2035 in the course of passing control.
2036 Other languages and environments may use trampolines in a manner
2037 sometimes known as transfer functions or transfer vectors.}
2039 \textit{Trampolines may sometimes pass control to the target
2040 subprogram using a branch or jump instruction instead of a
2041 call instruction, thereby leaving no trace of their existence
2042 in the subsequent execution context. }
2044 \textit{This attribute helps make it feasible for a debugger to arrange
2045 that stepping into a trampoline or setting a breakpoint in
2046 a trampoline will result in stepping into or setting the
2047 breakpoint in the target subroutine instead. This helps to
2048 hide the compiler generated subprogram from the user. }
2050 \section{Call Site Entries and Parameters}
2051 \label{chap:callsiteentriesandparameters}
2053 A call site entry describes a call from one subprogram to another in the
2054 source program. It provides information about the actual parameters of
2055 the call so that they may be more easily accessed by a debugger. When
2056 used together with call frame information
2057 (see Section \refersec{chap:callframeinformation}),
2058 call site entries can be useful for computing the value of an actual parameter
2059 passed by a caller, even when the location description for the callee's
2060 corresponding formal parameter does not provide a current location for
2061 the formal parameter.}
2063 \textit{The DWARF expression for computing the value of an actual parameter at
2064 a call site may refer to registers or memory locations. The expression
2065 assumes these contain the values they would have at the point where the
2066 call is executed. After the called subprogram has been entered, these
2067 registers and memory locations might have been modified. In order to
2068 recover the values that existed at the point of the call (to allow
2069 evaluation of the DWARF expression for the actual parameter), a debugger
2070 may virtually unwind the subprogram activation
2071 (see Section \refersec{chap:callframeinformation}). Any
2072 register or memory location that cannot be recovered is referred to as
2073 "clobbered by the call."}
2075 A source call can be compiled into different types of machine code:
2078 A \textit{normal call} uses a call-like instruction which transfers
2079 control to the start of some subprogram and preserves the call site
2080 location for use by the callee.
2083 A \textit{tail call} uses a jump-like instruction which
2084 transfers control to the start of some subprogram, but
2085 there is no call site location address to preserve
2086 (and thus none is available using the
2087 virtual unwind information).
2090 A \textit{tail recursion call} is a call
2091 to the current subroutine which is compiled as a jump
2092 to the current subroutine.
2096 An \textit{inline (or inlined) call} is a call to an inlined subprogram,
2097 where at least one instruction has the location of the inlined subprogram
2098 or any of its blocks or inlined subprograms.
2102 There are also different types of \doublequote{optimized out} calls:
2105 An \textit{optimized out (normal) call} is a call that is in unreachable code that
2106 has not been emitted (such as, for example, the call to \texttt{foo} in
2107 \texttt{if (0) foo();}).
2109 An \textit{optimized out inline call}
2110 is a call to an inlined subprogram which either did not expand to any instructions
2111 or only parts of instructions belong to it and for debug information purposes those
2112 instructions are given a location in the caller.
2115 \DWTAGcallsite{} entries describe normal and tail calls but not tail recursion calls,
2116 while \DWTAGinlinedsubroutine{} entries describe inlined calls
2117 (see Section \refersec{chap:inlinedsubroutines}).
2118 Call site entries cannot describe tail recursion or optimized out calls.
2120 \subsection{Call Site Entries}
2121 \label{chap:callsiteentries}
2122 A call site is represented by a debugging information entry with the tag
2123 \DWTAGcallsiteTARG{}\addtoindexx{call site entry}.
2124 The entry for a call site is owned by the innermost
2125 debugging information entry representing the scope within which the
2126 call is present in the source program.
2129 \textit{A scope entry (for example, a lexical block) that would not
2130 otherwise be present in the debugging information of a subroutine
2131 need not be introduced solely to represent the immediately containing scope
2134 The call site entry may have a
2135 \DWATcallreturnpcDEFN{}\addtoindexx{call site return pc attribute}
2136 \livetargi{chap:DWATcallreturnpcofcallsite}{attribute}{call return pc attribute}
2137 which is the return address after the call.
2138 The value of this attribute corresponds to the return address
2139 computed by call frame information in the called subprogram
2140 (see Section \refersec{datarep:callframeinformation}).
2142 \textit{On many architectures the return address is the
2143 address immediately following the call instruction, but
2144 on architectures with delay slots it might
2145 be an address after the delay slot of the call.}
2147 The call site entry may have a
2148 \DWATcallpcDEFN{}\addtoindexx{call pc attribute}
2149 \livetargi{chap:DWATcallpcofcallsite}{attribute}{call pc attribute}
2150 which is the address of the
2151 call-like instruction for a normal call or the jump-like
2152 instruction for a tail call.
2154 If the call site entry corresponds to a tail call, it has the
2155 \DWATcalltailcallDEFN{}\addtoindexx{call tail call attribute}
2156 \livetargi{chap:DWATcalltailcallofcallsite}{attribute}{call tail call attribute},
2157 which is a \CLASSflag.
2159 The call site entry may have a
2160 \DWATcalloriginDEFN{}\addtoindexx{call origin attribute}
2161 \livetargi{chap:DWATcalloriginofcallsite}{attribute}{call origin attribute}
2162 which is a \CLASSreference. For direct calls or jumps where the called
2163 subprogram is known it is a reference to the called subprogram's debugging
2164 information entry. For indirect calls it may be a reference to a
2165 \DWTAGvariable{}, \DWTAGformalparameter{} or \DWTAGmember{} entry representing
2166 the subroutine pointer that is called.
2169 The call site may have a
2170 \DWATcalltargetDEFN{}\addtoindexx{call target attribute}
2171 \livetargi{chap:DWATcalltargetofcallsite}{attribute}{call target attribute} which is
2172 a DWARF expression. For indirect calls or jumps where it is unknown at
2173 compile time which subprogram will be called the expression computes the
2174 address of the subprogram that will be called.
2176 \textit{The DWARF expression should
2177 not use register or memory locations that might be clobbered by the call.}
2180 The call site entry may have a
2181 \DWATcalltargetclobberedDEFN{}\addtoindexx{call target clobbered attribute}
2182 \livetargi{chap:DWATcalltargetclobberedofcallsite}{attribute}{call target clobbered attribute}
2183 which is a DWARF expression. For indirect calls or jumps where the
2184 address is not computable without use of registers or memory locations that
2185 might be clobbered by the call the \DWATcalltargetclobberedNAME{}
2186 attribute is used instead of the \DWATcalltarget{} attribute.
2188 \textit{The expression of a call target clobbered attribute may only be
2189 valid at the time the call or call-like transfer of control is executed.}
2191 The call site entry may have a \DWATtypeDEFN{}\addtoindexx{call type attribute}
2192 \livetargi{chap:DWATtypeofcallsite}{attribute}{type attribute!of call site entry}
2193 referencing a debugging information entry for the type of the called function.
2195 \textit{When \DWATcallorigin{} is present, \DWATtypeNAME{} is usually omitted.}
2197 The call site entry may have
2198 \DWATcallfileDEFN{}\addtoindexx{call file attribute},
2199 \DWATcalllineDEFN{}\addtoindexx{call line attribute} and
2200 \DWATcallcolumnDEFN{}\addtoindexx{call column attribute}
2201 \livetargi{chap:DWATcallfileofcallsite}{attributes,}{call file attribute!of call site entry}
2202 \livetargi{chap:DWATcalllineofcallsite}{}{call line attribute!of call site entry}
2203 \livetargi{chap:DWATcallcolumnofcallsite}{}{call column attribute!of call site entry}
2204 each of whose value is an integer constant.
2205 These attributes represent the source file, source line number, and source
2206 column number, respectively, of the first character of the call statement or
2207 expression. The call file, call line, and call column attributes are
2208 interpreted in the same way as the declaration file, declaration
2209 line, and declaration column attributes, respectively
2210 (see Section \refersec{chap:declarationcoordinates}).
2212 \textit{The call file, call line and call column coordinates do
2213 not describe the coordinates of the subroutine declaration that
2214 was called, rather they describe the coordinates of the call.}
2217 \subsection{Call Site Parameters}
2218 \label{chap:callsiteparameters}
2219 The call site entry may own
2220 \DWTAGcallsiteparameterTARG{}\index{call site parameter entry}
2221 debugging information entries representing the parameters passed
2223 Call site parameter entries occur in the same order as the
2224 corresponding parameters in the source.
2225 Each such entry has a \DWATlocation{} attribute which is a location
2226 description. This location description
2227 describes where the parameter is passed
2228 (usually either some register, or a memory location expressible as
2229 the contents of the stack register plus some offset).
2232 Each \DWTAGcallsiteparameter{} entry may have a
2233 \DWATcallvalueDEFN{}\addtoindexx{call value attribute}
2234 \livetargi{chap:DWATcallvalueofcallparameter}{attribute}{call value attribute}
2235 which is a DWARF expression
2236 which when evaluated yields the value of the parameter at the time of the call.
2238 \textit{If it is not
2239 possible to avoid registers or memory locations that might be clobbered by
2240 the call in the expression, then the \DWATcallvalueNAME{} attribute should
2241 not be provided. The reason for the restriction is that the value of the parameter may be
2242 needed in the midst of the callee, where the call clobbered registers or
2243 memory might be already clobbered, and if the consumer is not assured by
2244 the producer it can safely use those values, the consumer can not safely
2245 use the values at all.}
2247 For parameters passed by reference, where the code passes a pointer to
2248 a location which contains the parameter, or for reference type parameters,
2249 the \DWTAGcallsiteparameter{} entry may also have a
2250 \DWATcalldatalocationDEFN{}\addtoindexx{call data location attribute}
2251 \livetargi{chap:DWATcalldatalocationofcallparameter}{attribute}{call data location attribute}
2252 whose value is a location description and a
2253 \DWATcalldatavalueDEFN{}\addtoindexx{call data value attribute}
2254 \livetargi{chap:DWATcalldatavalueofcallparameter}{attribute}{call data value attribute}
2255 whose value is a DWARF expression. The \DWATcalldatalocationNAME{} attribute
2256 \addtoindexx{call data location attribute}
2257 describes where the referenced value lives during the call. If it is just
2258 \DWOPpushobjectaddress{}, it may be left out. The
2259 \DWATcalldatavalueNAME{} attribute describes the value in that location.
2260 The expression should not use registers or memory
2261 locations that might be clobbered by the call, as it might be evaluated after
2262 virtually unwinding from the called function back to the caller.
2265 Each call site parameter entry may also have a
2266 \DWATcallparameterDEFN{}\addtoindexx{call parameter attribute}
2267 \livetargi{chap:DWATcallparameterofcallparameter}{attribute}{call parameter attribute}
2268 which contains a reference to a \DWTAGformalparameter{} entry,
2269 \DWATtype{} attribute referencing the type of the parameter or
2270 \DWATname{} attribute describing the parameter's name.
2272 \textit{Examples using call site entries and related attributes are
2273 found in Appendix \refersec{app:callsiteexamples}.}
2276 \section{Lexical Block Entries}
2277 \label{chap:lexicalblockentries}
2280 lexical \livetargi{chap:lexicalblock}{block}{lexical block}
2282 \addtoindexx{lexical block}
2283 a bracketed sequence of source statements
2284 that may contain any number of declarations. In some languages
2285 (including \addtoindex{C} and \addtoindex{C++}),
2286 \nolink{blocks} can be nested within other
2287 \nolink{blocks} to any depth.}
2289 % We do not need to link to the preceding paragraph.
2290 A lexical \nolink{block} is represented by a debugging information
2292 tag \DWTAGlexicalblockTARG.
2294 The lexical \livetargi{chap:lexicalblockentry}{block}{lexical block entry}
2296 either a \DWATlowpc{} and
2297 \DWAThighpc{} pair of
2299 \addtoindexx{high PC attribute}
2301 \addtoindexx{low PC attribute}
2303 \DWATranges{} attribute
2304 \addtoindexx{ranges attribute}
2305 whose values encode the contiguous or non-contiguous address
2306 ranges, respectively, of the machine instructions generated
2307 for the lexical \nolink{block}
2308 (see Section \refersec{chap:codeaddressesandranges}).
2310 A\hypertarget{chap:DWATentrypcoflexicalblock}{}
2311 lexical block entry may also have a
2312 \addtoindexx{entry PC attribute!for lexical block}
2313 \DWATentrypc{} attribute
2314 whose value is the address of the first executable instruction
2315 of the lexical block (see
2316 Section \refersec{chap:entryaddress}).
2318 If a name has been given to the lexical \nolink{block}
2319 in the source program, then the corresponding
2320 lexical \nolink{block} entry has a
2321 \DWATname{} attribute whose
2322 \addtoindexx{name attribute}
2323 value is a null-terminated string
2324 containing the name of the lexical \nolink{block}.
2326 \textit{This is not the same as a \addtoindex{C} or
2327 \addtoindex{C++} label (see Section \refersec{chap:labelentries}).}
2329 The lexical \nolink{block} entry owns debugging
2330 information entries that describe the declarations
2331 within that lexical \nolink{block}. There is
2332 one such debugging information entry for each local declaration
2333 of an identifier or inner lexical \nolink{block}.
2336 \section{Label Entries}
2337 \label{chap:labelentries}
2338 \textit{A label is a way of identifying a source location.
2339 A labeled statement is usually the target of one or more
2340 \doublequote{go to} statements.}
2343 A label is represented by a debugging information entry with
2344 \addtoindexx{label entry} the tag \DWTAGlabelTARG.
2345 The entry for a label is owned by
2346 the debugging information entry representing the scope within
2347 which the name of the label could be legally referenced within
2350 The label entry has a \DWATlowpc{} attribute whose value
2351 is the address of the first executable instruction for the
2352 location identified by the label in
2353 the source program. The label entry also has a
2354 \DWATname{} attribute
2355 \addtoindexx{name attribute}
2356 whose value is a null-terminated string containing
2357 the name of the label.
2360 \section{With Statement Entries}
2361 \label{chap:withstatemententries}
2363 \textit{Both \addtoindex{Pascal} and
2364 \addtoindexx{Modula-2}
2365 Modula-2 support the concept of a \doublequote{with}
2366 statement. The with statement specifies a sequence of
2367 executable statements within which the fields of a record
2368 variable may be referenced, unqualified by the name of the
2371 A with statement is represented by a
2372 \addtoindexi{debugging information entry}{with statement entry}
2373 with the tag \DWTAGwithstmtTARG.
2375 A with statement entry may have either a
2377 \DWAThighpc{} pair of attributes
2378 \addtoindexx{low PC attribute}
2379 \addtoindexx{high PC attribute}
2381 \DWATranges{} attribute
2382 \addtoindexx{ranges attribute}
2383 whose values encode the contiguous or non-contiguous address
2384 ranges, respectively, of the machine instructions generated
2385 for the with statement
2386 (see Section \refersec{chap:codeaddressesandranges}).
2388 A\hypertarget{chap:DWATentrypcofwithstmt}{}
2389 with statement entry may also have a
2390 \addtoindexx{entry PC attribute!for with statement}
2391 \DWATentrypc{} attribute
2392 whose value is the address of the first executable instruction
2393 of the with statement (see
2394 Section \refersec{chap:entryaddress}).
2397 The with statement entry has a
2398 \addtoindexx{type attribute}
2399 \DWATtype{} attribute, denoting
2400 the type of record whose fields may be referenced without full
2401 qualification within the body of the statement. It also has
2402 \addtoindexx{location attribute}
2403 a \DWATlocation{} attribute, describing how to find the base
2404 address of the record object referenced within the body of
2408 \section{Try and Catch Block Entries}
2409 \label{chap:tryandcatchblockentries}
2410 \livetarg{chap:tryandcatchblockentries}{}
2411 \textit{In \addtoindex{C++}, a \livelink{chap:lexicalblock}{lexical block} may be
2412 designated as a \doublequote{catch \nolink{block}.}
2413 A catch \nolink{block} is an exception handler that
2414 handles exceptions thrown by an immediately preceding
2415 \doublequote{try \nolink{block}.}
2416 A catch \nolink{block}
2417 designates the type of the exception that it can handle.}
2419 A \livetarg{chap:tryblock}{try block} is represented
2420 by a debugging information entry
2421 \addtoindexx{try block entry}
2422 with the tag \DWTAGtryblockTARG.
2423 A \livetarg{chap:catchblock}{catch block} is represented by
2424 a debugging information entry
2425 \addtoindexx{catch block entry}
2426 with the tag \DWTAGcatchblockTARG.
2428 Both try and catch \nolink{block} entries may have either a
2430 \DWAThighpc{} pair of attributes
2431 \addtoindexx{low PC attribute}
2432 \addtoindexx{high PC attribute}
2434 \DWATranges{} attribute
2435 \addtoindexx{ranges attribute}
2436 whose values encode the contiguous
2437 or non-contiguous address ranges, respectively, of the
2438 machine instructions generated for the \nolink{block}
2439 (see Section \refersec{chap:codeaddressesandranges}).
2441 A\hypertarget{chap:DWATentrypcoftryblock}{}
2442 try or catch\hypertarget{chap:DWATentrypcofcatchblock}{}
2443 block entry may also have a
2444 \addtoindexx{entry PC attribute!for try block}
2445 \addtoindexx{entry PC attribute!for catch block}
2446 \DWATentrypc{} attribute
2447 whose value is the address of the first executable instruction
2448 of the try or catch block
2449 (see Section \refersec{chap:entryaddress}).
2452 Catch \nolink{block} entries have at least one child entry,
2453 an entry representing the type of exception accepted by
2454 that catch \nolink{block}.
2455 This child entry has one of the tags
2456 \DWTAGformalparameter{}\addtoindexx{formal parameter entry!in catch block}
2458 \DWTAGunspecifiedparameters{},
2459 \addtoindexx{unspecified parameters entry!in catch block}
2460 and will have the same form as other parameter entries.
2462 The siblings immediately following a try \nolink{block}
2463 entry are its corresponding catch \nolink{block} entries.
2466 \section{Declarations with Reduced Scope}
2467 \label{declarationswithreducedscope}
2468 \hypertarget{chap:DWATstartscopeofdeclaration}{}
2469 Any debugging information entry for a declaration
2470 (including objects, subprograms, types and modules) whose scope
2471 has an address range that is a subset of the address range for
2472 the lexical scope most closely enclosing the declared entity
2474 \DWATstartscopeDEFN{}\addtoindexx{start scope attribute}
2475 attribute to specify that reduced range of addresses.
2477 There are two cases:
2478 \begin{enumerate}[1. ]
2479 \item If the address range for the scope of the entry
2480 includes all of addresses for the containing scope except
2481 for a contiguous sequence of bytes at the beginning of the
2482 address range for the containing scope, then the address is
2483 specified using a value of class \CLASSconstant.
2485 \begin{enumerate}[a) ]
2486 \item If the address
2487 range of the containing scope is contiguous, the value of
2488 this attribute is the offset in bytes of the beginning of
2489 the address range for the scope of the object from the low
2490 PC value of the debugging information entry that defines
2491 that containing scope.
2492 \item If the address range of the containing
2493 scope is non-contiguous
2494 (see \refersec{chap:noncontiguousaddressranges})
2495 the value of this attribute is the offset in bytes of the
2496 beginning of the address range for the scope of the entity
2497 from the beginning of the first \addtoindex{range list} entry
2498 for the containing scope that is not a base
2499 address entry, a default location
2500 entry or an end-of-list entry.
2504 \item Otherwise, the set of addresses for the scope of the
2505 entity is specified using a value of class \CLASSrnglistsptr{}.
2506 This value indicates the beginning of a \addtoindex{range list}
2507 (see Section \refersec{chap:noncontiguousaddressranges}).
2510 \textit{For example, the scope of a variable may begin somewhere
2511 in the midst of a lexical \livelink{chap:lexicalblock}{block} in a
2512 language that allows executable code in a
2513 \nolink{block} before a variable declaration, or where one declaration
2514 containing initialization code may change the scope of a
2515 subsequent declaration.}
2518 \textit{Consider the following example \addtoindex{C} code:}
2519 \par % Needed to end paragraph before listing so that it gets a line number
2530 \textit{\addtoindex{C} scoping rules require that the value of the
2531 variable \texttt{x} assigned to the variable \texttt{f} in the
2532 initialization sequence is the value of the global variable \texttt{x},
2533 rather than the local \texttt{x}, because the scope of the local variable
2534 \texttt{x} only starts after the full declarator for the local \texttt{x}.}
2536 \textit{Due to optimization, the scope of an object may be
2537 non-contiguous and require use of a \addtoindex{range list} even when
2538 the containing scope is contiguous. Conversely, the scope of
2539 an object may not require its own \addtoindex{range list} even when the
2540 containing scope is non-contiguous.}