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 \textit{A partial compilation unit is not defined for use
86 within a split object file.}
89 \textit{In the remainder of this document, the word
90 \doublequote{compilation} in the phrase \doublequote{compilation unit}
91 is generally omitted, unless it is deemed needed for clarity
94 \subsection{Full and Partial Compilation Unit Entries}
95 \label{chap:fullandpartialcompilationunitentries}
96 A \addtoindex{full compilation unit}\addtoindexx{compilation unit!full}
97 is represented by a debugging information entry with the tag
98 \DWTAGcompileunitTARG.
99 A \addtoindex{partial compilation unit}\addtoindexx{compilation unit!partial}
100 is represented by a debugging information entry with the tag
101 \DWTAGpartialunitTARG.
104 In a simple compilation, a single compilation unit with
106 \DWTAGcompileunit{} represents a complete object file
108 \DWTAGpartialunit{} (as well as tag \DWTAGtypeunit) is not used.
110 employing the DWARF space compression and duplicate elimination
112 Appendix \refersec{app:usingcompilationunits},
113 multiple compilation units using
116 \DWTAGpartialunit{} and/or
118 are used to represent portions of an object file.
121 \textit{A full compilation unit typically represents the text and
122 data contributed to an executable by a single relocatable
123 object file. It may be derived from several source files,
124 including pre-processed header files.
125 A \addtoindex{partial compilation unit} typically represents a part
126 of the text and data of a relocatable object file, in a manner that
127 can potentially be shared with the results of other compilations
128 to save space. It may be derived from an \doublequote{include file,}
129 template instantiation, or other implementation-dependent
130 portion of a compilation. A full compilation unit can also
131 function in a manner similar to a partial compilation unit
133 See Appendix \refersec{app:dwarfcompressionandduplicateeliminationinformative}
134 for discussion of related compression techniques.}
139 compilation unit entry owns debugging information
140 entries that represent all or part of the declarations
141 made in the corresponding compilation. In the case of a
142 partial compilation unit, the containing scope of its owned
143 declarations is indicated by imported unit entries in one
144 or more other compilation unit entries that refer to that
145 partial compilation unit (see
146 Section \refersec{chap:importedunitentries}).
149 A full or partial compilation unit entry
151 may have the following attributes:
152 \begin{enumerate}[1. ]
153 \item Either a \DWATlowpc{} and
154 \DWAThighpc{} pair of
155 \addtoindexx{high PC attribute}
157 \addtoindexx{low PC attribute}
159 \addtoindexx{ranges attribute}
161 \DWATranges{} attribute
162 \addtoindexx{ranges attribute}
164 \addtoindexx{discontiguous address ranges|see{non-contiguous address ranges}}
166 non-contiguous address ranges, respectively,
167 of the machine instructions generated for the compilation
168 unit (see Section \refersec{chap:codeaddressesandranges}).
170 A \DWATlowpc{} attribute
171 may also be specified in combination
172 \addtoindexx{ranges attribute}
174 \DWATranges{} to specify the
175 \addtoindexx{ranges attribute}
176 default base address for use in
177 \addtoindexx{location list}
178 location lists (see Section
179 \refersec{chap:locationlists}) and range lists
180 \addtoindexx{range list}
181 (see Section \refersec{chap:noncontiguousaddressranges}).
183 \item \hypertarget{chap:DWATnamepathnameofcompilationsource}{}
184 A \DWATnameDEFN{} attribute \addtoindexx{name attribute}
185 whose value is a null-terminated string
186 containing the full or relative path name
187 (relative to the value of the \DWATcompdir{} attribute,
188 see below) of the primary
189 source file from which the compilation unit was derived.
191 \item \hypertarget{chap:DWATlanguageprogramminglanguage}{}
192 A \DWATlanguageDEFN{} attribute\addtoindexx{language attribute}
193 whose constant value is an integer code
194 indicating the source language of the compilation
195 unit. The set of language names and their meanings are given
196 in Table \refersec{tab:languagenames}.
201 \setlength{\extrarowheight}{0.1cm}
202 \begin{longtable}{l|l}
203 \caption{Language names} \label{tab:languagenames} \\
204 \hline \bfseries Language name & \bfseries Meaning \\ \hline
206 \bfseries Language name & \bfseries Meaning \\ \hline
208 \hline \emph{Continued on next page}
211 \addtoindexx{ISO-defined language names}
212 \DWLANGAdaeightythreeTARG{} \dag & ISO Ada:1983 \addtoindexx{Ada:1983 (ISO)} \\
213 \DWLANGAdaninetyfiveTARG{} \dag & ISO Ada:1995 \addtoindexx{Ada:1995 (ISO)} \\
215 \DWLANGBLISSTARG & BLISS \addtoindexx{BLISS}
218 \DWLANGCTARG & Non-standardized C, such as K\&R \addtoindexx{C!non-standard} \\*
219 \DWLANGCeightynineTARG & ISO C:1989 \addtoindexx{C:1989 (ISO)} \\*
220 \DWLANGCninetynineTARG & ISO C:1999 \addtoindexx{C:1999 (ISO)} \\*
221 \DWLANGCelevenTARG & ISO C:2011 \addtoindexx{C:2011 (ISO)} \\*
222 \DWLANGCplusplusTARG & ISO C++98 \addtoindexx{C++98 (ISO)} \\
223 \DWLANGCpluspluszerothreeTARG & ISO C++03 \addtoindexx{C++03 (ISO)} \\
224 \DWLANGCpluspluselevenTARG & ISO C++11 \addtoindexx{C++11 (ISO)} \\
225 \DWLANGCplusplusfourteenTARG & ISO C++14 \addtoindexx{C++14 (ISO)}
227 \DWLANGCobolseventyfourTARG & ISO COBOL:1974 \addtoindexx{COBOL:1974 (ISO)} \\
228 \DWLANGCoboleightyfiveTARG & ISO COBOL:1985 \addtoindexx{COBOL:1985 (ISO)} \\
229 \DWLANGDTARG{}~\dag & D \addtoindexx{D language} \\
230 \DWLANGDylanTARG~\dag & Dylan \addtoindexx{Dylan} \\
231 \DWLANGFortranseventysevenTARG & ISO FORTRAN:1977 \addtoindexx{FORTRAN:1977 (ISO)} \\
232 \DWLANGFortranninetyTARG & ISO Fortran:1990 \addtoindexx{Fortran:1990 (ISO)} \\
233 \DWLANGFortranninetyfiveTARG & ISO Fortran:1995 \addtoindexx{Fortran:1995 (ISO)} \\
234 \DWLANGFortranzerothreeTARG & ISO Fortran:2004 \addtoindexx{Fortran:2004 (ISO)} \\
235 \DWLANGFortranzeroeightTARG & ISO Fortran:2010 \addtoindexx{Fortran:2010 (ISO)} \\
236 \DWLANGGoTARG{}~\dag & \addtoindex{Go} \\
237 \DWLANGHaskellTARG{} \dag & \addtoindex{Haskell} \\
238 \DWLANGJavaTARG{} & \addtoindex{Java}\\
239 \DWLANGJuliaTARG{}~\dag & \addtoindex{Julia} \\
240 \DWLANGModulatwoTARG & ISO Modula\dash 2:1996 \addtoindexx{Modula-2:1996 (ISO)} \\
241 \DWLANGModulathreeTARG & \addtoindex{Modula-3} \\
242 \DWLANGObjCTARG{} & \addtoindex{Objective C} \\
243 \DWLANGObjCplusplusTARG{} & \addtoindex{Objective C++} \\
244 \DWLANGOCamlTARG{}~\dag & \addtoindex{OCaml}\index{Objective Caml|see{OCaml}} \\
245 \DWLANGOpenCLTARG{}~\dag & \addtoindex{OpenCL} \\
246 \DWLANGPascaleightythreeTARG & ISO Pascal:1983 \addtoindexx{Pascal:1983 (ISO)} \\
247 \DWLANGPLITARG{}~\dag & ANSI PL/I:1976 \addtoindexx{PL/I:1976 (ANSI)} \\
248 \DWLANGPythonTARG{}~\dag & \addtoindex{Python} \\
249 \DWLANGRenderScriptTARG~\dag &
251 \addtoindex{RenderScript Kernel Language}
254 \DWLANGRustTARG{}~\dag & \addtoindex{Rust} \\
256 & \addtoindex{Swift} \\
257 \DWLANGUPCTARG{} & UPC (Unified Parallel C) \addtoindexx{UPC}
258 \index{Unified Parallel C|see{UPC}} \\
260 \dag \ \ \textit{Support for these languages is limited}& \\
265 \item \hypertarget{chap:DWATstmtlistlinenumberinformationforunit}{}
266 A \DWATstmtlistDEFN{}\addtoindexx{statement list attribute}
267 attribute whose value is a
268 \addtoindexx{section offset!in statement list attribute}
269 section offset to the line number information for this compilation
272 This information is placed in a separate object file
273 section from the debugging information entries themselves. The
274 value of the statement list attribute is the offset in the
275 \dotdebugline{} section of the first byte of the line number
276 information for this compilation unit
277 (see Section \refersec{chap:linenumberinformation}).
279 \item A \DWATmacrosDEFN{}\hypertarget{chap:DWATmacrosmacroinformation}{}
281 \addtoindexx{macro information attribute}
283 \addtoindexx{section offset!in macro information attribute}
284 section offset to the macro information for this compilation unit.
286 This information is placed in a separate object file section
287 from the debugging information entries themselves. The
288 value of the macro information attribute is the offset in
289 the \dotdebugmacro{} section of the first byte of the macro
290 information for this compilation unit
291 (see Section \refersec{chap:macroinformation}).
293 \textit{The \DWATmacrosNAME{} attribute is new in \DWARFVersionV,
295 \DWATmacroinfoDEFN{} attribute of earlier DWARF versions.
296 \livetarg{chap:DWATmacroinfomacroinformation}{}
297 While \DWATmacrosNAME{} and \DWATmacroinfoNAME{} attributes cannot both occur in the same
298 compilation unit, both may be found in the set of units that make up an executable
299 or shared object file. The two attributes have distinct encodings to facilitate such
303 \item \hypertarget{chap:DWATcompdircompilationdirectory}{}
304 A \DWATcompdirDEFN{} attribute\addtoindexx{compilation directory attribute}
306 null-terminated string containing the current working directory
307 of the compilation command that produced this compilation
308 unit in whatever form makes sense for the host system.
310 \item \hypertarget{chap:DWATproducercompileridentification}{}
311 A \DWATproducerDEFN{} attribute\addtoindexx{producer attribute}
312 whose value is a null-terminated string containing
313 information about the compiler that produced the compilation unit.
315 \textit{The actual contents of
316 the string will be specific to each producer, but should
317 begin with the name of the compiler vendor or some other
318 identifying character sequence that will avoid confusion
319 with other producer values.}
322 \item \hypertarget{chap:DWATidentifiercaseidentifiercaserule}{}
323 A \DWATidentifiercaseDEFN{} attribute
324 \addtoindexx{identifier case attribute} whose integer
325 constant value is a code describing the treatment
326 of identifiers within this compilation unit. The
327 set of identifier case codes is given in
328 Table \refersec{tab:identifiercasecodes}.
330 \begin{simplenametable}{Identifier case codes}{tab:identifiercasecodes}
331 \DWIDcasesensitive{} \\
334 \DWIDcaseinsensitive{} \\
335 \end{simplenametable}
337 \DWIDcasesensitiveTARG{} is the default for all compilation units
338 that do not have this attribute. It indicates that names given
339 as the values of \DWATname{} attributes
340 \addtoindexx{name attribute}
341 in debugging information
342 entries for the compilation unit reflect the names as they
343 appear in the source program.
345 \textit{A debugger should be sensitive
346 to the case of \addtoindex{identifier names} when doing identifier
350 \DWIDupcaseTARG{} means that the
351 producer of the debugging
352 information for this compilation unit converted all source
353 names to upper case. The values of the name attributes may not
354 reflect the names as they appear in the source program.
356 \textit{A debugger should convert all names to upper case
359 \DWIDdowncaseTARG{} means that the producer of the debugging
360 information for this compilation unit converted all source
361 names to lower case. The values of the name attributes may not
362 reflect the names as they appear in the source program.
364 \textit{A debugger should convert all names to lower case
368 \DWIDcaseinsensitiveTARG{} means that the values of the name
369 attributes reflect the names as they appear in the source
370 program but that case is not significant.
372 \textit{A debugger should ignore case when doing lookups.}
375 \item \hypertarget{chap:DWATbasetypesprimitivedatatypesofcompilationunit}{}
376 A \DWATbasetypesDEFN{} attribute\addtoindexx{base types attribute}
377 whose value is a \livelink{chap:classreference}{reference}.
378 This attribute points to a debugging information entry
379 representing another compilation unit. It may be used
380 to specify the compilation unit containing the base type
381 entries used by entries in the current compilation unit
382 (see Section \refersec{chap:basetypeentries}).
385 \textit{This attribute provides a consumer a way to find the definition
386 of base types for a compilation unit that does not itself
387 contain such definitions. This allows a consumer, for example,
388 to interpret a type conversion to a base type correctly.}
390 \item \hypertarget{chap:DWATuseUTF8compilationunitusesutf8strings}{}
391 A \DWATuseUTFeightDEFN{} attribute,
392 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
393 which is a \livelink{chap:classflag}{flag} whose
394 presence indicates that all strings (such as the names of
395 declared entities in the source program, or filenames in the line number table)
396 are represented using the UTF-8 representation.
400 \hypertarget{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}{}
401 A \DWATmainsubprogramDEFN{} attribute,\addtoindexx{main subprogram attribute}
402 which is a \livelink{chap:classflag}{flag},
403 whose presence indicates that the compilation unit contains a
404 subprogram that has been identified as the starting
405 subprogram of the program. If more than one compilation unit contains
406 this \nolink{flag}, any one of them may contain the starting
409 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
411 to specify and provide a user-specified name for the main
412 subroutine of a program.
413 \addtoindex{C} uses the name \doublequote{main} to identify
414 the main subprogram of a program. Some other languages provide
415 similar or other means to identify the main subprogram of
416 a program. The \DWATmainsubprogram{} attribute may also be used to
417 identify such subprograms (see
418 Section \refersec{chap:generalsubroutineandentrypointinformation}).}
421 \hypertarget{chap:DWATentrypcofcompileunit}{}
422 \hypertarget{chap:DWATentrypcofpartialunit}{}
423 A \DWATentrypc{} attribute whose value is the address of the first
424 \addtoindexx{entry pc attribute}
425 executable instruction of the unit (see
426 Section \refersec{chap:entryaddress}).
429 \item \hypertarget{chap:DWATstroffsetbaseforindirectstringtable}{}
430 A \DWATstroffsetsbaseDEFN\addtoindexx{string offset base attribute}
431 attribute, whose value is of class \CLASSstroffsetsptr.
432 This attribute points to the first string
433 offset of the compilation unit's contribution to the
434 \dotdebugstroffsets{} (or \dotdebugstroffsetsdwo{}) section.
435 Indirect string references
436 (using \DWFORMstrxXNor) within the compilation unit are
437 interpreted as indices relative to this base.
440 \item \hypertarget{chap:DWATaddrbaseforaddresstable}{}
441 A \DWATaddrbaseDEFN\addtoindexx{address table base attribute}
442 attribute, whose value is of class \CLASSaddrptr.
443 This attribute points to the beginning of the compilation
444 unit's contribution to the \dotdebugaddr{} section.
445 Indirect references (using \DWFORMaddrxXN, \DWOPaddrx,
448 \DWLLEbaseaddressx{}, \DWLLEstartxendx{}, \DWLLEstartxlength{},
449 \DWRLEbaseaddressx{}, \DWRLEstartxendx{} or \DWRLEstartxlength)
451 within the compilation unit are interpreted as indices
452 relative to this base.
455 \item \hypertarget{chap:DWATrnglistsbaseforrnglists}{}
456 A \DWATrnglistsbaseDEFN\addtoindexx{ranges table base attribute}
457 attribute, whose value is of class \CLASSrnglistsptr.
458 This attribute points to the
460 beginning of the offsets table (immediately following the header)
463 unit's contribution to the \dotdebugrnglists{} section.
464 References to range lists (using \DWFORMrnglistx)
465 within the compilation unit are
466 interpreted relative to this base.
468 \item \hypertarget{chap:DWATloclistsbaseinlocationlist}{}
469 A \DWATloclistsbaseDEFN{}\addtoindexx{location table base attribute}
470 attribute, whose value is of class \CLASSloclistsptr.
471 This attribute points to the
473 beginning of the offsets table (immediately following the header)
476 unit's contribution to the \dotdebugloclists{} section. References
477 to location lists (using \DWFORMloclistx) within the compilation
478 unit are interpreted relative to this base.
481 The base address of a compilation unit is defined as the
482 value of the \DWATlowpc{} attribute, if present; otherwise,
483 it is undefined. If the base address is undefined, then any
484 DWARF entry or structure defined in terms of the base address
485 of that compilation unit is not valid.
488 \subsection{Skeleton Compilation Unit Entries}
489 \label{chap:skeletoncompilationunitentries}
490 \addtoindexx{compilation unit!skeleton}
491 \addtoindexx{skeleton compilation unit}
492 When generating a \splitDWARFobjectfile{} (see
493 Section \refersec{datarep:splitdwarfobjectfiles}), the
494 compilation unit in the \dotdebuginfo{} section is a "skeleton"
495 compilation unit with the tag
496 \DWTAGskeletonunitTARG, which contains a
497 \DWATdwoname{} attribute as well as a subset of the
498 attributes of a full or partial compilation unit. In general,
499 it contains those attributes that are necessary for the consumer
500 to locate the object file where the split full compilation unit
501 can be found, and for the consumer to interpret references to
502 addresses in the program.
505 A skeleton compilation unit has no children.
507 A skeleton compilation unit has a \DWATdwoname{} attribute:
509 \begin{enumerate}[1. ]
511 \item \livetarg{chap:DWATdwonameforunit}{}
512 A \DWATdwonameDEFN{} attribute
513 \addtoindexx{split DWARF object file name attribute}
515 null-terminated string containing the full or relative
516 path name (relative to the value of the \DWATcompdir{} attribute,
517 see below) of the object file that contains the full
520 The value in the \HFNdwoid{} field of the unit header for
521 this unit is the same as the value in the \HFNdwoid{} field
522 of the unit header of the corresponding full compilation
523 unit (see Section \refersec{datarep:unitheaders}).
525 \textit{The means of determining a compilation unit ID does
526 not need to be similar or related to the means of
527 determining a \TUsignature. However, it should
528 be suitable for detecting file version skew or other
529 kinds of mismatched files and for looking up a full
530 split unit in a DWARF package file
531 (see Section \refersec{datarep:dwarfpackagefiles}).}
535 A skeleton compilation unit may have additional attributes,
536 which are the same as for conventional compilation unit entries
537 except as noted, from among the following:
538 \begin{enumerate}[1. ]
539 \addtocounter{enumi}{1}
540 \item Either a \DWATlowpc{} and \DWAThighpc{} pair of attributes
541 or a \DWATranges{} attribute.
542 \item A \DWATstmtlist{} attribute.
543 \item A \DWATcompdir{} attribute.
546 \item A \DWATuseUTFeight{} attribute.
548 \textit{This attribute applies to strings referred to by the skeleton
549 compilation unit entry itself, and strings in the associated line
551 The representation for strings in the object file referenced
552 by the \DWATdwoname{} attribute is determined by the presence
553 of a \DWATuseUTFeight{} attribute in the full compilation unit
554 (see Section \refersec{chap:splitfullcompilationunitentries}).}
556 \item A \DWATstroffsetsbase{} attribute, for indirect strings references
557 from the skeleton compilation unit.
558 \item A \DWATaddrbase{} attribute.
562 All other attributes of a compilation unit entry (described
563 in Section \refersec{chap:fullandpartialcompilationunitentries})
564 are placed in the split full compilation unit
565 (see \refersec{chap:splitfullcompilationunitentries}).
566 The attributes provided by the skeleton compilation
567 unit entry do not need to be repeated in the full compilation
570 \textit{The \DWATaddrbase{}
571 and \DWATstroffsetsbase{} attributes provide context that may be
572 necessary to interpret the contents
573 of the corresponding \splitDWARFobjectfile.}
575 \textit{The \DWATbasetypes{} attribute is not defined for a
576 skeleton compilation unit.}
579 \subsection{Split Full Compilation Unit Entries}
580 \label{chap:splitfullcompilationunitentries}
581 A \definition{split full compilation unit} is represented by a
582 debugging information entry with tag \DWTAGcompileunit.
583 It is very similar to a conventional full compilation unit but
584 is logically paired with a specific skeleton compilation unit while
585 being physically separate.
587 A split full compilation unit
588 may have the following attributes,
589 which are the same as for conventional compilation unit entries
591 \begin{enumerate}[1. ]
592 \item A \DWATname{} attribute.
593 \item A \DWATlanguage{} attribute.
594 \item A \DWATmacros{} attribute.
595 The value of this attribute is of class \CLASSmacptr{}, which is
596 an offset relative to the \dotdebugmacrodwo{} section.
598 \item A \DWATproducer{} attribute.
599 \item A \DWATidentifiercase{} attribute.
600 \item A \DWATmainsubprogram{} attribute.
601 \item A \DWATentrypc{} attribute.
602 \item A \DWATuseUTFeight{} attribute.
606 \textit{The following attributes are not part of a
607 split full compilation unit entry but instead are inherited
608 (if present) from the corresponding skeleton compilation unit:
609 \DWATlowpc, \DWAThighpc, \DWATranges, \DWATstmtlist, \DWATcompdir,
610 \DWATstroffsetsbase, \DWATaddrbase{} and
613 \textit{The \DWATbasetypes{} attribute is not defined for a
614 split full compilation unit.}
618 \subsection{Type Unit Entries}
619 \label{chap:typeunitentries}
620 \addtoindexx{type unit}
621 \addtoindexx{type unit|see{\textit{also} compilation unit}}
622 \addtoindexx{compilation unit!\textit{see also} type unit}
623 An object file may contain any number of separate type
624 unit entries, each representing a single complete type
626 Each \addtoindex{type unit} must be uniquely identified by
627 an 8-byte signature, stored as part of the type unit, which
628 can be used to reference the type definition from debugging
629 information entries in other compilation units and type units.
631 Conventional and split type units are identical except for
632 the sections in which they are represented
633 (see \refersec{datarep:splitdwarfobjectfiles} for details).
634 \addtoindexx{conventional type unit}
635 \addtoindexx{split type unit}
636 Moreover, the \DWATstroffsetsbase{} attribute (see below) is not
637 used in a split type unit.
640 A type unit is represented by a debugging information entry
641 with the tag \DWTAGtypeunitTARG.
642 A \addtoindex{type unit entry} owns debugging
643 information entries that represent the definition of a single
644 type, plus additional debugging information entries that may
645 be necessary to include as part of the definition of the type.
648 A type unit entry may have the following attributes:
649 \begin{enumerate}[1. ]
652 \DWATlanguage{} attribute,
654 \addtoindexx{language attribute}
655 constant value is an integer code indicating the source
656 language used to define the type. The set of language names
657 and their meanings are given in Table \refersec{tab:languagenames}.
660 \item A \DWATstmtlist{} attribute\addtoindexx{statement list attribute}
661 whose value of class \CLASSlineptr{} points to the line number
662 information for this type unit.
664 \textit{Because type units do not describe any code, they
665 do not actually need a line number table, but the line number
666 headers contain a list of directories and file names that
667 may be referenced by the \DWATdeclfile{} attribute of the
668 type or part of its description.}
670 \textit{In an object file with a conventional compilation
671 unit entry, the type unit entries may refer to (share) the
672 line number table used by the compilation unit. In a type
673 unit located in a split compilation unit, the
674 \DWATstmtlistNAME{} attribute refers to a \doublequote{specialized}
675 line number table in the \dotdebuglinedwo{} section, which
676 contains only the list of directories and file names.}
678 \textit{All type unit entries in a \splitDWARFobjectfile{} may
679 (but are not required to) refer to the same
680 \addtoindex{specialized line number table}.}
682 \item A \DWATuseUTFeight{} attribute, which is a flag
683 whose presence indicates that all strings referred to by this type
684 unit entry, its children, and its associated
685 \addtoindex{specialized line number table},
686 are represented using the UTF-8 representation.
689 \item A \DWATstroffsetsbase\addtoindexx{string offsets base attribute}
690 attribute, whose value is of class \CLASSstroffsetsptr.
691 This attribute points
692 to the first string offset of the type unit's contribution to
693 the \dotdebugstroffsets{} section. Indirect string references
694 (using \DWFORMstrxXNor) within the type unit are interpreted
695 as indices relative to this base.
699 A \addtoindex{type unit} entry for a given type T owns a debugging
700 information entry that represents a defining declaration
701 of type T. If the type is nested within enclosing types or
702 namespaces, the debugging information entry for T is nested
703 within debugging information entries describing its containers;
704 otherwise, T is a direct child of the type unit entry.
707 A type unit entry may also own additional debugging information
708 entries that represent declarations of additional types that
709 are referenced by type T and have not themselves been placed in
710 separate type units. Like T, if an additional type U is nested
711 within enclosing types or namespaces, the debugging information
712 entry for U is nested within entries describing its containers;
713 otherwise, U is a direct child of the type unit entry.
715 The containing entries for types T and U are declarations,
716 and the outermost containing entry for any given type T or
717 U is a direct child of the type unit entry. The containing
718 entries may be shared among the additional types and between
719 T and the additional types.
721 \textit{Examples of these kinds of relationships are found in
722 Section \refersec{app:signaturecomputationexample} and
723 Section \refersec{app:declarationscompletingnondefiningdeclarations}.}
726 \textit{Types are not required to be placed in type units. In general,
727 only large types such as structure, class, enumeration, and
728 union types included from header files should be considered
729 for separate type units. Base types and other small types
730 are not usually worth the overhead of placement in separate
731 type units. Types that are unlikely to be replicated, such
732 as those defined in the main source file, are also better
733 left in the main compilation unit.}
735 \section{Module, Namespace and Importing Entries}
736 \textit{Modules and namespaces provide a means to collect related
737 entities into a single entity and to manage the names of
741 \subsection{Module Entries}
742 \label{chap:moduleentries}
743 \textit{Several languages have the concept of a \doublequote{module.}
744 \addtoindexx{Modula-2}
745 A Modula\dash 2 definition module
746 \addtoindexx{Modula-2!definition module}
747 may be represented by a module
749 \addtoindex{declaration attribute}
750 (\DWATdeclaration). A
751 \addtoindex{Fortran 90} module
752 \addtoindexx{Fortran!module (Fortran 90)}
753 may also be represented by a module entry
754 (but no declaration attribute is warranted because \addtoindex{Fortran}
755 has no concept of a corresponding module body).}
757 A module is represented by a debugging information entry
759 tag \DWTAGmoduleTARG.
760 Module entries may own other
761 debugging information entries describing program entities
762 whose declaration scopes end at the end of the module itself.
764 If the module has a name, the module entry has a
765 \DWATname{} attribute
766 \addtoindexx{name attribute}
767 whose value is a null\dash terminated string containing
771 The \addtoindex{module entry} may have either a
775 \addtoindexx{high PC attribute}
777 \addtoindexx{low PC attribute}
779 \DWATranges{} attribute
780 \addtoindexx{ranges attribute}
781 whose values encode the contiguous or non-contiguous address
782 ranges, respectively, of the machine instructions generated for
783 the module initialization
784 code\hypertarget{chap:DWATentrypcentryaddressofmoduleinitialization}{}
785 (see Section \refersec{chap:codeaddressesandranges}).
787 \addtoindexx{entry PC attribute!for module initialization}
788 \DWATentrypc{} attribute whose value is the address of
789 the first executable instruction of that initialization code
790 (see Section \refersec{chap:entryaddress}).
793 If\hypertarget{chap:DWATprioritymodulepriority}{}
794 the module has been assigned a priority, it may have a
795 \addtoindexx{priority attribute}
796 \DWATpriorityDEFN{} attribute.
797 The value of this attribute is a
798 reference to another debugging information entry describing
799 a variable with a constant value. The value of this variable
800 is the actual constant value of the module\textquoteright s priority,
801 represented as it would be on the target architecture.
803 \subsection{Namespace Entries}
804 \label{chap:namespaceentries}
805 \textit{\addtoindex{C++} has the notion of a namespace, which provides a way to
806 \addtoindexx{namespace (C++)}
807 implement name hiding, so that names of unrelated things
808 do not accidentally clash in the
809 \addtoindex{global namespace} when an
810 application is linked together.}
812 A namespace is represented by a debugging information entry
813 with the tag \DWTAGnamespaceTARG. A namespace extension
814 is\hypertarget{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}{}
815 represented by a \DWTAGnamespaceNAME{} entry with a
816 \DWATextensionDEFN{}\addtoindexx{extension attribute}
817 attribute referring to the previous extension, or if there
818 is no previous extension, to the original
819 \DWTAGnamespaceNAME{}
820 entry. A namespace extension entry does not need to duplicate
821 information in a previous extension entry of the namespace
822 nor need it duplicate information in the original namespace
823 entry. (Thus, for a namespace with a name,
824 a \DWATname{} attribute
825 \addtoindexx{name attribute}
826 need only be attached directly to the original
827 \DWTAGnamespaceNAME{} entry.)
830 Namespace and namespace extension entries may own
831 \addtoindexx{namespace extension entry}
833 \addtoindexx{namespace declaration entry}
834 debugging information entries describing program entities
835 whose declarations occur in the namespace.
837 A namespace may have a
838 \DWATexportsymbolsDEFN{}\livetarg{chap:DWATexportsymbolsofnamespace}{}
839 attribute\addtoindexx{export symbols attribute}
840 \addtoindexx{inline namespace|see{\textit{also} export symbols attribute}}
841 which is a \CLASSflag{} which
842 indicates that all member names defined within the
843 namespace may be referenced as if they were defined within
844 the containing namespace.
846 \textit{This may be used to describe an \addtoindex{inline namespace} in \addtoindex{C++}}.
848 If a type, variable, or function declared in a namespace is
849 defined outside of the body of the namespace declaration,
850 that type, variable, or function definition entry has a
851 \DWATspecification{} attribute
852 \addtoindexx{specification attribute}
853 whose value is a \livelink{chap:classreference}{reference} to the
854 debugging information entry representing the declaration of
855 the type, variable or function. Type, variable, or function
857 \DWATspecification{} attribute
858 \addtoindexx{specification attribute}
860 to duplicate information provided by the declaration entry
861 referenced by the specification attribute.
863 \textit{The \addtoindex{C++} \addtoindex{global namespace}
865 \addtoindexx{global namespace|see{namespace (C++), global}}
867 \addtoindexx{namespace (C++)!global}
869 \texttt{::f}, for example) is not explicitly represented in
870 DWARF with a namespace entry (thus mirroring the situation
871 in \addtoindex{C++} source).
872 Global items may be simply declared with no
873 reference to a namespace.}
875 \textit{The \addtoindex{C++}
876 compilation unit specific \doublequote{unnamed namespace} may
877 \addtoindexx{namespace (C++)!unnamed}
878 \addtoindexx{unnamed namespace|see {namespace (C++), unnamed}}
879 be represented by a namespace entry with no name attribute in
880 the original namespace declaration entry (and therefore no name
881 attribute in any namespace extension entry of this namespace).
882 C++ states that declarations in the unnamed namespace are
883 implicitly available in the containing scope; a producer
884 should make this effect explicit with the \DWATexportsymbols{}
885 attribute, or by using a \DWTAGimportedmodule{} that is a
886 sibling of the namespace entry and references it.}
888 \textit{A compiler emitting namespace information may choose to
889 explicitly represent namespace extensions, or to represent the
890 final namespace declaration of a compilation unit; this is a
891 quality-of-implementation issue and no specific requirements
892 are given here. If only the final namespace is represented,
893 \addtoindexx{namespace (C++)!using declaration}
894 it is impossible for a debugger to interpret using declaration
895 references in exactly the manner defined by the
896 \addtoindex{C++} language.}
898 \textit{For \addtoindex{C++} namespace examples,
899 see Appendix \refersec{app:namespaceexamples}.}
903 \subsection{Imported (or Renamed) Declaration Entries}
904 \label{chap:importedorrenameddeclarationentries}
906 \textit{Some languages support the concept of importing into or
907 making accessible in a given unit certain declarations that occur
908 in a different module or scope. An imported declaration may
909 sometimes be given another name.}
912 An imported declaration is represented by one or
913 \addtoindexx{imported declaration entry}
914 more debugging information entries with the
915 tag \DWTAGimporteddeclarationTARG.
916 When\hypertarget{chap:DWATimportimporteddeclaration}{}
917 an overloaded entity is imported, there is one imported
918 declaration entry for each overloading.
919 Each imported declaration entry has a
920 \DWATimportDEFN{} attribute,\addtoindexx{import attribute}
921 whose value is a \livelink{chap:classreference}{reference} to the
922 debugging information entry representing the declaration that
925 An imported declaration may also have a \DWATname{}
926 attribute\addtoindexx{name attribute}
927 whose value is a null-terminated string containing the
929 imported entity is to be known in the context of the imported
930 declaration entry (which may be different than the name of
931 the entity being imported). If no name is present, then the
932 name by which the entity is to be known is the same as the
933 name of the entity being imported.
935 An imported declaration entry with a name attribute may be
936 used as a general means to rename or provide an alias for
937 \addtoindexx{alias declaration|see{imported declaration entry}}
938 an entity, regardless of the context in which the importing
939 declaration or the imported entity occurs.
941 \textit{A \addtoindex{C++}
942 namespace alias\hypertarget{chap:DWATimportnamespacealias}{}
943 may be represented by an imported declaration entry
944 \addtoindexx{namespace (C++)!alias}
945 with a name attribute whose value is
946 a null-terminated string containing the alias name
947 and a \DWATimportDEFN{} attribute
948 whose value is a \livelink{chap:classreference}{reference} to the
949 applicable original namespace or namespace extension entry.}
951 \textit{A \addtoindex{C++} using declaration may be represented
953 imported\hypertarget{chap:DWATimportnamespaceusingdeclaration}{}
954 \addtoindexx{namespace (C++)!using declaration}
955 declaration entries. When the using declaration
956 refers to an overloaded function, there is one imported
957 declaration entry corresponding to each overloading. Each
958 imported declaration entry has no name attribute but it does
959 have a \DWATimportDEFN{} attribute that refers to the entry for the
960 entity being imported. (\addtoindex{C++}
961 provides no means to \doublequote{rename}
962 an imported entity, other than a namespace).}
965 \textit{A \addtoindex{Fortran} use statement
966 \addtoindexx{Fortran!use statement}
967 \addtoindexx{use statement|see {Fortran, use statement}}
968 with an \doublequote{only list} may be
969 represented by a series of imported declaration entries,
970 one (or more) for each entity that is imported. An entity
971 \addtoindexx{renamed declaration|see{imported declaration entry}}
972 that is renamed in the importing context may be represented
973 by an imported declaration entry with a name attribute that
974 specifies the new local name.
977 \subsection{Imported Module Entries}
978 \label{chap:importedmoduleentries}
980 \textit{Some languages support the concept of importing into or making
981 accessible in a given unit all of the declarations contained
982 within a separate module or namespace.
985 An imported module declaration is represented by a debugging
986 information entry with
987 \addtoindexx{imported module attribute}
989 \addtoindexx{imported module entry}
990 tag \DWTAGimportedmoduleTARG.
992 imported module entry contains a
993 \DWATimport{} attribute
994 \addtoindexx{import attribute}
995 whose value is a \livelink{chap:classreference}{reference}
996 to the module or namespace entry
997 containing the definition and/or declaration entries for
998 the entities that are to be imported into the context of the
999 imported module entry.
1001 An imported module declaration may own a set of imported
1002 declaration entries, each of which refers to an entry in the
1003 module whose corresponding entity is to be known in the context
1004 of the imported module declaration by a name other than its
1005 name in that module. Any entity in the module that is not
1006 renamed in this way is known in the context of the imported
1007 module entry by the same name as it is declared in the module.
1009 \textit{A \addtoindex{C++} using directive
1010 \addtoindexx{namespace (C++)!using directive}
1011 \addtoindexx{using directive|see {namespace (C++), using directive}}
1012 may be represented by an imported
1013 module\hypertarget{chap:DWATimportnamespaceusingdirective}{}
1014 entry, with a \DWATimportDEFN{} attribute referring to the namespace
1015 entry of the appropriate extension of the namespace (which
1016 might be the original namespace entry) and no owned entries.
1019 \textit{A \addtoindex{Fortran} use statement
1020 \addtoindexx{Fortran!use statement}
1021 with a \doublequote{rename list} may be
1022 represented by an imported module entry with an import
1023 attribute referring to the module and owned entries
1024 corresponding to those entities that are renamed as part of
1028 \textit{A \addtoindex{Fortran} use statement
1029 \addtoindexx{Fortran!use statement}
1030 with neither a \doublequote{rename list} nor
1031 an \doublequote{only list} may be represented by an imported module
1032 entry with an import attribute referring to the module and
1033 no owned child entries.
1036 \textit{A use statement with an \doublequote{only list} is represented by a
1037 series of individual imported declaration entries as described
1038 in Section \refersec{chap:importedorrenameddeclarationentries}.
1042 \textit{A \addtoindex{Fortran} use statement for an entity in a module that is
1043 \addtoindexx{Fortran!use statement}
1044 itself imported by a use statement without an explicit mention
1045 may be represented by an imported declaration entry that refers
1046 to the original debugging information entry. For example, given}
1047 \par % Needed to end paragraph before listing so that it gets a line number
1063 \textit{the imported declaration entry for Q within module C refers
1064 directly to the variable declaration entry for X in module A
1065 because there is no explicit representation for X in module B.
1068 \textit{A similar situation arises for a \addtoindex{C++} using declaration
1069 \addtoindexx{namespace (C++)!using declaration}
1070 \addtoindexx{using declaration|see {namespace (C++), using declaration}}
1071 that imports an entity in terms of a namespace alias. See
1072 Appendix \refersec{app:namespaceexamples}
1076 \subsection{Imported Unit Entries}
1077 \label{chap:importedunitentries}
1078 \hypertarget{chap:DWATimportimportedunit}{}
1079 The place where a normal or partial compilation unit is imported is
1080 represented by a debugging information entry with the
1081 \addtoindexx{imported unit entry}
1082 tag \DWTAGimportedunitTARG.
1083 An imported unit entry contains a
1084 \DWATimportDEFN{} attribute\addtoindexx{import attribute}
1085 whose value is a \livelink{chap:classreference}{reference} to the
1086 normal or partial compilation unit whose declarations logically
1087 belong at the place of the imported unit entry.
1089 \textit{An imported unit entry does not necessarily correspond to
1090 any entity or construct in the source program. It is merely
1091 \doublequote{glue} used to relate a partial unit, or a compilation
1092 unit used as a partial unit, to a place in some other
1095 \section{Subroutine and Entry Point Entries}
1096 \label{chap:subroutineandentrypointentries}
1098 The following tags exist to describe
1099 debugging information entries
1100 \addtoindexx{function entry|see{subroutine entry}}
1102 \addtoindexx{subroutine entry}
1104 \addtoindexx{subprogram entry}
1106 % FIXME: is entry point entry the right index 'entry'?
1107 \addtoindexx{entry point entry}
1111 \begin{tabular}{lp{9.0cm}}
1112 \DWTAGsubprogramTARG{} & A subroutine or function \\
1113 \DWTAGinlinedsubroutine{} & A particular inlined
1114 \addtoindexx{inlined subprogram entry}
1115 instance of a subroutine or function \\
1116 \DWTAGentrypointTARG{} & An alternate entry point \\
1118 \par\condlinenumbers
1121 \subsection{General Subroutine and Entry Point Information}
1122 \label{chap:generalsubroutineandentrypointinformation}
1123 The subroutine or entry point entry has a \DWATname{}
1124 attribute whose value is a null-terminated string containing the
1125 subroutine or entry point name.
1126 It may also have a \DWATlinkagename{} attribute as
1127 described in Section \refersec{chap:linkagenames}.
1129 If the name of the subroutine described by an entry with the
1130 \addtoindexx{subprogram entry}
1131 tag \DWTAGsubprogram{}\hypertarget{chap:DWATexternalexternalsubroutine}{}
1132 is visible outside of its containing
1133 compilation unit, that entry has a
1134 \DWATexternalDEFN{} attribute,\addtoindexx{external attribute}
1135 which is a \livelink{chap:classflag}{flag}.
1137 \textit{Additional attributes for functions that are members of a
1138 class or structure are described in
1139 Section \refersec{chap:memberfunctionentries}.
1142 A\hypertarget{chap:DWATmainsubprogrammainorstartingsubprogram}{}
1143 subroutine entry may contain a
1144 \DWATmainsubprogramDEFN{} attribute
1145 \addtoindexx{main subprogram attribute}
1147 a \CLASSflag{} whose presence indicates that the
1148 subroutine has been identified as the starting function of
1149 the program. If more than one subprogram contains this
1151 any one of them may be the starting subroutine of the program.
1153 \textit{See also Section \refersec{chap:unitentries}) regarding the
1154 related use of this attribute to indicate that a compilation
1155 unit contains the main subroutine of a program.}
1157 \subsubsection{Calling Convention Information}
1158 \hypertarget{chap:DWATcallingconventionforsubprograms}{}
1159 A subroutine entry may contain a
1160 \DWATcallingconventionDEFN{}
1161 \addtoindexx{calling convention attribute!for subprogram}
1162 attribute, whose value is an
1163 \livelink{chap:classconstant}{integer constant}. The set of
1164 \addtoindexi{calling convention codes for subroutines}{calling convention codes!for subroutines}
1165 is given in Table \refersec{tab:callingconventioncodesforsubroutines}.
1167 \begin{simplenametable}[1.4in]{Calling convention codes for subroutines}{tab:callingconventioncodesforsubroutines}
1171 \end{simplenametable}
1173 If this attribute is not present, or its value is the constant
1174 \DWCCnormalTARG, then the subroutine may be safely called by
1175 obeying the \doublequote{standard} calling conventions of the target
1176 architecture. If the value of the calling convention attribute
1177 is the constant \DWCCnocallTARG, the subroutine does not obey
1178 standard calling conventions, and it may not be safe for the
1179 debugger to call this subroutine.
1181 \textit{Note that \DWCCnormal{} is also used as a calling convention
1182 code for certain types
1183 (see Table \refersec{tab:callingconventioncodesfortypes}).}
1185 If the semantics of the language of the compilation unit
1186 containing the subroutine entry distinguishes between ordinary
1187 subroutines and subroutines that can serve as the \doublequote{main
1188 program,} that is, subroutines that cannot be called
1189 directly according to the ordinary calling conventions,
1190 then the debugging information entry for such a subroutine
1191 may have a calling convention attribute whose value is the
1192 constant \DWCCprogramTARG.
1194 \textit{A common debugger feature is to allow the debugger user to call
1195 a subroutine within the subject program. In certain cases,
1196 however, the generated code for a subroutine will not obey
1197 the standard calling conventions for the target architecture
1198 and will therefore not be safe to call from within a debugger.}
1200 \textit{The \DWCCprogram{}
1201 value is intended to support \addtoindex{Fortran} main
1202 \addtoindexx{Fortran!main program}
1203 programs which in some implementations may not be callable
1204 or which must be invoked in a special way. It is not intended
1205 as a way of finding the entry address for the program.}
1208 \subsubsection{Miscellaneous Subprogram Properties}
1209 \textit{In \addtoindex{C}
1210 there is a difference between the types of functions
1211 declared using function prototype style declarations and
1212 those declared using non-prototype declarations.}
1214 A subroutine entry declared with a function prototype style
1215 declaration may have a
1216 \addtoindexx{prototyped attribute}
1217 \DWATprototypedDEFN{} attribute, which is
1219 The attribute indicates whether a subroutine entry point corresponds
1220 to a function declaration that includes parameter prototype information.
1222 A subprogram entry may have
1223 a\hypertarget{chap:DWATelementalelementalpropertyofasubroutine}{}
1224 \DWATelementalDEFN{} attribute,\addtoindexx{elemental attribute}
1225 which is a \livelink{chap:classflag}{flag}.
1226 The attribute indicates whether the subroutine
1227 or entry point was declared with the \doublequote{elemental} keyword
1230 A\hypertarget{chap:DWATpurepurepropertyofasubroutine}{}
1231 subprogram entry may have a
1232 \addtoindexx{pure attribute}
1233 \DWATpureDEFN{} attribute, which is
1234 a \livelink{chap:classflag}{flag}.
1235 The attribute indicates whether the subroutine was
1236 declared with the \doublequote{pure} keyword or property.
1238 A\hypertarget{chap:DWATrecursiverecursivepropertyofasubroutine}{}
1239 subprogram entry may have a
1240 \addtoindexx{recursive attribute}
1241 \DWATrecursiveDEFN{} attribute, which
1242 is a \livelink{chap:classflag}{flag}.
1243 The attribute indicates whether the subroutine
1244 or entry point was declared with the \doublequote{recursive} keyword
1247 A subprogram entry may have a
1249 \livetargi{chap:DWATnoreturnofsubprogram}{attribute}{noreturn attribute},
1250 which is a \CLASSflag. The attribute
1251 indicates whether the subprogram was declared with the \doublequote{noreturn} keyword or property
1252 indicating that the subprogram can be called, but will never return to its caller.
1255 \textit{The \addtoindex{Fortran}
1256 language allows the keywords \texttt{elemental}, \texttt{pure}
1257 and \texttt{recursive} to be included as part of the declaration of
1258 a subroutine; these attributes reflect that usage. These
1259 attributes are not relevant for languages that do not support
1260 similar keywords or syntax. In particular, the \DWATrecursiveNAME{}
1261 attribute is neither needed nor appropriate in languages such
1262 as \addtoindex{C} where functions support recursion by default.}
1265 \subsubsection{Call Site-Related Attributes}
1266 \textit{While subprogram attributes in the previous section provide
1267 information about the subprogram and its entry point(s) as a whole,
1268 the following attributes provide summary information about the calls
1269 that occur within a subprogram.}
1271 A subroutine entry may have \DWATcallalltailcalls,
1272 \DWATcallallcalls{} and/or \DWATcallallsourcecalls{}
1273 attributes, each of which is a \CLASSflag.
1274 \addtoindexx{call site summary information}
1275 \addtoindexx{subroutine call site summary attributes}
1276 These flags indicate the completeness of the call site
1277 information provided by call site entries (see
1278 Section \refersec{chap:callsiteentries}) within the subprogram.
1280 The \DWATcallalltailcallsDEFN{}
1281 \livetargi{chap:DWATcallalltailcallsofasubprogram}{attribute}{all tail calls summary attribute}
1282 indicates that every tail call
1283 that occurs in the code for the subprogram is described by a
1284 \DWTAGcallsite{} entry.
1285 (There may or may not be other non-tail calls to some of the same
1286 target subprograms.)
1288 The \DWATcallallcallsDEFN{}
1289 \livetargi{chap:DWATcallallcallsofasubprogram}{attribute}{all calls summary attribute}
1290 indicates that every non-inlined call
1291 (either a tail call or a normal call) that occurs in the code for the subprogram
1292 is described by a \DWTAGcallsite{} entry.
1294 The \DWATcallallsourcecallsDEFN{}
1295 \livetargi{chap:DWATcallallsourcecallsofasubprogram}{attribute}{all source calls summary attribute}
1296 indicates that every call that occurs in the
1297 code for the subprogram, including every call inlined into it, is described by either a
1298 \DWTAGcallsite{} entry or a \DWTAGinlinedsubroutine{} entry; further, any call
1299 that is optimized out is nonetheless also described using a \DWTAGcallsite{} entry
1300 that has neither a \DWATcallpc{} nor \DWATcallreturnpc{} attribute.
1302 \textit{The \DWATcallallsourcecallsNAME{} attribute is intended for debugging
1303 information format consumers that analyze call graphs.}
1306 If the the \DWATcallallsourcecalls{} attribute is present then the
1307 \DWATcallallcalls{} and \DWATcallalltailcalls{} attributes are
1308 also implicitly present. Similarly, if the
1309 \DWATcallallcalls{} attribute is present then the \DWATcallalltailcalls{}
1310 attribute is implicitly present.
1313 \subsection{Subroutine and Entry Point Return Types}
1314 \label{chap:subroutineandentrypointreturntypes}
1316 If\hypertarget{chap:DWATtypetypeofsubroutinereturn}{}
1317 the subroutine or entry point
1318 \addtoindexx{return type of subroutine}
1319 is a function that returns a
1320 value, then its debugging information entry has
1321 \addtoindexx{type attribute}
1322 a \DWATtypeDEFN{} attribute
1323 to denote the type returned by that function.
1325 \textit{Debugging information entries for
1326 \addtoindex{C} void functions should
1327 not have an attribute for the return type. }
1329 \textit{Debugging information entries for declarations of \addtoindex{C++}
1330 member functions with an
1331 \autoreturntype{} specifier should use an unspecified type entry (see
1332 Section \refersec{chap:unspecifiedtypeentries}).
1333 The debugging information entry for the corresponding definition
1334 should provide the deduced return type. This practice causes the description of
1335 the containing class to be consistent across compilation units, allowing the class
1336 declaration to be placed into a separate type unit if desired.}
1339 \subsection{Subroutine and Entry Point Locations}
1340 \label{chap:subroutineandentrypointlocations}
1342 A subroutine entry may have either a \DWATlowpc{} and
1343 \DWAThighpc{} pair of attributes or a \DWATranges{} attribute
1344 \addtoindexx{ranges attribute}
1346 \addtoindexx{high PC attribute}
1348 \addtoindexx{low PC attribute}
1349 encode the contiguous or non-contiguous address
1350 ranges, respectively, of the machine instructions generated
1351 for the subroutine (see
1352 Section \refersec{chap:codeaddressesandranges}).
1354 A\hypertarget{chap:DWATentrypcentryaddressofsubprogram}{}
1355 subroutine entry may also have a
1356 \addtoindexx{entry PC attribute!for subroutine}
1357 \DWATentrypc{} attribute
1358 whose value is the address of the first executable instruction
1359 of the subroutine (see
1360 Section \refersec{chap:entryaddress}).
1362 An entry point has a \DWATlowpc{} attribute whose value is the
1363 relocated address of the first machine instruction generated
1364 for the entry point.
1367 %\textit{While the \DWATentrypc{} attribute
1368 %\addtoindexx{entry pc attribute!for subroutine}
1369 %might also seem appropriate for this purpose, historically the
1370 %\DWATlowpc{} attribute was used before the
1371 %\DWATentrypc{} was introduced (in
1372 %\addtoindex{DWARF Version 3}).
1373 %There is insufficient reason to change this.}
1375 Subroutines and entry points may also have
1376 \DWATsegment{}\hypertarget{chap:DWATaddressclasssubroutineorsubroutinetype}{}
1377 \addtoindexx{segment attribute} and
1378 \DWATaddressclassDEFN{}\addtoindexx{address class attribute}
1379 attributes, as appropriate, to specify
1380 which segments the code for the subroutine resides in and
1381 the addressing mode to be used in calling that subroutine.
1383 A subroutine entry representing a subroutine declaration
1384 that is not also a definition does not have code address or
1388 \subsection{Declarations Owned by Subroutines and Entry Points}
1389 \label{chap:declarationsownedbysubroutinesandentrypoints}
1390 \addtoindexx{subroutine formal parameters}
1391 The declarations enclosed by a subroutine or entry point are
1392 represented by debugging information entries that are owned
1393 by the subroutine or entry point entry. Entries representing
1394 \addtoindexx{formal parameter}
1395 the formal parameters of the subroutine or entry point appear
1396 in the same order as the corresponding declarations in the
1400 \textit{There is no ordering requirement for entries for declarations
1401 other than formal parameters. The formal parameter
1402 entries may be interspersed with other entries used by formal
1403 parameter entries, such as type entries.}
1405 The unspecified (sometimes called \doublequote{varying})
1406 parameters of a subroutine parameter list are
1407 represented by a debugging information
1408 entry\addtoindexx{unspecified parameters entry}
1409 with the tag \DWTAGunspecifiedparametersTARG.
1412 The entry for a subroutine that includes a
1413 \addtoindex{Fortran}
1414 \addtoindexx{Fortran!common block}
1415 \livelink{chap:fortrancommonblock}{common}
1416 \livelink{chap:commonblockentry}{block}
1417 \addtoindexx{common block|see{Fortran common block}}
1418 has a child entry with the
1419 tag \DWTAGcommoninclusionTARG.
1420 The\hypertarget{chap:commonreferencecommonblockusage}{}
1421 common inclusion entry has a
1422 \DWATcommonreferenceDEFN{} attribute
1423 \addtoindexx{common block reference attribute}
1424 whose value is a \livelink{chap:classreference}{reference}
1425 to the debugging information entry
1426 for the common \nolink{block} being included
1427 (see Section \refersec{chap:commonblockentries}).
1429 \subsection{Low-Level Information}
1430 \label{chap:lowlevelinformation}
1432 A\hypertarget{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}{}
1433 subroutine or entry point entry may have a
1434 \addtoindexx{return address attribute}
1435 \DWATreturnaddrDEFN{}
1436 attribute, whose value is a location description. The location
1437 specified is the place where the return address for the
1438 subroutine or entry point is stored.
1440 A\hypertarget{chap:DWATframebasesubroutineframebaseaddress}{}
1441 subroutine or entry point entry may also have a
1442 \addtoindexx{frame base attribute}
1443 \DWATframebaseDEFN{} attribute, whose value is a location
1444 description that describes the \doublequote{frame base} for the
1445 subroutine or entry point. If the location description is
1446 a simple register location description, the given register
1447 contains the frame base address. If the location description is
1448 a DWARF expression, the result of evaluating that expression
1449 is the frame base address. Finally, for a
1450 \addtoindex{location list},
1451 this interpretation applies to each location description
1452 contained in the list of \addtoindex{location list} entries.
1454 \textit{The use of one of the \DWOPregn{}
1455 operations in this context is equivalent to using
1456 \DWOPbregn(0) but more
1457 compact. However, these are not equivalent in general.}
1460 \textit{The frame base for a subprogram is typically an address
1461 relative to the first unit of storage allocated for the
1462 subprogram\textquoteright s stack frame. The \DWATframebase{} attribute
1463 can be used in several ways:}
1464 \begin{enumerate}[1. ]
1465 \item \textit{In subprograms that need
1466 \addtoindexx{location list}
1467 location lists to locate local
1468 variables, the \DWATframebase{} can hold the needed location
1469 list, while all variables\textquoteright\ location descriptions can be
1470 simpler ones involving the frame base.}
1472 \item \textit{It can be used in resolving \doublequote{up\dash level} addressing
1473 within nested routines.
1474 (See also \DWATstaticlink, below)}
1478 \textit{Some languages support nested subroutines. In such languages,
1479 it is possible to reference the local variables of an
1480 outer subroutine from within an inner subroutine. The
1481 \DWATstaticlink{} and \DWATframebase{} attributes allow
1482 debuggers to support this same kind of referencing.}
1484 If\hypertarget{chap:DWATstaticlinklocationofuplevelframe}{}
1485 a subroutine or entry point is nested, it may have a
1486 \addtoindexx{address!uplevel|see {static link attribute}}
1487 \addtoindexx{uplevel address|see {static link attribute}}
1488 \DWATstaticlinkDEFN{} attribute, whose value is a location
1489 description that computes the frame base of the relevant
1490 instance of the subroutine that immediately encloses the
1491 subroutine or entry point.
1493 In the context of supporting nested subroutines, the
1494 \DWATframebase{} attribute value obeys the following constraints:
1496 \begin{enumerate}[1. ]
1498 It computes a value that does not change during the
1499 life of the subprogram, and
1501 \item The computed value is unique among instances of
1502 the same subroutine.
1504 \textit{For typical \DWATframebase{} use, this
1505 means that a recursive subroutine\textquoteright s stack frame must have
1510 \textit{If a debugger is attempting to resolve an up\dash level reference
1511 to a variable, it uses the nesting structure of DWARF to
1512 determine which subroutine is the lexical parent and the
1513 \DWATstaticlink{} value to identify the appropriate active
1514 frame of the parent. It can then attempt to find the reference
1515 within the context of the parent.}
1519 \subsection{Types Thrown by Exceptions}
1520 \label{chap:typesthrownbyexceptions}
1522 \textit{In \addtoindex{C++} a subroutine may declare a set of types which
1523 it may validly throw.}
1525 If a subroutine explicitly declares that it may throw
1526 \addtoindexx{exception thrown|see{thrown type entry}}
1528 \addtoindexx{thrown exception|see{thrown type entry}}
1529 exception of one or more types, each such type is
1530 represented by a debugging information entry with
1531 \addtoindexx{thrown type entry}
1533 \DWTAGthrowntypeTARG.
1534 Each such entry is a child of the entry
1535 representing the subroutine that may throw this type. Each
1536 thrown type entry contains
1537 \addtoindexx{type attribute}
1538 a \DWATtype{} attribute, whose
1539 value is a \livelink{chap:classreference}{reference}
1540 to an entry describing the type of the
1541 exception that may be thrown.
1543 \subsection{Function Template Instantiations}
1544 \label{chap:functiontemplateinstantiations}
1546 \textit{In \addtoindex{C++}, a function template is a generic definition of
1547 a function that is instantiated differently for calls with
1548 values of different types. DWARF does not represent the generic
1549 template definition, but does represent each instantiation.}
1552 A \addtoindex{function template instantiation}\addtoindexx{template instantiation!function}
1553 is represented by a debugging information entry with the
1554 \addtoindexx{subprogram entry!use for template instantiation}
1555 tag \DWTAGsubprogram.
1557 exceptions, such an entry will contain the same attributes and
1558 will have the same types of child entries as would an entry
1559 for a subroutine defined explicitly using the instantiation
1560 types and values. The exceptions are:
1562 \begin{enumerate}[1. ]
1563 \item Template parameters are described and referenced as specified in
1564 Section \refersec{chap:templateparameters}.
1567 \item If the compiler has generated a separate compilation unit
1568 to hold the template instantiation and that compilation unit
1569 has a different name from the compilation unit containing
1570 the template definition, the name attribute for the debugging
1571 information entry representing that compilation unit is empty
1574 \item If the subprogram entry representing the template
1575 instantiation or any of its child entries contain declaration
1576 coordinate attributes, those attributes refer to the source
1577 for the template definition, not to any source generated
1578 artificially by the compiler for this instantiation.
1583 \subsection{Inlinable and Inlined Subroutines}
1584 \label{chap:inlinedsubroutines}
1585 A declaration or a definition of an inlinable subroutine
1586 is represented by a debugging information entry with the
1587 tag \DWTAGsubprogram.
1588 The entry for a subroutine
1589 \addtoindexx{subprogram entry!use in inlined subprogram}
1590 that is\hypertarget{chap:DWATinlineinlinedsubroutine}{}
1591 explicitly declared to be available for inline expansion or
1592 that was expanded inline implicitly by the compiler has a
1593 \addtoindexx{inline attribute}
1594 \DWATinlineDEFN{} attribute whose value is an
1595 \livelink{chap:classconstant}{integer constant}. The
1596 set of values for the \DWATinline{} attribute is given in
1597 Table \refersec{tab:inlinecodes}.
1601 \caption{Inline codes}
1602 \label{tab:inlinecodes}
1603 \begin{tabular}{l|P{8cm}}
1605 Name&Meaning\\ \hline
1606 \DWINLnotinlinedTARG{} & Not declared inline nor inlined by the
1607 \mbox{compiler} (equivalent to the absence of the
1608 containing \DWATinline{} attribute) \\
1609 \DWINLinlinedTARG{} & Not declared inline but inlined by the \mbox{compiler} \\
1610 \DWINLdeclarednotinlinedTARG{} & Declared inline but
1611 not inlined by the \mbox{compiler} \\
1612 \DWINLdeclaredinlinedTARG{} & Declared inline and inlined by the
1618 \textit{In \addtoindex{C++}, a function or a constructor declared with
1619 \addttindex{constexpr} is implicitly declared inline. The abstract
1620 instance (see Section \refersec{chap:abstractinstances})
1621 is represented by a debugging information
1622 entry with the tag \DWTAGsubprogram. Such an entry has a
1623 \DWATinline{} attribute whose value is \DWINLinlined.}
1626 \subsubsection{Abstract Instances}
1627 \label{chap:abstractinstances}
1628 Any subroutine entry that contains a
1629 \DWATinlineDEFN{} attribute\addtoindexx{inline attribute}
1630 whose value is other than
1632 is known as an \definition{abstract instance root}.
1633 \addtoindexx{abstract instance!root}
1634 \hypertarget{chap:DWATinlineabstracttinstance}{}
1635 Any debugging information entry that is owned (either
1636 directly or indirectly) by an abstract instance root
1638 \definition{abstract instance entry.}\addtoindexx{abstract instance!entry}
1639 Any set of abstract instance entries that are all
1640 children (either directly or indirectly) of some abstract
1641 instance root, together with the root itself, is known as an
1642 \definition{abstract instance tree.}\addtoindexx{abstract instance!tree}
1643 However, in the case where an abstract instance tree is
1644 nested within another abstract instance tree, the entries in the
1645 \addtoindex{nested abstract instance}
1646 tree are not considered to be entries in the outer abstract
1650 Each abstract instance root is either part of a larger
1651 \addtoindexx{abstract instance!root}
1652 tree (which gives a context for the root) or
1653 \addtoindexx{specification attribute}
1655 \DWATspecification{}
1656 to refer to the declaration in context.
1658 \textit{For example, in \addtoindex{C++} the context might be a namespace
1659 declaration or a class declaration.}
1661 \textit{Abstract instance trees are defined so that no entry is part
1662 of more than one abstract instance tree.}
1664 Attributes and children in an abstract instance are shared
1665 by all concrete instances (see Section \refersec{chap:concreteinstances}).
1667 A debugging information entry that is a member of an abstract
1668 instance tree may not contain any attributes which describe
1669 aspects of the subroutine which vary between distinct inlined
1670 expansions or distinct out-of-line expansions.
1672 \textit{For example,
1673 \addtoindexx{entry pc attribute!and abstract instance}
1674 the \DWATlowpc,\addtoindexx{low PC attribute!and abstract instance}
1675 \DWAThighpc,\addtoindexx{high PC attribute!and abstract instance}
1676 \DWATranges,\addtoindexx{ranges attribute!and abstract instance}
1677 \DWATentrypc,\addtoindexx{entry PC attribute!and abstract instance}
1678 \DWATlocation,\addtoindexx{location attribute!and abstract instance}
1679 \DWATreturnaddr,\addtoindexx{return address attribute!and abstract instance}
1680 \DWATstartscope,\addtoindexx{start scope attribute!and abstract instance}
1682 \DWATsegment{}\addtoindexx{segment attribute!and abstract instance}
1683 attributes typically should be omitted; however, this list is not
1687 \textit{It would not make sense normally to put these attributes into
1688 abstract instance entries since such entries do not represent
1689 actual (concrete) instances and thus do not actually exist at
1690 run\dash time. However,
1691 see Appendix \refersec{app:inlineouteronenormalinner}
1692 for a contrary example.}
1694 The rules for the relative location of entries belonging to
1695 abstract instance trees are exactly the same as for other
1696 similar types of entries that are not abstract. Specifically,
1697 the rule that requires that an entry representing a declaration
1698 be a direct child of the entry representing the scope of the
1699 declaration applies equally to both abstract and non-abstract
1700 entries. Also, the ordering rules for formal parameter entries,
1701 member entries, and so on, all apply regardless of whether
1702 or not a given entry is abstract.
1705 \subsubsection{Concrete Instances}
1706 \label{chap:concreteinstances}
1708 Each inline expansion of a subroutine is represented
1709 by a debugging information entry with the
1710 tag \DWTAGinlinedsubroutineTARG. Each such entry is a direct
1711 child of the entry that represents the scope within which
1712 the inlining occurs.
1715 Each inlined subroutine entry may have either a
1717 and \DWAThighpc{} pair of attributes
1718 \addtoindexx{high PC attribute}
1719 \addtoindexx{low PC attribute}
1720 or a \DWATranges{}\addtoindexx{ranges attribute}
1721 attribute whose values encode the contiguous or non-contiguous
1722 address ranges, respectively, of the machine instructions
1723 generated for the inlined subroutine (see
1724 Section \referfol{chap:codeaddressesandranges}).
1725 An\hypertarget{chap:DWATentrypcentryaddressofinlinedsubprogram}{}
1726 inlined subroutine entry may
1727 \addtoindexx{inlined subprogram entry!in concrete instance}
1729 \addtoindexx{inlined subprogram entry}
1731 \addtoindexx{entry PC attribute!for inlined subprogram}
1734 attribute, representing the first executable instruction of
1735 the inline expansion (see
1736 Section \refersec{chap:entryaddress}).
1738 % Positions of the 3 targets here is a bit arbitrary.
1739 An inlined\hypertarget{chap:DWATcalllinelinenumberofinlinedsubroutinecall}{}
1740 subroutine\hypertarget{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}{}
1741 entry\hypertarget{chap:DWATcallfilefilecontaininginlinedsubroutinecall}{}
1742 may also have \DWATcallfileDEFN,
1743 \DWATcalllineDEFN{} and \DWATcallcolumnDEFN{} attributes,
1744 \addtoindexx{inlined call location attributes}
1746 value is an \livelink{chap:classconstant}{integer constant}.
1747 These attributes represent the
1748 source file, source line number, and source column number,
1749 respectively, of the first character of the statement or
1750 expression that caused the inline expansion. The call file,
1751 call line, and call column attributes are interpreted in
1752 the same way as the declaration file, declaration line, and
1753 declaration column attributes, respectively (see
1754 Section \refersec{chap:declarationcoordinates}).
1756 \textit{The call file, call line and call column coordinates do not
1757 describe the coordinates of the subroutine declaration that
1758 was inlined, rather they describe the coordinates of the call.
1761 An inlined subroutine entry may have
1762 a\hypertarget{chap:DWATconstexprcompiletimeconstantfunction}{}
1763 \DWATconstexprDEFN{} attribute,\addtoindexx{constant expression attribute}
1764 which is a \livelink{chap:classflag}{flag}
1765 whose presence indicates that the
1766 subroutine has been evaluated as a compile\dash time constant. Such
1767 an entry may also have a \DWATconstvalue{} attribute,
1768 whose value may be of any form that is appropriate for the
1769 representation of the subroutine's return value. The value of
1770 this attribute is the actual return value of the subroutine,
1771 represented as it would be on the target architecture.
1773 \textit{In \addtoindex{C++}, if a function or a constructor declared with
1774 \addttindex{constexpr}
1775 is called with constant expressions, then the corresponding
1776 concrete inlined instance has a
1777 \DWATconstexpr{} attribute,
1778 as well as a \DWATconstvalue{} attribute whose value represents
1779 the actual return value of the concrete inlined instance.}
1782 Any debugging information entry that is owned (either
1783 directly or indirectly) by a debugging information entry
1784 with the tag \DWTAGinlinedsubroutine{} is referred to as a
1785 \doublequote{concrete inlined instance entry.} Any entry that has
1787 \DWTAGinlinedsubroutine{}
1788 is known as a \doublequote{concrete inlined instance root.}
1789 Any set of concrete inlined instance
1790 entries that are all children (either directly or indirectly)
1791 of some concrete inlined instance root, together with the root
1792 itself, is known as a \doublequote{concrete inlined instance tree.}
1793 However, in the case where a concrete inlined instance tree
1794 is nested within another concrete instance tree, the entries
1795 in the \addtoindex{nested concrete inline instance} tree
1796 are not considered to
1797 be entries in the outer concrete instance tree.
1800 \textit{Concrete inlined instance trees are defined so that no entry
1801 is part of more than one concrete inlined instance tree. This
1802 simplifies later descriptions.}
1804 Each concrete inlined instance tree is uniquely associated
1805 with one (and only one) abstract instance tree.
1807 \textit{Note, however, that the reverse is not true. Any given abstract
1808 instance tree may be associated with several different concrete
1809 inlined instance trees, or may even be associated with zero
1810 concrete inlined instance trees.}
1812 Concrete inlined instance entries may omit attributes that
1813 are not specific to the concrete instance (but present in
1814 the abstract instance) and need include only attributes that
1815 are specific to the concrete instance (but omitted in the
1816 abstract instance). In place of these omitted attributes,
1817 each\hypertarget{chap:DWATabstractorigininlineinstance}{}
1818 concrete inlined instance entry has a
1819 \addtoindexx{abstract origin attribute}
1820 \DWATabstractoriginDEFN{}
1821 attribute that may be used to obtain the missing information
1822 (indirectly) from the associated abstract instance entry. The
1823 value of the abstract origin attribute is a reference to the
1824 associated abstract instance entry.
1826 If an entry within a concrete inlined instance tree contains
1827 attributes describing the
1828 \addtoindexx{declaration coordinates!in concrete instance}
1829 \livelink{chap:declarationcoordinates}{declaration coordinates}
1830 of that entry, then those attributes refer to the file, line
1831 and column of the original declaration of the subroutine,
1832 not to the point at which it was inlined. As a consequence,
1833 they may usually be omitted from any entry that has an abstract
1837 For each pair of entries that are associated via a
1838 \addtoindexx{abstract origin attribute}
1839 \DWATabstractorigin{} attribute, both members of the pair
1840 have the same tag. So, for example, an entry with the tag
1841 \DWTAGvariable{} can only be associated with another entry
1842 that also has the tag \DWTAGvariable. The only exception
1843 to this rule is that the root of a concrete instance tree
1844 (which must always have the tag \DWTAGinlinedsubroutine)
1845 can only be associated with the root of its associated abstract
1846 instance tree (which must have the tag \DWTAGsubprogram).
1849 In general, the structure and content of any given concrete
1850 inlined instance tree will be closely analogous to the
1851 structure and content of its associated abstract instance
1852 tree. There are a few exceptions:
1854 \begin{enumerate}[1. ]
1855 \item An entry in the concrete instance tree may be omitted if
1857 \addtoindexx{abstract origin attribute}
1858 \DWATabstractorigin{} attribute and either
1859 has no children, or its children are omitted. Such entries
1860 would provide no useful information. In C\dash like languages,
1861 such entries frequently include types, including structure,
1862 union, class, and interface types; and members of types. If any
1863 entry within a concrete inlined instance tree needs to refer
1864 to an entity declared within the scope of the relevant inlined
1865 subroutine and for which no concrete instance entry exists,
1866 the reference refers to the abstract instance entry.
1869 \item Entries in the concrete instance tree which are associated
1870 with entries in the abstract instance tree such that neither
1871 has a \DWATname{} attribute,
1872 \addtoindexx{name attribute}
1873 and neither is referenced by
1874 any other debugging information entry, may be omitted. This
1875 may happen for debugging information entries in the abstract
1876 instance trees that became unnecessary in the concrete instance
1877 tree because of additional information available there. For
1878 example, an anonymous variable might have been created and
1879 described in the abstract instance tree, but because of
1880 the actual parameters for a particular inlined expansion,
1881 it could be described as a constant value without the need
1882 for that separate debugging information entry.
1885 \item A concrete instance tree may contain entries which do
1886 not correspond to entries in the abstract instance tree
1887 to describe new entities that are specific to a particular
1888 inlined expansion. In that case, they will not have associated
1889 entries in the abstract instance tree, do not contain
1890 \addtoindexx{abstract origin attribute}
1891 \DWATabstractorigin{} attributes, and must contain all their
1892 own attributes directly. This allows an abstract instance tree
1893 to omit debugging information entries for anonymous entities
1894 that are unlikely to be needed in most inlined expansions. In
1895 any expansion which deviates from that expectation, the
1896 entries can be described in its concrete inlined instance tree.
1900 \subsubsection{Out-of-Line Instances of Inlined Subroutines}
1901 \label{chap:outoflineinstancesofinlinedsubroutines}
1902 Under some conditions, compilers may need to generate concrete
1903 executable instances of inlined subroutines other than at
1904 points where those subroutines are actually called. Such
1905 concrete instances of inlined subroutines are referred to as
1906 \doublequote{concrete out\dash of\dash line instances.}
1908 \textit{In \addtoindex{C++}, for example,
1909 taking the address of a function declared
1910 to be inline can necessitate the generation of a concrete
1911 out\dash of\dash line instance of the given function.}
1913 The DWARF representation of a concrete out-of-line instance
1914 of an inlined subroutine is essentially the same as for a
1915 concrete inlined instance of that subroutine (as described in
1916 the preceding section). The representation of such a concrete
1917 % It is critical that the hypertarget and livelink be
1918 % separated to avoid problems with latex.
1920 \addtoindexx{abstract origin attribute}
1922 \hypertarget{chap:DWATabstractoriginoutoflineinstance}{}
1924 \DWATabstractoriginDEFN{}
1925 attributes in exactly the same way as they are used for
1926 a concrete inlined instance (that is, as references to
1927 corresponding entries within the associated abstract instance
1930 The differences between the DWARF representation of a
1931 concrete out\dash of\dash line instance of a given subroutine and the
1932 representation of a concrete inlined instance of that same
1933 subroutine are as follows:
1934 \begin{enumerate}[1. ]
1935 \item The root entry for a concrete out\dash of\dash line instance
1936 of a given inlined subroutine has the same tag as does its
1937 associated (abstract) inlined subroutine entry (that is, tag
1938 \DWTAGsubprogram{} rather than \DWTAGinlinedsubroutine).
1940 \item The root entry for a concrete out\dash of\dash line instance tree
1941 is normally owned by the same parent entry that also owns
1942 the root entry of the associated abstract instance. However,
1943 it is not required that the abstract and out\dash of\dash line instance
1944 trees be owned by the same parent entry.
1948 \subsubsection{Nested Inlined Subroutines}
1949 \label{nestedinlinedsubroutines}
1950 Some languages and compilers may permit the logical nesting of
1951 a subroutine within another subroutine, and may permit either
1952 the outer or the nested subroutine, or both, to be inlined.
1954 For a non-inlined subroutine nested within an inlined
1955 subroutine, the nested subroutine is described normally in
1956 both the abstract and concrete inlined instance trees for
1957 the outer subroutine. All rules pertaining to the abstract
1958 and concrete instance trees for the outer subroutine apply
1959 also to the abstract and concrete instance entries for the
1963 For an inlined subroutine nested within another inlined
1964 subroutine, the following rules apply to their abstract and
1965 \addtoindexx{abstract instance!nested}
1966 \addtoindexx{concrete instance!nested}
1967 concrete instance trees:
1969 \begin{enumerate}[1. ]
1970 \item The abstract instance tree for the nested subroutine is
1971 described within the abstract instance tree for the outer
1972 subroutine according to the rules in
1973 Section \refersec{chap:abstractinstances}, and
1974 without regard to the fact that it is within an outer abstract
1977 \item Any abstract instance tree for a nested subroutine is
1978 always omitted within the concrete instance tree for an
1981 \item A concrete instance tree for a nested subroutine is
1982 always omitted within the abstract instance tree for an
1985 \item The concrete instance tree for any inlined or
1986 \addtoindexx{out-of-line instance}
1988 \addtoindexx{out-of-line instance|see{\textit{also} concrete out-of-line instance}}
1989 expansion of the nested subroutine is described within a
1990 concrete instance tree for the outer subroutine according
1992 Sections \refersec{chap:concreteinstances} or
1993 \referfol{chap:outoflineinstancesofinlinedsubroutines}
1995 and without regard to the fact that it is within an outer
1996 concrete instance tree.
1999 \textit{See Appendix \refersec{app:inliningexamples}
2000 for discussion and examples.}
2002 \subsection{Trampolines}
2003 \label{chap:trampolines}
2005 \textit{A trampoline is a compiler\dash generated subroutine that serves
2006 as\hypertarget{chap:DWATtrampolinetargetsubroutine}{}
2007 an intermediary in making a call to another subroutine. It may
2008 adjust parameters and/or the result (if any) as appropriate
2009 to the combined calling and called execution contexts.}
2011 A trampoline is represented by a debugging information entry
2012 \addtoindexx{trampoline (subprogram) entry}
2013 with the tag \DWTAGsubprogram{} or \DWTAGinlinedsubroutine{}
2015 \addtoindexx{trampoline attribute}
2016 a \DWATtrampolineDEFN{} attribute.
2018 attribute indicates the target subroutine of the trampoline,
2019 that is, the subroutine to which the trampoline passes
2020 control. (A trampoline entry may but need not also have a
2021 \DWATartificial{} attribute.)
2024 The value of the trampoline attribute may be represented
2025 using any of the following forms:
2028 \item If the value is of class \CLASSreference{}, then the value
2029 specifies the debugging information entry of the target
2032 \item If the value is of class \CLASSaddress{}, then the value is
2033 the relocated address of the target subprogram.
2036 \item If the value is of class \CLASSstring{}, then the value is the
2037 (possibly mangled) \addtoindexx{mangled names}
2038 name of the target subprogram.
2040 \item If the value is of class \CLASSflag, then the value true
2041 indicates that the containing subroutine is a trampoline but
2042 that the target subroutine is not known.
2046 The target subprogram may itself be a trampoline. (A sequence
2047 of trampolines necessarily ends with a non-trampoline
2050 \textit{In \addtoindex{C++}, trampolines may be used to implement
2051 derived virtual member functions; such trampolines typically
2053 \texttt{this} parameter\index{this parameter@\texttt{this} parameter}
2054 in the course of passing control.
2055 Other languages and environments may use trampolines in a manner
2056 sometimes known as transfer functions or transfer vectors.}
2058 \textit{Trampolines may sometimes pass control to the target
2059 subprogram using a branch or jump instruction instead of a
2060 call instruction, thereby leaving no trace of their existence
2061 in the subsequent execution context. }
2063 \textit{This attribute helps make it feasible for a debugger to arrange
2064 that stepping into a trampoline or setting a breakpoint in
2065 a trampoline will result in stepping into or setting the
2066 breakpoint in the target subroutine instead. This helps to
2067 hide the compiler generated subprogram from the user. }
2069 \section{Call Site Entries and Parameters}
2070 \label{chap:callsiteentriesandparameters}
2072 A call site entry describes a call from one subprogram to another in the
2073 source program. It provides information about the actual parameters of
2074 the call so that they may be more easily accessed by a debugger. When
2075 used together with call frame information
2076 (see Section \refersec{chap:callframeinformation}),
2077 call site entries can be useful for computing the value of an actual parameter
2078 passed by a caller, even when the location description for the callee's
2079 corresponding formal parameter does not provide a current location for
2080 the formal parameter.}
2082 \textit{The DWARF expression for computing the value of an actual parameter at
2083 a call site may refer to registers or memory locations. The expression
2084 assumes these contain the values they would have at the point where the
2085 call is executed. After the called subprogram has been entered, these
2086 registers and memory locations might have been modified. In order to
2087 recover the values that existed at the point of the call (to allow
2088 evaluation of the DWARF expression for the actual parameter), a debugger
2089 may virtually unwind the subprogram activation
2090 (see Section \refersec{chap:callframeinformation}). Any
2091 register or memory location that cannot be recovered is referred to as
2092 "clobbered by the call."}
2094 A source call can be compiled into different types of machine code:
2097 A \textit{normal call} uses a call-like instruction which transfers
2098 control to the start of some subprogram and preserves the call site
2099 location for use by the callee.
2102 A \textit{tail call} uses a jump-like instruction which
2103 transfers control to the start of some subprogram, but
2104 there is no call site location address to preserve
2105 (and thus none is available using the
2106 virtual unwind information).
2109 A \textit{tail recursion call} is a call
2110 to the current subroutine which is compiled as a jump
2111 to the current subroutine.
2115 An \textit{inline (or inlined) call} is a call to an inlined subprogram,
2116 where at least one instruction has the location of the inlined subprogram
2117 or any of its blocks or inlined subprograms.
2121 There are also different types of \doublequote{optimized out} calls:
2124 An \textit{optimized out (normal) call} is a call that is in unreachable code that
2125 has not been emitted (such as, for example, the call to \texttt{foo} in
2126 \texttt{if (0) foo();}).
2128 An \textit{optimized out inline call}
2129 is a call to an inlined subprogram which either did not expand to any instructions
2130 or only parts of instructions belong to it and for debug information purposes those
2131 instructions are given a location in the caller.
2134 \DWTAGcallsite{} entries describe normal and tail calls but not tail recursion calls,
2135 while \DWTAGinlinedsubroutine{} entries describe inlined calls
2136 (see Section \refersec{chap:inlinedsubroutines}).
2137 Call site entries cannot describe tail recursion or optimized out calls.
2139 \subsection{Call Site Entries}
2140 \label{chap:callsiteentries}
2141 A call site is represented by a debugging information entry with the tag
2142 \DWTAGcallsiteTARG{}\addtoindexx{call site entry}.
2143 The entry for a call site is owned by the innermost
2144 debugging information entry representing the scope within which the
2145 call is present in the source program.
2148 \textit{A scope entry (for example, a lexical block) that would not
2149 otherwise be present in the debugging information of a subroutine
2150 need not be introduced solely to represent the immediately containing scope
2153 The call site entry may have a
2154 \DWATcallreturnpcDEFN{}\addtoindexx{call site return pc attribute}
2155 \livetargi{chap:DWATcallreturnpcofcallsite}{attribute}{call return pc attribute}
2156 which is the return address after the call.
2157 The value of this attribute corresponds to the return address
2158 computed by call frame information in the called subprogram
2159 (see Section \refersec{datarep:callframeinformation}).
2161 \textit{On many architectures the return address is the
2162 address immediately following the call instruction, but
2163 on architectures with delay slots it might
2164 be an address after the delay slot of the call.}
2166 The call site entry may have a
2167 \DWATcallpcDEFN{}\addtoindexx{call pc attribute}
2168 \livetargi{chap:DWATcallpcofcallsite}{attribute}{call pc attribute}
2169 which is the address of the
2170 call-like instruction for a normal call or the jump-like
2171 instruction for a tail call.
2173 If the call site entry corresponds to a tail call, it has the
2174 \DWATcalltailcallDEFN{}\addtoindexx{call tail call attribute}
2175 \livetargi{chap:DWATcalltailcallofcallsite}{attribute}{call tail call attribute},
2176 which is a \CLASSflag.
2178 The call site entry may have a
2179 \DWATcalloriginDEFN{}\addtoindexx{call origin attribute}
2180 \livetargi{chap:DWATcalloriginofcallsite}{attribute}{call origin attribute}
2181 which is a \CLASSreference. For direct calls or jumps where the called
2182 subprogram is known it is a reference to the called subprogram's debugging
2183 information entry. For indirect calls it may be a reference to a
2184 \DWTAGvariable{}, \DWTAGformalparameter{} or \DWTAGmember{} entry representing
2185 the subroutine pointer that is called.
2188 The call site may have a
2189 \DWATcalltargetDEFN{}\addtoindexx{call target attribute}
2190 \livetargi{chap:DWATcalltargetofcallsite}{attribute}{call target attribute} which is
2191 a DWARF expression. For indirect calls or jumps where it is unknown at
2192 compile time which subprogram will be called the expression computes the
2193 address of the subprogram that will be called.
2195 \textit{The DWARF expression should
2196 not use register or memory locations that might be clobbered by the call.}
2199 The call site entry may have a
2200 \DWATcalltargetclobberedDEFN{}\addtoindexx{call target clobbered attribute}
2201 \livetargi{chap:DWATcalltargetclobberedofcallsite}{attribute}{call target clobbered attribute}
2202 which is a DWARF expression. For indirect calls or jumps where the
2203 address is not computable without use of registers or memory locations that
2204 might be clobbered by the call the \DWATcalltargetclobberedNAME{}
2205 attribute is used instead of the \DWATcalltarget{} attribute.
2207 \textit{The expression of a call target clobbered attribute may only be
2208 valid at the time the call or call-like transfer of control is executed.}
2210 The call site entry may have a \DWATtypeDEFN{}\addtoindexx{call type attribute}
2211 \livetargi{chap:DWATtypeofcallsite}{attribute}{type attribute!of call site entry}
2212 referencing a debugging information entry for the type of the called function.
2214 \textit{When \DWATcallorigin{} is present, \DWATtypeNAME{} is usually omitted.}
2216 The call site entry may have
2217 \DWATcallfileDEFN{}\addtoindexx{call file attribute},
2218 \DWATcalllineDEFN{}\addtoindexx{call line attribute} and
2219 \DWATcallcolumnDEFN{}\addtoindexx{call column attribute}
2220 \livetargi{chap:DWATcallfileofcallsite}{attributes,}{call file attribute!of call site entry}
2221 \livetargi{chap:DWATcalllineofcallsite}{}{call line attribute!of call site entry}
2222 \livetargi{chap:DWATcallcolumnofcallsite}{}{call column attribute!of call site entry}
2223 each of whose value is an integer constant.
2224 These attributes represent the source file, source line number, and source
2225 column number, respectively, of the first character of the call statement or
2226 expression. The call file, call line, and call column attributes are
2227 interpreted in the same way as the declaration file, declaration
2228 line, and declaration column attributes, respectively
2229 (see Section \refersec{chap:declarationcoordinates}).
2231 \textit{The call file, call line and call column coordinates do
2232 not describe the coordinates of the subroutine declaration that
2233 was called, rather they describe the coordinates of the call.}
2236 \subsection{Call Site Parameters}
2237 \label{chap:callsiteparameters}
2238 The call site entry may own
2239 \DWTAGcallsiteparameterTARG{}\index{call site parameter entry}
2240 debugging information entries representing the parameters passed
2242 Call site parameter entries occur in the same order as the
2243 corresponding parameters in the source.
2244 Each such entry has a \DWATlocation{} attribute which is a location
2245 description. This location description
2246 describes where the parameter is passed
2247 (usually either some register, or a memory location expressible as
2248 the contents of the stack register plus some offset).
2251 Each \DWTAGcallsiteparameter{} entry may have a
2252 \DWATcallvalueDEFN{}\addtoindexx{call value attribute}
2253 \livetargi{chap:DWATcallvalueofcallparameter}{attribute}{call value attribute}
2254 which is a DWARF expression
2255 which when evaluated yields the value of the parameter at the time of the call.
2257 \textit{If it is not
2258 possible to avoid registers or memory locations that might be clobbered by
2259 the call in the expression, then the \DWATcallvalueNAME{} attribute should
2260 not be provided. The reason for the restriction is that the value of the parameter may be
2261 needed in the midst of the callee, where the call clobbered registers or
2262 memory might be already clobbered, and if the consumer is not assured by
2263 the producer it can safely use those values, the consumer can not safely
2264 use the values at all.}
2266 For parameters passed by reference, where the code passes a pointer to
2267 a location which contains the parameter, or for reference type parameters,
2268 the \DWTAGcallsiteparameter{} entry may also have a
2269 \DWATcalldatalocationDEFN{}\addtoindexx{call data location attribute}
2270 \livetargi{chap:DWATcalldatalocationofcallparameter}{attribute}{call data location attribute}
2271 whose value is a location description and a
2272 \DWATcalldatavalueDEFN{}\addtoindexx{call data value attribute}
2273 \livetargi{chap:DWATcalldatavalueofcallparameter}{attribute}{call data value attribute}
2274 whose value is a DWARF expression. The \DWATcalldatalocationNAME{} attribute
2275 \addtoindexx{call data location attribute}
2276 describes where the referenced value lives during the call. If it is just
2277 \DWOPpushobjectaddress{}, it may be left out. The
2278 \DWATcalldatavalueNAME{} attribute describes the value in that location.
2279 The expression should not use registers or memory
2280 locations that might be clobbered by the call, as it might be evaluated after
2281 virtually unwinding from the called function back to the caller.
2284 Each call site parameter entry may also have a
2285 \DWATcallparameterDEFN{}\addtoindexx{call parameter attribute}
2286 \livetargi{chap:DWATcallparameterofcallparameter}{attribute}{call parameter attribute}
2287 which contains a reference to a \DWTAGformalparameter{} entry,
2288 \DWATtype{} attribute referencing the type of the parameter or
2289 \DWATname{} attribute describing the parameter's name.
2291 \textit{Examples using call site entries and related attributes are
2292 found in Appendix \refersec{app:callsiteexamples}.}
2295 \section{Lexical Block Entries}
2296 \label{chap:lexicalblockentries}
2299 lexical \livetargi{chap:lexicalblock}{block}{lexical block}
2301 \addtoindexx{lexical block}
2302 a bracketed sequence of source statements
2303 that may contain any number of declarations. In some languages
2304 (including \addtoindex{C} and \addtoindex{C++}),
2305 \nolink{blocks} can be nested within other
2306 \nolink{blocks} to any depth.}
2308 % We do not need to link to the preceding paragraph.
2309 A lexical \nolink{block} is represented by a debugging information
2311 tag \DWTAGlexicalblockTARG.
2313 The lexical \livetargi{chap:lexicalblockentry}{block}{lexical block entry}
2315 either a \DWATlowpc{} and
2316 \DWAThighpc{} pair of
2318 \addtoindexx{high PC attribute}
2320 \addtoindexx{low PC attribute}
2322 \DWATranges{} attribute
2323 \addtoindexx{ranges attribute}
2324 whose values encode the contiguous or non-contiguous address
2325 ranges, respectively, of the machine instructions generated
2326 for the lexical \nolink{block}
2327 (see Section \refersec{chap:codeaddressesandranges}).
2329 A\hypertarget{chap:DWATentrypcoflexicalblock}{}
2330 lexical block entry may also have a
2331 \addtoindexx{entry PC attribute!for lexical block}
2332 \DWATentrypc{} attribute
2333 whose value is the address of the first executable instruction
2334 of the lexical block (see
2335 Section \refersec{chap:entryaddress}).
2337 If a name has been given to the lexical \nolink{block}
2338 in the source program, then the corresponding
2339 lexical \nolink{block} entry has a
2340 \DWATname{} attribute whose
2341 \addtoindexx{name attribute}
2342 value is a null-terminated string
2343 containing the name of the lexical \nolink{block}.
2345 \textit{This is not the same as a \addtoindex{C} or
2346 \addtoindex{C++} label (see Section \refersec{chap:labelentries}).}
2348 The lexical \nolink{block} entry owns debugging
2349 information entries that describe the declarations
2350 within that lexical \nolink{block}. There is
2351 one such debugging information entry for each local declaration
2352 of an identifier or inner lexical \nolink{block}.
2355 \section{Label Entries}
2356 \label{chap:labelentries}
2357 \textit{A label is a way of identifying a source location.
2358 A labeled statement is usually the target of one or more
2359 \doublequote{go to} statements.}
2362 A label is represented by a debugging information entry with
2363 \addtoindexx{label entry} the tag \DWTAGlabelTARG.
2364 The entry for a label is owned by
2365 the debugging information entry representing the scope within
2366 which the name of the label could be legally referenced within
2369 The label entry has a \DWATlowpc{} attribute whose value
2370 is the address of the first executable instruction for the
2371 location identified by the label in
2372 the source program. The label entry also has a
2373 \DWATname{} attribute
2374 \addtoindexx{name attribute}
2375 whose value is a null-terminated string containing
2376 the name of the label.
2379 \section{With Statement Entries}
2380 \label{chap:withstatemententries}
2382 \textit{Both \addtoindex{Pascal} and
2383 \addtoindexx{Modula-2}
2384 Modula-2 support the concept of a \doublequote{with}
2385 statement. The with statement specifies a sequence of
2386 executable statements within which the fields of a record
2387 variable may be referenced, unqualified by the name of the
2390 A with statement is represented by a
2391 \addtoindexi{debugging information entry}{with statement entry}
2392 with the tag \DWTAGwithstmtTARG.
2394 A with statement entry may have either a
2396 \DWAThighpc{} pair of attributes
2397 \addtoindexx{low PC attribute}
2398 \addtoindexx{high PC attribute}
2400 \DWATranges{} attribute
2401 \addtoindexx{ranges attribute}
2402 whose values encode the contiguous or non-contiguous address
2403 ranges, respectively, of the machine instructions generated
2404 for the with statement
2405 (see Section \refersec{chap:codeaddressesandranges}).
2407 A\hypertarget{chap:DWATentrypcofwithstmt}{}
2408 with statement entry may also have a
2409 \addtoindexx{entry PC attribute!for with statement}
2410 \DWATentrypc{} attribute
2411 whose value is the address of the first executable instruction
2412 of the with statement (see
2413 Section \refersec{chap:entryaddress}).
2416 The with statement entry has a
2417 \addtoindexx{type attribute}
2418 \DWATtype{} attribute, denoting
2419 the type of record whose fields may be referenced without full
2420 qualification within the body of the statement. It also has
2421 \addtoindexx{location attribute}
2422 a \DWATlocation{} attribute, describing how to find the base
2423 address of the record object referenced within the body of
2427 \section{Try and Catch Block Entries}
2428 \label{chap:tryandcatchblockentries}
2429 \livetarg{chap:tryandcatchblockentries}{}
2430 \textit{In \addtoindex{C++}, a \livelink{chap:lexicalblock}{lexical block} may be
2431 designated as a \doublequote{catch \nolink{block}.}
2432 A catch \nolink{block} is an exception handler that
2433 handles exceptions thrown by an immediately preceding
2434 \doublequote{try \nolink{block}.}
2435 A catch \nolink{block}
2436 designates the type of the exception that it can handle.}
2438 A \livetarg{chap:tryblock}{try block} is represented
2439 by a debugging information entry
2440 \addtoindexx{try block entry}
2441 with the tag \DWTAGtryblockTARG.
2442 A \livetarg{chap:catchblock}{catch block} is represented by
2443 a debugging information entry
2444 \addtoindexx{catch block entry}
2445 with the tag \DWTAGcatchblockTARG.
2447 Both try and catch \nolink{block} entries may have either a
2449 \DWAThighpc{} pair of attributes
2450 \addtoindexx{low PC attribute}
2451 \addtoindexx{high PC attribute}
2453 \DWATranges{} attribute
2454 \addtoindexx{ranges attribute}
2455 whose values encode the contiguous
2456 or non-contiguous address ranges, respectively, of the
2457 machine instructions generated for the \nolink{block}
2458 (see Section \refersec{chap:codeaddressesandranges}).
2460 A\hypertarget{chap:DWATentrypcoftryblock}{}
2461 try or catch\hypertarget{chap:DWATentrypcofcatchblock}{}
2462 block entry may also have a
2463 \addtoindexx{entry PC attribute!for try block}
2464 \addtoindexx{entry PC attribute!for catch block}
2465 \DWATentrypc{} attribute
2466 whose value is the address of the first executable instruction
2467 of the try or catch block
2468 (see Section \refersec{chap:entryaddress}).
2471 Catch \nolink{block} entries have at least one child entry,
2472 an entry representing the type of exception accepted by
2473 that catch \nolink{block}.
2474 This child entry has one of the tags
2475 \DWTAGformalparameter{}\addtoindexx{formal parameter entry!in catch block}
2477 \DWTAGunspecifiedparameters{},
2478 \addtoindexx{unspecified parameters entry!in catch block}
2479 and will have the same form as other parameter entries.
2481 The siblings immediately following a try \nolink{block}
2482 entry are its corresponding catch \nolink{block} entries.
2485 \section{Declarations with Reduced Scope}
2486 \label{declarationswithreducedscope}
2487 \hypertarget{chap:DWATstartscopeofdeclaration}{}
2488 Any debugging information entry for a declaration
2489 (including objects, subprograms, types and modules) whose scope
2490 has an address range that is a subset of the address range for
2491 the lexical scope most closely enclosing the declared entity
2493 \DWATstartscopeDEFN{}\addtoindexx{start scope attribute}
2494 attribute to specify that reduced range of addresses.
2496 There are two cases:
2497 \begin{enumerate}[1. ]
2498 \item If the address range for the scope of the entry
2499 includes all of addresses for the containing scope except
2500 for a contiguous sequence of bytes at the beginning of the
2501 address range for the containing scope, then the address is
2502 specified using a value of class \CLASSconstant.
2504 \begin{enumerate}[a) ]
2505 \item If the address
2506 range of the containing scope is contiguous, the value of
2507 this attribute is the offset in bytes of the beginning of
2508 the address range for the scope of the object from the low
2509 PC value of the debugging information entry that defines
2510 that containing scope.
2511 \item If the address range of the containing
2512 scope is non-contiguous
2513 (see \refersec{chap:noncontiguousaddressranges})
2514 the value of this attribute is the offset in bytes of the
2515 beginning of the address range for the scope of the entity
2516 from the beginning of the first \addtoindex{range list} entry
2517 for the containing scope that is not a base
2518 address entry, a default location
2519 entry or an end-of-list entry.
2523 \item Otherwise, the set of addresses for the scope of the
2524 entity is specified using a value of class \CLASSrnglistsptr{}.
2525 This value indicates the beginning of a \addtoindex{range list}
2526 (see Section \refersec{chap:noncontiguousaddressranges}).
2529 \textit{For example, the scope of a variable may begin somewhere
2530 in the midst of a lexical \livelink{chap:lexicalblock}{block} in a
2531 language that allows executable code in a
2532 \nolink{block} before a variable declaration, or where one declaration
2533 containing initialization code may change the scope of a
2534 subsequent declaration.}
2537 \textit{Consider the following example \addtoindex{C} code:}
2538 \par % Needed to end paragraph before listing so that it gets a line number
2549 \textit{\addtoindex{C} scoping rules require that the value of the
2550 variable \texttt{x} assigned to the variable \texttt{f} in the
2551 initialization sequence is the value of the global variable \texttt{x},
2552 rather than the local \texttt{x}, because the scope of the local variable
2553 \texttt{x} only starts after the full declarator for the local \texttt{x}.}
2555 \textit{Due to optimization, the scope of an object may be
2556 non-contiguous and require use of a \addtoindex{range list} even when
2557 the containing scope is contiguous. Conversely, the scope of
2558 an object may not require its own \addtoindex{range list} even when the
2559 containing scope is non-contiguous.}