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:separatetypeunitentries}),
7 these entries may be thought of
8 as bounded by ranges of text addresses within the program.
10 \section{Unit Entries}
11 An object file may contain one or more compilation units,
13 \addtoindexx{unit|see {compilation unit, partial unit \textit{or} type unit}}
14 \addtoindexx{compilation unit}
16 \addtoindexx{normal compilation unit}
17 \addtoindexx{normal compilation unit|see {compilation unit}}
18 normal compilation units,
19 partial compilation units and
20 \addtoindexx{type unit}
22 \addtoindex{partial compilation unit}
23 is related to one or more other compilation units that
25 \addtoindex{type unit} represents
26 a single complete type in a
27 separate unit. Either a normal compilation unit or a
28 \addtoindex{partial compilation unit}
29 may be logically incorporated into another
30 compilation unit using an
31 \addtoindex{imported unit entry}.
33 \subsection[Normal and Partial CU Entries]{Normal and Partial Compilation Unit Entries}
34 \label{chap:normalandpartialcompilationunitentries}
36 A \addtoindex{normal compilation unit} is represented by a debugging
37 information entry with the
38 tag \livetarg{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit}.
39 A \addtoindex{partial compilation unit} is represented by a debugging information
41 tag \livetarg{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit}.
43 In a simple normal compilation, a single compilation unit with
45 \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit} represents a complete object file
47 \livelink{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit} is not used.
49 employing the DWARF space compression and duplicate elimination
51 Appendix \refersec{app:usingcompilationunits},
52 multiple compilation units using
54 \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit} and/or
55 \livelink{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit} are
56 used to represent portions of an object file.
58 \textit{A normal compilation unit typically represents the text and
59 data contributed to an executable by a single relocatable
60 object file. It may be derived from several source files,
61 including pre\dash processed ``include files.''
62 A \addtoindex{partial compilation unit} typically represents a part of the text
63 and data of a relocatable object file, in a manner that can
64 potentially be shared with the results of other compilations
65 to save space. It may be derived from an ``include file'',
66 template instantiation, or other implementation\dash dependent
67 portion of a compilation. A normal compilation unit can also
68 function in a manner similar to a partial compilation unit
71 A compilation unit entry owns debugging information
72 entries that represent all or part of the declarations
73 made in the corresponding compilation. In the case of a
74 partial compilation unit, the containing scope of its owned
75 declarations is indicated by imported unit entries in one
76 or more other compilation unit entries that refer to that
77 partial compilation unit (see
78 Section \refersec{chap:importedunitentries}).
81 Compilation unit entries may have the following
84 \item Either a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
85 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of
86 \addtoindexx{high PC attribute}
88 \addtoindexx{low PC attribute}
90 \addtoindexx{ranges attribute}
92 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
93 \addtoindexx{ranges attribute}
95 \addtoindexx{discontiguous address ranges|see{non-contiguous address ranges}}
98 non\dash contiguous address ranges, respectively,
99 of the machine instructions generated for the compilation
100 unit (see Section \refersec{chap:codeaddressesandranges}).
102 A \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute
106 \addtoindexx{ranges attribute}
108 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} to specify the
109 \addtoindexx{ranges attribute}
110 default base address for use in
111 \addtoindexx{location list}
112 location lists (see Section
113 \refersec{chap:locationlists}) and range lists
114 \addtoindexx{range list}
115 (see Section \refersec{chap:noncontiguousaddressranges}).
117 \item A \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
118 \addtoindexx{name attribute}
119 whose value is a null\dash terminated
121 \hypertarget{chap:DWATnamepathnameofcompilationsource}
122 containing the full or relative path name of the primary
123 source file from which the compilation unit was derived.
125 \item A \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language} attribute
126 \addtoindexx{language attribute}
127 whose constant value is an
128 \hypertarget{chap:DWATlanguageprogramminglanguage}
130 \addtoindexx{language attribute}
131 indicating the source language of the compilation
132 unit. The set of language names and their meanings are given
133 in Table \refersec{tab:languagenames}.
137 \caption{Language names}
138 \label{tab:languagenames}
141 Language name & Meaning\\ \hline
142 \livetarg{chap:DWLANGAda83}{DW\-\_LANG\-\_Ada83} \dag&ISO \addtoindex{Ada}:1983 \addtoindexx{Ada} \\
143 \livetarg{chap:DWLANGAda95}{DW\-\_LANG\-\_Ada95} \dag&ISO Ada:1995 \addtoindexx{Ada} \\
144 \livetarg{chap:DWLANGC}{DW\-\_LANG\-\_C}&Non-standardized C, such as K\&R \\
145 \livetarg{chap:DWLANGC89}{DW\-\_LANG\-\_C89}&ISO C:1989 \\
146 \livetarg{chap:DWLANGC99}{DW\-\_LANG\-\_C99} & ISO \addtoindex{C}:1999 \\
147 \livetarg{chap:DWLANGCplusplus}{DW\-\_LANG\-\_C\-\_plus\-\_plus}&ISO \addtoindex{C++}:1998 \\
148 \livetarg{chap:DWLANGCobol74}{DW\-\_LANG\-\_Cobol74}& ISO \addtoindex{Cobol}:1974 \\
149 \livetarg{chap:DWLANGCobol85}{DW\-\_LANG\-\_Cobol85} & ISO \addtoindex{Cobol}:1985 \\
150 \livetarg{chap:DWLANGD}{DW\-\_LANG\-\_D} \dag & D \addtoindexx{D language} \\
151 \livetarg{chap:DWLANGFortran77}{DW\-\_LANG\-\_Fortran77} &ISO \addtoindex{FORTRAN} 77\\
152 \livetarg{chap:DWLANGFortran90}{DW\-\_LANG\-\_Fortran90} & ISO \addtoindex{Fortran 90}\\
153 \livetarg{chap:DWLANGFortran95}{DW\-\_LANG\-\_Fortran95} & ISO \addtoindex{Fortran 95}\\
154 \livetarg{chap:DWLANGJava}{DW\-\_LANG\-\_Java} & \addtoindex{Java}\\
155 \livetarg{chap:DWLANGModula2}{DW\-\_LANG\-\_Modula2} & ISO Modula\dash 2:1996 \addtoindexx{Modula-2}\\
156 \livetarg{chap:DWLANGObjC}{DW\-\_LANG\-\_ObjC} & \addtoindex{Objective C}\\
157 \livetarg{chap:DWLANGObjCplusplus}{DW\-\_LANG\-\_ObjC\-\_plus\-\_plus} & \addtoindex{Objective C++}\\
158 \livetarg{chap:DWLANGPascal83}{DW\-\_LANG\-\_Pascal83} & ISO \addtoindex{Pascal}:1983\\
159 \livetarg{chap:DWLANGPLI}{DW\-\_LANG\-\_PLI} \dag & ANSI \addtoindex{PL/I}:1976\\
160 \livetarg{chap:DWLANGPython}{DW\-\_LANG\-\_Python} \dag & \addtoindex{Python}\\
161 \livetarg{chap:DWLANGUPC}{DW\-\_LANG\-\_UPC} &\addtoindex{Unified Parallel C}\addtoindexx{UPC}\\ \hline
162 \dag \ \ \textit{Support for these languages is limited.}& \\
166 \item A \livelink{chap:DWATstmtlist}{DW\-\_AT\-\_stmt\-\_list}
167 attribute whose value is
168 \addtoindexx{statement list attribute}
170 \addtoindexx{section offset!in statement list attribute}
172 \hypertarget{chap:DWATstmtlistlinenumberinformationforunit}
173 offset to the line number information for this compilation
176 This information is placed in a separate object file
177 section from the debugging information entries themselves. The
178 value of the statement list attribute is the offset in the
179 \addtoindex{.debug\_line} section of the first byte of the line number
180 information for this compilation unit
181 (see Section \refersec{chap:linenumberinformation}).
183 \item A \livelink{chap:DWATmacroinfo}{DW\-\_AT\-\_macro\-\_info} attribute
184 \addtoindex{macro information attribute}
186 \addtoindexx{section offset!in macro information attribute}
188 \hypertarget{chap:DWATmacroinfomacroinformation}
189 offset to the macro information for this compilation unit.
190 This information is placed in a separate object file section
191 from the debugging information entries themselves. The
192 value of the macro information attribute is the offset in
193 the \addtoindex{.debug\_macinfo} section of the first byte of the macro
194 information for this compilation unit
195 (see Section \refersec{chap:macroinformation}).
198 \livelink{chap:DWATcompdir}{DW\-\_AT\-\_comp\-\_dir}
200 \hypertarget{chap:DWATcompdircompilationdirectory}
202 null\dash terminated string containing the current working directory
203 of the compilation command that produced this compilation
204 unit in whatever form makes sense for the host system.
206 \item A \livelink{chap:DWATproducer}{DW\-\_AT\-\_producer} attribute
207 \addtoindexx{producer attribute}
208 whose value is a null\dash
209 terminated string containing information about the compiler
210 \hypertarget{chap:DWATproducercompileridentification}
211 that produced the compilation unit. The actual contents of
212 the string will be specific to each producer, but should
213 begin with the name of the compiler vendor or some other
214 identifying character sequence that should avoid confusion
215 with other producer values.
218 \item A \livelink{chap:DWATidentifiercase}{DW\-\_AT\-\_identifier\-\_case}
220 \addtoindexx{identifier case attribute}
222 \hypertarget{chap:DWATidentifiercaseidentifiercaserule}
223 constant value is a code describing the treatment
224 of identifiers within this compilation unit. The
225 set of identifier case codes is given in
226 Table \refersec{tab:identifiercasecodes}.
228 \begin{simplenametable}{Identifier case codes}{tab:identifiercasecodes}
229 \livelink{chap:DWIDcasesensitive}{DW\-\_ID\-\_case\-\_sensitive} \\
230 \livelink{chap:DWIDupcase}{DW\-\_ID\-\_up\-\_case} \\
231 \livelink{chap:DWIDdowncase}{DW\-\_ID\-\_down\-\_case} \\
232 \livelink{chap:DWIDcaseinsensitive}{DW\-\_ID\-\_case\-\_insensitive} \\
233 \end{simplenametable}
235 \livetarg{chap:DWIDcasesensitive}{DW\-\_ID\-\_case\-\_sensitive} is the default for all compilation units
236 that do not have this attribute. It indicates that names given
237 as the values of \livelink{chap:DWATname}{DW\-\_AT\-\_name} attributes
238 \addtoindexx{name attribute}
239 in debugging information
240 entries for the compilation unit reflect the names as they
241 appear in the source program. The debugger should be sensitive
242 to the case of identifier names when doing identifier lookups.
244 \livetarg{chap:DWIDupcase}{DW\-\_ID\-\_up\-\_case} means that the
245 producer of the debugging
246 information for this compilation unit converted all source
247 names to upper case. The values of the name attributes may not
248 reflect the names as they appear in the source program. The
249 debugger should convert all names to upper case when doing
252 \livetarg{chap:DWIDdowncase}{DW\-\_ID\-\_down\-\_case} means that
253 the producer of the debugging
254 information for this compilation unit converted all source
255 names to lower case. The values of the name attributes may not
256 reflect the names as they appear in the source program. The
257 debugger should convert all names to lower case when doing
260 \livetarg{chap:DWIDcaseinsensitive}{DW\-\_ID\-\_case\-\_insensitive} means that the values of the name
261 attributes reflect the names as they appear in the source
262 program but that a case insensitive lookup should be used to
265 \item A \livelink{chap:DWATbasetypes}{DW\-\_AT\-\_base\-\_types} attribute whose value is a reference.
269 \hypertarget{chap:DWATbasetypesprimitivedatatypesofcompilationunit}
271 \addtoindexx{base types attribute}
272 points to a debugging information entry
273 representing another compilation unit. It may be used
274 to specify the compilation unit containing the base type
275 entries used by entries in the current compilation unit
276 (see Section \refersec{chap:basetypeentries}).
278 This attribute provides a consumer a way to find the definition
279 of base types for a compilation unit that does not itself
280 contain such definitions. This allows a consumer, for example,
281 to interpret a type conversion to a base type
282 % getting this link target at the right spot is tricky.
283 \hypertarget{chap:DWATuseUTF8compilationunitusesutf8strings}
286 \item A \livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8} attribute,
287 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
288 which is a \livelink{chap:flag}{flag} whose
289 presence indicates that all strings (such as the names of
290 declared entities in the source program) are represented
291 using the UTF\dash 8 representation
292 (see Section \refersec{datarep:attributeencodings}).
295 \item A \livelink{chap:DWATmainsubprogram}{DW\-\_AT\-\_main\-\_subprogram} attribute, which is a \livelink{chap:flag}{flag}
296 \addtoindexx{main subprogram attribute}
297 whose presence indicates
298 \hypertarget{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}
299 that the compilation unit contains a
300 subprogram that has been identified as the starting function
301 of the program. If more than one compilation unit contains
302 this \nolink{flag}, any one of them may contain the starting function.
304 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
306 to specify and provide a user\dash specified name for the main
307 subroutine of a program.
308 \addtoindex{C} uses the name “main” to identify
309 the main subprogram of a program. Some other languages provide
310 similar or other means to identify the main subprogram of
315 The base address of a compilation unit is defined as the
316 value of the \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute, if present; otherwise,
317 it is undefined. If the base address is undefined, then any
318 DWARF entry or structure defined in terms of the base address
319 of that compilation unit is not valid.
322 \subsection{Imported Unit Entries}
323 \label{chap:importedunitentries}
325 \hypertarget{chap:DWATimportimportedunit}
326 place where a normal or partial unit is imported is
327 represented by a debugging information entry with the
328 \addtoindexx{imported unit entry}
329 tag \livetarg{chap:DWTAGimportedunit}{DW\-\_TAG\-\_imported\-\_unit}.
330 An imported unit entry contains
331 \addtoindexx{import attribute}
333 \livelink{chap:DWATimport}{DW\-\_AT\-\_import} attribute
334 whose value is a reference to the
335 normal or partial compilation unit whose declarations logically
336 belong at the place of the imported unit entry.
338 \textit{An imported unit entry does not necessarily correspond to
339 any entity or construct in the source program. It is merely
340 “glue” used to relate a partial unit, or a compilation
341 unit used as a partial unit, to a place in some other
344 \subsection{Separate Type Unit Entries}
345 \label{chap:separatetypeunitentries}
346 An object file may contain any number of separate type
347 unit entries, each representing a single complete type
349 Each \addtoindex{type unit} must be uniquely identified by
350 a 64\dash bit signature, stored as part of the type unit, which
351 can be used to reference the type definition from debugging
352 information entries in other compilation units and type units.
354 A type unit is represented by a debugging information entry
355 with the tag \livetarg{chap:DWTAGtypeunit}{DW\-\_TAG\-\_type\-\_unit}.
356 A \addtoindex{type unit entry} owns debugging
357 information entries that represent the definition of a single
358 type, plus additional debugging information entries that may
359 be necessary to include as part of the definition of the type.
361 A type unit entry may have a
362 \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language} attribute,
364 \addtoindexx{language attribute}
365 constant value is an integer code indicating the source
366 language used to define the type. The set of language names
367 and their meanings are given in Table \refersec{tab:languagenames}.
369 A \addtoindex{type unit} entry for a given type T owns a debugging
370 information entry that represents a defining declaration
371 of type T. If the type is nested within enclosing types or
372 namespaces, the debugging information entry for T is nested
373 within debugging information entries describing its containers;
374 otherwise, T is a direct child of the type unit entry.
376 A type unit entry may also own additional debugging information
377 entries that represent declarations of additional types that
378 are referenced by type T and have not themselves been placed in
379 separate type units. Like T, if an additional type U is nested
380 within enclosing types or namespaces, the debugging information
381 entry for U is nested within entries describing its containers;
382 otherwise, U is a direct child of the type unit entry.
384 The containing entries for types T and U are declarations,
385 and the outermost containing entry for any given type T or
386 U is a direct child of the type unit entry. The containing
387 entries may be shared among the additional types and between
388 T and the additional types.
390 \textit{Types are not required to be placed in type units. In general,
391 only large types such as structure, class, enumeration, and
392 union types included from header files should be considered
393 for separate type units. Base types and other small types
394 are not usually worth the overhead of placement in separate
395 type units. Types that are unlikely to be replicated, such
396 as those defined in the main source file, are also better
397 left in the main compilation unit.}
399 \section{Module, Namespace and Importing Entries}
400 \textit{Modules and namespaces provide a means to collect related
401 entities into a single entity and to manage the names of
404 \subsection{Module Entries}
405 \label{chap:moduleentries}
406 \textit{Several languages have the concept of a ``module.''
407 \addtoindexx{Modula-2}
408 A Modula\dash 2 definition module
409 \addtoindexx{Modula-2!definition module}
410 may be represented by a module
412 \addtoindex{declaration attribute}
413 (\livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration}). A
414 \addtoindex{Fortran 90} module
415 \addtoindexx{Fortran!module (Fortran 90)}
416 may also be represented by a module entry
417 (but no declaration attribute is warranted because \addtoindex{Fortran}
418 has no concept of a corresponding module body).}
420 A module is represented by a debugging information entry
422 tag \livetarg{chap:DWTAGmodule}{DW\-\_TAG\-\_module}.
423 Module entries may own other
424 debugging information entries describing program entities
425 whose declaration scopes end at the end of the module itself.
427 If the module has a name, the module entry has a
428 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
429 \addtoindexx{name attribute}
430 whose value is a null\dash terminated string containing
431 the module name as it appears in the source program.
433 The \addtoindex{module entry} may have either a
434 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
435 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc}
437 \addtoindexx{high PC attribute}
439 \addtoindexx{low PC attribute}
441 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
442 \addtoindexx{ranges attribute}
443 whose values encode the contiguous or non\dash contiguous address
444 ranges, respectively, of the machine instructions generated for
445 the module initialization code
446 (see Section \refersec{chap:codeaddressesandranges}).
447 \hypertarget{chap:DWATentrypcentryaddressofmoduleinitialization}
449 \addtoindexx{entry pc attribute!for module initialization}
451 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} attribute whose value is the address of
452 the first executable instruction of that initialization code
453 (see Section \refersec{chap:entryaddress}).
456 \hypertarget{chap:DWATprioritymodulepriority}
457 the module has been assigned a priority, it may have
458 \addtoindexx{priority attribute}
460 \livelink{chap:DWATpriority}{DW\-\_AT\-\_priority} attribute.
461 The value of this attribute is a
462 reference to another debugging information entry describing
463 a variable with a constant value. The value of this variable
464 is the actual constant value of the module’s priority,
465 represented as it would be on the target architecture.
467 \subsection{Namespace Entries}
468 \label{chap:namespaceentries}
469 \textit{\addtoindex{C++} has the notion of a namespace, which provides a way to
470 \addtoindexx{namespace (C++)}
471 implement name hiding, so that names of unrelated things
472 do not accidentally clash in the
473 \addtoindex{global namespace} when an
474 application is linked together.}
476 A namespace is represented by a debugging information entry
478 tag \livetarg{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace}.
479 A namespace extension is
480 \hypertarget{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}
482 \livelink{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace} entry
484 \addtoindexx{extension attribute}
486 \livelink{chap:DWATextension}{DW\-\_AT\-\_extension}
487 attribute referring to the previous extension, or if there
488 is no previous extension, to the original
489 \livelink{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace}
490 entry. A namespace extension entry does not need to duplicate
491 information in a previous extension entry of the namespace
492 nor need it duplicate information in the original namespace
493 entry. (Thus, for a namespace with a name,
494 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
495 \addtoindexx{name attribute}
496 need only be attached directly to the original
497 \livelink{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace} entry.)
499 Namespace and namespace extension entries may own
500 \addtoindexx{namespace extension entry}
502 \addtoindexx{namespace declaration entry}
503 debugging information entries describing program entities
504 whose declarations occur in the namespace.
506 \textit{For \addtoindex{C++}, such
507 owned program entities may be declarations,
508 including certain declarations that are also object or
509 function definitions.}
511 If a type, variable, or function declared in a namespace is
512 defined outside of the body of the namespace declaration,
513 that type, variable, or function definition entry has a
514 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
515 \addtoindexx{specification attribute}
516 whose value is a reference to the
517 debugging information entry representing the declaration of
518 the type, variable or function. Type, variable, or function
520 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
521 \addtoindexx{specification attribute}
523 to duplicate information provided by the declaration entry
524 referenced by the specification attribute.
526 \textit{The \addtoindex{C++} \addtoindex{global namespace}
528 \addtoindexx{global namespace|see{namespace (C++), global}}
530 \addtoindexx{namespace (C++)!global}
532 ``::f'', for example) is not explicitly represented in
533 DWARF with a namespace entry (thus mirroring the situation
534 in \addtoindex{C++} source).
535 Global items may be simply declared with no
536 reference to a namespace.}
538 \textit{The \addtoindex{C++}
539 compilation unit specific ``unnamed namespace'' may
540 \addtoindexx{namespace (C++)!unnamed}
541 \addtoindexx{unnamed namespace|see {namespace (C++), unnamed}}
542 be represented by a namespace entry with no name attribute in
543 the original namespace declaration entry (and therefore no name
544 attribute in any namespace extension entry of this namespace).
547 \textit{A compiler emitting namespace information may choose to
548 explicitly represent namespace extensions, or to represent the
549 final namespace declaration of a compilation unit; this is a
550 quality\dash of\dash implementation issue and no specific requirements
551 are given here. If only the final namespace is represented,
552 \addtoindexx{namespace (C++)!using declaration}
553 it is impossible for a debugger to interpret using declaration
554 references in exactly the manner defined by the
555 \addtoindex{C++} language.
558 \textit{Emitting all namespace declaration information in all
559 compilation units can result in a significant increase in the
560 size of the debug information and significant duplication of
561 information across compilation units.
562 The \addtoindex{C++} namespace std,
564 \addtoindexx{namespace (C++)!std}
565 is large and will probably be referenced in
566 every \addtoindex{C++} compilation unit.
569 \textit{For a \addtoindex{C++} namespace example,
570 see Appendix \refersec{app:namespaceexample}.
575 \subsection{Imported (or Renamed) Declaration Entries}
576 \label{chap:importedorrenameddeclarationentries}
577 \textit{Some languages support the concept of importing into or making
578 accessible in a given unit declarations made in a different
579 module or scope. An imported declaration may sometimes be
584 imported declaration is represented by one or
585 \addtoindex{imported declaration entry}
586 more debugging information entries with the
587 tag \livetarg{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration}.
589 \hypertarget{chap:DWATimportimporteddeclaration}
591 is imported, there is one imported declaration entry for
593 \addtoindexx{import attribute}
594 Each imported declaration entry has a
595 \livelink{chap:DWATimport}{DW\-\_AT\-\_import} attribute,
596 whose value is a reference to the
597 debugging information entry representing the declaration that
600 An imported declaration may also have a
601 \livelink{chap:DWATname}{DW\-\_AT\-\_name}
603 \addtoindexx{name attribute}
604 whose value is a null\dash terminated string containing the
605 name, as it appears in the source program, by which the
606 imported entity is to be known in the context of the imported
607 declaration entry (which may be different than the name of
608 the entity being imported). If no name is present, then the
609 name by which the entity is to be known is the same as the
610 name of the entity being imported.
612 An imported declaration entry with a name attribute may be
613 used as a general means to rename or provide an alias for
614 \addtoindexx{alias declaration|see{imported declaration entry}}
615 an entity, regardless of the context in which the importing
616 declaration or the imported entity occurs.
618 \textit{A \addtoindex{C++} namespace alias may be represented by an imported
619 \hypertarget{chap:DWATimportnamespacealias}
621 \addtoindexx{namespace (C++)!alias}
622 with a name attribute whose value is
623 a null\dash terminated string containing the alias name as it
624 appears in the source program and an import attribute whose
625 value is a reference to the applicable original namespace or
626 namespace extension entry.
629 \textit{A \addtoindex{C++} using declaration may be represented by one or more
630 \hypertarget{chap:DWATimportnamespaceusingdeclaration}
632 \addtoindexx{namespace (C++)!using declaration}
633 declaration entries. When the using declaration
634 refers to an overloaded function, there is one imported
635 declaration entry corresponding to each overloading. Each
636 imported declaration entry has no name attribute but it does
637 have an import attribute that refers to the entry for the
638 entity being imported. (\addtoindex{C++}
639 provides no means to ``rename''
640 an imported entity, other than a namespace).
643 \textit{A \addtoindex{Fortran} use statement
644 \addtoindexx{Fortran!use statement}
645 \addtoindexx{use statement|see {Fortran, use statement}}
646 with an ``only list'' may be
647 represented by a series of imported declaration entries,
648 one (or more) for each entity that is imported. An entity
649 \addtoindexx{renamed declaration|see{imported declaration entry}}
650 that is renamed in the importing context may be represented
651 by an imported declaration entry with a name attribute that
652 specifies the new local name.
655 \subsection{Imported Module Entries}
656 \label{chap:importedmoduleentries}
658 \textit{Some languages support the concept of importing into or making
659 accessible in a given unit all of the declarations contained
660 within a separate module or namespace.
663 An imported module declaration is represented by a debugging
664 information entry with
665 \addtoindexx{imported module attribute}
667 \addtoindexx{imported module entry}
668 tag \livetarg{chap:DWTAGimportedmodule}{DW\-\_TAG\-\_imported\-\_module}.
670 imported module entry contains a
671 \livelink{chap:DWATimport}{DW\-\_AT\-\_import} attribute
672 \addtoindexx{import attribute}
673 whose value is a reference to the module or namespace entry
674 containing the definition and/or declaration entries for
675 the entities that are to be imported into the context of the
676 imported module entry.
678 An imported module declaration may own a set of imported
679 declaration entries, each of which refers to an entry in the
680 module whose corresponding entity is to be known in the context
681 of the imported module declaration by a name other than its
682 name in that module. Any entity in the module that is not
683 renamed in this way is known in the context of the imported
684 module entry by the same name as it is declared in the module.
686 \textit{A \addtoindex{C++} using directive
687 \addtoindexx{namespace (C++)!using directive}
688 \addtoindexx{using directive|see {namespace (C++), using directive}}
689 may be represented by an imported module
690 \hypertarget{chap:DWATimportnamespaceusingdirective}
691 entry, with an import attribute referring to the namespace
692 entry of the appropriate extension of the namespace (which
693 might be the original namespace entry) and no owned entries.
696 \textit{A \addtoindex{Fortran} use statement
697 \addtoindexx{Fortran!use statement}
698 with a “rename list” may be
699 represented by an imported module entry with an import
700 attribute referring to the module and owned entries
701 corresponding to those entities that are renamed as part of
705 \textit{A \addtoindex{Fortran} use statement
706 \addtoindexx{Fortran!use statement}
707 with neither a “rename list” nor
708 an “only list” may be represented by an imported module
709 entry with an import attribute referring to the module and
710 no owned child entries.
713 \textit{A use statement with an “only list” is represented by a
714 series of individual imported declaration entries as described
715 in Section \refersec{chap:importedorrenameddeclarationentries}.
718 \textit{A \addtoindex{Fortran} use statement for an entity in a module that is
719 \addtoindexx{Fortran!use statement}
720 itself imported by a use statement without an explicit mention
721 may be represented by an imported declaration entry that refers
722 to the original debugging information entry. For example, given
739 \textit{the imported declaration entry for Q within module C refers
740 directly to the variable declaration entry for A in module A
741 because there is no explicit representation for X in module B.
744 \textit{A similar situation arises for a \addtoindex{C++} using declaration
745 \addtoindexx{namespace (C++)!using declaration}
746 \addtoindexx{using declaration|see {namespace (C++), using declaration}}
747 that imports an entity in terms of a namespace alias. See
748 Appendix \refersec{app:namespaceexample}
752 \section{Subroutine and Entry Point Entries}
753 \label{chap:subroutineandentrypointentries}
755 The following tags exist to describe
756 debugging information entries
757 \addtoindexx{function entry|see{subroutine entry}}
759 \addtoindexx{subroutine entry}
761 \addtoindexx{subprogram entry}
763 % FIXME: is entry point entry the right index 'entry'?
764 \addtoindexx{entry point entry}
767 \begin{tabular}{lp{9.0cm}}
768 \livetarg{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram} & A subroutine or function \\
769 \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine} & A particular inlined
770 \addtoindexx{inlined subprogram entry}
771 instance of a subroutine or function \\
772 \livetarg{chap:DWTAGentrypoint}{DW\-\_TAG\-\_entry\-\_point} & An alternate entry point \\
775 \subsection{General Subroutine and Entry Point Information}
776 \label{chap:generalsubroutineandentrypointinformation}
777 The subroutine or entry point entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name}
778 attribute whose value is a null-terminated string containing the
779 subroutine or entry point name as it appears in the source.
780 It may also have a \livelink{chap:DWATlinkagename}{DW\-\_AT\-\_linkage\-\_name} attribute as
781 described in Section \refersec{chap:linkagenames}.
783 If the name of the subroutine described by an entry with the
784 \addtoindex{subprogram entry}
785 tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}
786 is visible outside of its containing
787 \hypertarget{chap:DWATexternalexternalsubroutine}
788 compilation unit, that entry has
789 \addtoindexx{external attribute}
791 \livelink{chap:DWATexternal}{DW\-\_AT\-\_external} attribute,
792 which is a \livelink{chap:flag}{flag}.
794 \textit{Additional attributes for functions that are members of a
795 class or structure are described in
796 Section \refersec{chap:memberfunctionentries}.
800 \hypertarget{chap:DWATmainsubprogrammainorstartingsubprogram}
803 \livelink{chap:DWATmainsubprogram}{DW\-\_AT\-\_main\-\_subprogram}
805 \addtoindexx{main subprogram attribute}
807 a \livelink{chap:flag}{flag} whose presence indicates that the
808 subroutine has been identified as the starting function of
809 the program. If more than one subprogram contains this
811 any one of them may be the starting subroutine of the program.
813 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
814 which is used to specify
815 and provide a user\dash supplied name for the main subroutine of
819 \textit{A common debugger feature is to allow the debugger user to call
820 a subroutine within the subject program. In certain cases,
821 however, the generated code for a subroutine will not obey
822 the standard calling conventions for the target architecture
823 and will therefore not be safe to call from within a debugger.
826 A subroutine entry may
827 \hypertarget{chap:DWATcallingconventionsubprogramcallingconvention}
829 \livelink{chap:DWATcallingconvention}{DW\-\_AT\-\_calling\-\_convention}
830 attribute, whose value is an integer constant. The set of
831 calling convention codes is given in
832 Table \refersec{tab:callingconventioncodes}.
834 \begin{simplenametable}[1.4in]{Calling convention codes}{tab:callingconventioncodes}
835 \addtoindex{DW\-\_CC\-\_normal} \\
836 \addtoindex{DW\-\_CC\-\_program} \\
837 \addtoindex{DW\-\_CC\-\_nocall} \\
838 \end{simplenametable}
840 If this attribute is not present, or its value is the constant
841 \livetarg{chap:DWCCnormal}{DW\-\_CC\-\_normal}, then the subroutine may be safely called by
842 obeying the ``standard'' calling conventions of the target
843 architecture. If the value of the calling convention attribute
844 is the constant \livetarg{chap:DWCCnocall}{DW\-\_CC\-\_nocall}, the subroutine does not obey
845 standard calling conventions, and it may not be safe for the
846 debugger to call this subroutine.
848 If the semantics of the language of the compilation unit
849 containing the subroutine entry distinguishes between ordinary
850 subroutines and subroutines that can serve as the ``main
851 program,'' that is, subroutines that cannot be called
852 directly according to the ordinary calling conventions,
853 then the debugging information entry for such a subroutine
854 may have a calling convention attribute whose value is the
855 constant \livetarg{chap:DWCCprogram}{DW\-\_CC\-\_program}.
857 \textit{The \livelink{chap:DWCCprogram}{DW\-\_CC\-\_program}
858 value is intended to support \addtoindex{Fortran} main
859 \addtoindexx{Fortran!main program}
860 programs which in some implementations may not be callable
861 or which must be invoked in a special way. It is not intended
862 as a way of finding the entry address for the program.
865 \textit{In \addtoindex{C}
866 there is a difference between the types of functions
867 declared using function prototype style declarations and
868 those declared using non\dash prototype declarations.
871 A subroutine entry declared with a function prototype style
873 \addtoindexx{prototyped attribute}
875 \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped} attribute, which is
876 a \livelink{chap:flag}{flag}.
878 \textit{The \addtoindex{Fortran}
879 language allows the keywords elemental, pure
880 and recursive to be included as part of the declaration of
881 a subroutine; these attributes reflect that usage. These
882 attributes are not relevant for languages that do not support
883 similar keywords or syntax. In particular, the \livelink{chap:DWATrecursive}{DW\-\_AT\-\_recursive}
884 attribute is neither needed nor appropriate in languages such
886 where functions support recursion by default.
890 \hypertarget{chap:DWATelementalelementalpropertyofasubroutine}
892 \addtoindexx{elemental attribute}
894 \livelink{chap:DWATelemental}{DW\-\_AT\-\_elemental} attribute, which
895 is a \livelink{chap:flag}{flag}.
896 The attribute indicates whether the subroutine
897 or entry point was declared with the ``elemental'' keyword
901 \hypertarget{chap:DWATpurepurepropertyofasubroutine}
902 subprogram entry may have
903 \addtoindexx{pure attribute}
905 \livelink{chap:DWATpure}{DW\-\_AT\-\_pure} attribute, which is
906 a \livelink{chap:flag}{flag}.
907 The attribute indicates whether the subroutine was
908 declared with the ``pure'' keyword or property.
911 \hypertarget{chap:DWATrecursiverecursivepropertyofasubroutine}
912 subprogram entry may have a
913 \livelink{chap:DWATrecursive}{DW\-\_AT\-\_recursive} attribute, which
914 is a \livelink{chap:flag}{flag}.
915 The attribute indicates whether the subroutine
916 or entry point was declared with the ``recursive'' keyword
921 \subsection{Subroutine and Entry Point Return Types}
922 \label{chap:subroutineandentrypointreturntypes}
925 \hypertarget{chap:DWATtypetypeofsubroutinereturn}
926 the subroutine or entry point
927 \addtoindexx{return type of subroutine}
928 is a function that returns a
929 value, then its debugging information entry has
930 \addtoindexx{type attribute}
931 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
932 to denote the type returned by that function.
934 \textit{Debugging information entries for
935 \addtoindex{C} void functions should
936 not have an attribute for the return type. }
939 \subsection{Subroutine and Entry Point Locations}
940 \label{chap:subroutineandentrypointlocations}
942 A subroutine entry may have either a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
943 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of attributes or a \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
944 \addtoindexx{ranges attribute}
946 \addtoindexx{high PC attribute}
948 \addtoindexx{low PC attribute}
949 encode the contiguous or non\dash contiguous address
950 ranges, respectively, of the machine instructions generated
951 for the subroutine (see
952 Section \refersec{chap:codeaddressesandranges}).
955 \hypertarget{chap:DWATentrypcentryaddressofsubprogram}
956 subroutine entry may also have
957 \addtoindexx{entry pc attribute!for subroutine}
959 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} attribute
960 whose value is the address of the first executable instruction
961 of the subroutine (see
962 Section \refersec{chap:entryaddress}).
964 An entry point has a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute whose value is the
965 relocated address of the first machine instruction generated
969 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} attribute
970 \addtoindexx{entry pc attribute!for subroutine}
972 also seem appropriate
973 for this purpose, historically the
974 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute
976 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} was introduced (in
977 \addtoindex{DWARF Version 3}).
978 There is insufficient reason to change this.}
984 \addtoindexx{address class!attribute}
986 \hypertarget{chap:DWATaddressclasssubroutineorsubroutinetype}
988 \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment}
990 \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class} attributes,
991 as appropriate, to specify
992 which segments the code for the subroutine resides in and
993 the addressing mode to be used in calling that subroutine.
995 A subroutine entry representing a subroutine declaration
996 that is not also a definition does not have code address or
1000 \subsection{Declarations Owned by Subroutines and Entry Points}
1001 \label{chap:declarationsownedbysubroutinesandentrypoints}
1003 The declarations enclosed by a subroutine or entry point are
1004 represented by debugging information entries that are owned
1005 by the subroutine or entry point entry. Entries representing
1006 \addtoindexx{formal parameter}
1007 the formal parameters of the subroutine or entry point appear
1008 in the same order as the corresponding declarations in the
1011 \textit{There is no ordering requirement for entries for declarations
1012 that are children of subroutine or entry point entries but
1013 that do not represent formal parameters. The formal parameter
1014 entries may be interspersed with other entries used by formal
1015 parameter entries, such as type entries.}
1017 The unspecified parameters of a variable parameter list are
1018 represented by a debugging information entry\addtoindexx{unspecified parameters entry}
1020 \livetarg{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}.
1022 The entry for a subroutine that includes
1023 \addtoindexx{Fortran!common block}
1025 \addtoindex{Fortran} common block
1026 \livelink{chap:fortrancommonblock}{common}
1027 \livelink{chap:commonblockentry}{block}
1028 \addtoindexx{common block|see{Fortran common block}}
1029 has a child entry with the
1030 tag \livetarg{chap:DWTAGcommoninclusion}{DW\-\_TAG\-\_common\-\_inclusion}.
1032 \hypertarget{chap:commonreferencecommonblockusage}
1033 common inclusion entry has a
1034 \livelink{chap:DWATcommonreference}{DW\-\_AT\-\_common\-\_reference} attribute
1035 whose value is a reference to the debugging information entry
1036 for the common \nolink{block} being included
1037 (see Section \refersec{chap:commonblockentries}).
1039 \subsection{Low-Level Information}
1040 \label{chap:lowlevelinformation}
1043 \hypertarget{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}
1044 subroutine or entry point entry may have
1045 \addtoindexx{return address attribute}
1047 \livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr}
1048 attribute, whose value is a location description. The location
1049 calculated is the place where the return address for the
1050 subroutine or entry point is stored.
1053 \hypertarget{chap:DWATframebasesubroutineframebaseaddress}
1054 subroutine or entry point entry may also have
1055 \addtoindexx{frame base attribute}
1057 \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attribute, whose value is a location
1058 description that computes the “frame base” for the
1059 subroutine or entry point. If the location description is
1060 a simple register location description, the given register
1061 contains the frame base address. If the location description is
1062 a DWARF expression, the result of evaluating that expression
1063 is the frame base address. Finally, for a
1064 \addtoindex{location list},
1065 this interpretation applies to each location description
1066 contained in the list of \addtoindex{location list} entries.
1068 \textit{The use of one of the \livelink{chap:DWOPreg}{DW\-\_OP\-\_reg}~\textless~n~\textgreater
1070 context is equivalent to using
1071 \livelink{chap:DWOPbreg}{DW\-\_OP\-\_breg}~\textless~n~\textgreater(0)
1073 compact. However, these are not equivalent in general.}
1075 \textit{The frame base for a procedure is typically an address fixed
1076 relative to the first unit of storage allocated for the
1077 procedure’s stack frame. The \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attribute
1078 can be used in several ways:}
1079 \begin{enumerate}[1.]
1080 \item \textit{In procedures that need
1081 \addtoindexx{location list}
1082 location lists to locate local
1083 variables, the \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} can hold the needed location
1084 list, while all variables’ location descriptions can be
1085 simpler ones involving the frame base.}
1087 \item \textit{It can be used in resolving ``up\dash level'' addressing
1088 within nested routines.
1089 (See also \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link}, below)}
1090 %The -See also- here is ok, the DW\-\_AT should be
1091 %a hyperref to the def itself, which is earlier in this document.
1094 \textit{Some languages support nested subroutines. In such languages,
1095 it is possible to reference the local variables of an
1096 outer subroutine from within an inner subroutine. The
1097 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link} and \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attributes allow
1098 debuggers to support this same kind of referencing.}
1101 \hypertarget{chap:DWATstaticlinklocationofuplevelframe}
1103 \addtoindexx{address!uplevel|see {static link attribute}}
1104 \addtoindexx{uplevel address|see {static link attribute}}
1105 subroutine or entry point is nested, it may have a
1106 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link}
1107 attribute, whose value is a location
1108 description that computes the frame base of the relevant
1109 instance of the subroutine that immediately encloses the
1110 subroutine or entry point.
1112 In the context of supporting nested subroutines, the
1113 \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attribute value should obey the following
1116 \begin{enumerate}[1.]
1117 \item It should compute a value that does not change during the
1118 life of the procedure, and
1120 \item The computed value should be unique among instances of
1121 the same subroutine. (For typical \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} use, this
1122 means that a recursive subroutine’s stack frame must have
1123 non\dash zero size.)
1126 \textit{If a debugger is attempting to resolve an up\dash level reference
1127 to a variable, it uses the nesting structure of DWARF to
1128 determine which subroutine is the lexical parent and the
1129 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link} value to identify the appropriate active
1130 frame of the parent. It can then attempt to find the reference
1131 within the context of the parent.}
1135 \subsection{Types Thrown by Exceptions}
1136 \label{chap:typesthrownbyexceptions}
1138 \textit{In \addtoindex{C++} a subroutine may declare a set of types which
1139 it may validly throw.}
1141 If a subroutine explicitly declares that it may throw
1142 \addtoindexx{exception thrown|see{thrown type entry}}
1144 \addtoindexx{thrown exception|see{thrown type entry}}
1145 exception for one or more types, each such type is
1146 represented by a debugging information entry with
1147 \addtoindexx{thrown type entry}
1149 \livetarg{chap:DWTAGthrowntype}{DW\-\_TAG\-\_thrown\-\_type}.
1150 Each such entry is a child of the entry
1151 representing the subroutine that may throw this type. Each
1152 thrown type entry contains
1153 \addtoindexx{type attribute}
1154 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, whose
1155 value is a reference to an entry describing the type of the
1156 exception that may be thrown.
1158 \subsection{Function Template Instantiations}
1159 \label{chap:functiontemplateinstantiations}
1161 \textit{In \addtoindex{C++}, a function template is a generic definition of
1162 a function that is instantiated differently when called with
1163 values of different types. DWARF does not represent the generic
1164 template definition, but does represent each instantiation.}
1166 A \addtoindex{template instantiation} is represented by a debugging
1167 information entry with the
1168 \addtoindexx{subprogram entry!use for template instantiation}
1169 tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}.
1171 exceptions, such an entry will contain the same attributes and
1172 will have the same types of child entries as would an entry
1173 for a subroutine defined explicitly using the instantiation
1174 types. The exceptions are:
1176 \begin{enumerate}[1.]
1177 \item Each formal parameterized type declaration appearing in the
1178 template definition is represented by a debugging information
1180 \addtoindexx{template type parameter entry}
1181 tag \livetarg{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}.
1183 such entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
1184 \addtoindexx{name attribute}
1186 null\dash terminated string containing the name of the formal
1187 type parameter as it appears in the source program. The
1188 \addtoindexx{formal type parameter|see{template type parameter entry}}
1189 template type parameter entry also has
1190 \addtoindexx{type attribute}
1191 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1192 describing the actual type by which the formal is replaced
1193 for this instantiation.
1195 \item The subprogram entry and each of its child entries reference
1196 a template type parameter entry in any circumstance where
1197 the template definition referenced a formal parameterized type.
1199 \item If the compiler has generated a special compilation unit
1200 to hold the template instantiation and that compilation unit
1201 has a different name from the compilation unit containing
1202 the template definition, the name attribute for the debugging
1203 information entry representing that compilation unit is empty
1206 \item If the subprogram entry representing the template
1207 instantiation or any of its child entries contain declaration
1208 coordinate attributes, those attributes refer to the source
1209 for the template definition, not to any source generated
1210 artificially by the compiler for this instantiation.
1215 \subsection{Inlinable and Inlined Subroutines}
1216 A declaration or a definition of an inlinable subroutine
1217 is represented by a debugging information entry with the
1219 \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}.
1221 \addtoindexx{subprogram entry!use in inlined subprogram}
1223 \hypertarget{chap:DWATinlineinlinedsubroutine}
1224 explicitly declared to be available for inline expansion or
1225 that was expanded inline implicitly by the compiler has
1226 \addtoindexx{inline attribute}
1228 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute whose value is an integer constant. The
1229 set of values for the \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute is given in
1230 Table \refersec{tab:inlinecodes}.
1234 \caption{Inline codes}
1235 \label{tab:inlinecodes}
1236 \begin{tabular}{l|p{9cm}}
1238 Name&Meaning\\ \hline
1239 \livetarg{chap:DWINLnotinlined}{DW\-\_INL\-\_not\-\_inlined} & Not declared inline nor inlined by the
1240 compiler (equivalent to the absence of the containing \break
1241 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute) \\
1242 \livetarg{chap:DWINLinlined}{DW\-\_INL\-\_inlined} & Not declared inline but inlined by the compiler \\
1243 \livetarg{chap:DWINLdeclarednotinlined}{DW\-\_INL\-\_declared\-\_not\-\_inlined} & Declared inline but
1244 not inlined by the compiler \\
1245 \livetarg{chap:DWINLdeclaredinlined}{DW\-\_INL\-\_declared\-\_inlined} & Declared inline and inlined by the compiler \\
1250 \textit{In \addtoindex{C++}, a function or a constructor declared with
1251 constexpr is implicitly declared inline. The abstract inline
1252 instance (see below) is represented by a debugging information
1253 entry with the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}. Such an entry has a
1254 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute whose value is \livelink{chap:DWINLinlined}{DW\-\_INL\-\_inlined}.}
1257 \subsubsection{Abstract Instances}
1258 \label{chap:abstractinstances}
1259 Any debugging information entry that is owned (either
1260 \hypertarget{chap:DWATinlineabstracttinstance}
1261 directly or indirectly) by a debugging information entry
1263 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute is referred to
1264 \addtoindexx{abstract instance!entry}
1265 as an ``abstract instance entry.''
1266 Any subroutine entry
1268 \addtoindexx{inline attribute}
1269 a \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute whose value is other
1270 than \livelink{chap:DWINLnotinlined}{DW\-\_INL\-\_not\-\_inlined}
1272 \addtoindexx{abstract instance!root}
1273 an ``abstract instance root.''
1274 Any set of abstract instance entries that are all
1275 children (either directly or indirectly) of some abstract
1276 instance root, together with the root itself, is known as
1277 \addtoindexx{abstract instance!tree}
1278 an ``abstract instance tree.'' However, in the case where
1279 an abstract instance tree is nested within another abstract
1280 instance tree, the entries in the
1281 \addtoindex{nested abstract instance}
1282 tree are not considered to be entries in the outer abstract
1285 Each abstract instance root is either part of a larger
1286 \addtoindexx{abstract instance!root}
1287 tree (which gives a context for the root) or
1288 \addtoindexx{specification attribute}
1290 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
1291 to refer to the declaration in context.
1293 \textit{For example, in \addtoindex{C++} the context might be a namespace
1294 declaration or a class declaration.}
1296 \textit{Abstract instance trees are defined so that no entry is part
1297 of more than one abstract instance tree. This simplifies the
1298 following descriptions.}
1300 A debugging information entry that is a member of an abstract
1301 instance tree should not contain any attributes which describe
1302 aspects of the subroutine which vary between distinct inlined
1303 expansions or distinct out\dash of\dash line expansions. For example,
1304 \addtoindexx{entry pc attribute!and abstract instance}
1305 the \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc},
1306 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc},
1307 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges},
1308 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc},
1309 \livelink{chap:DWATlocation}{DW\-\_AT\-\_location},
1310 \livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr}, \livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope},
1312 \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment!and abstract instance}
1314 \addtoindexx{location attribute!and abstract instance}
1316 \addtoindexx{ranges attribute!and abstract instance}
1318 \addtoindexx{high PC attribute!and abstract instance}
1320 \addtoindexx{low PC attribute!and abstract instance}
1322 \addtoindex{segment attribute!and abstract instance}
1324 \addtoindexx{return address attribute!and abstract instance}
1326 \addtoindexx{segment attribute!and abstract instance}
1328 \addtoindexx{start scope attribute!and abstract instance}
1331 \textit{It would not make sense normally to put these attributes into
1332 abstract instance entries since such entries do not represent
1333 actual (concrete) instances and thus do not actually exist at
1334 run\dash time. However,
1335 see Appendix \refersec{app:inlineouteronenormalinner}
1336 for a contrary example.}
1338 The rules for the relative location of entries belonging to
1339 abstract instance trees are exactly the same as for other
1340 similar types of entries that are not abstract. Specifically,
1341 the rule that requires that an entry representing a declaration
1342 be a direct child of the entry representing the scope of the
1343 declaration applies equally to both abstract and non\dash abstract
1344 entries. Also, the ordering rules for formal parameter entries,
1345 member entries, and so on, all apply regardless of whether
1346 or not a given entry is abstract.
1348 \subsubsection{Concrete Inlined Instances}
1349 \label{chap:concreteinlinedinstances}
1351 Each inline expansion of a subroutine is represented
1352 by a debugging information entry with the
1353 tag \livetarg{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}.
1354 Each such entry should be a direct
1355 child of the entry that represents the scope within which
1356 the inlining occurs.
1358 Each inlined subroutine entry may have either a
1359 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc}
1360 and \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair
1362 \addtoindexx{high PC attribute}
1364 \addtoindexx{low PC attribute}
1366 \addtoindexx{ranges attribute}
1368 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges}
1369 attribute whose values encode the contiguous or non\dash contiguous
1370 address ranges, respectively, of the machine instructions
1371 generated for the inlined subroutine (see
1372 Section \refersec{chap:codeaddressesandranges}).
1374 \hypertarget{chap:DWATentrypcentryaddressofinlinedsubprogram}
1375 inlined subroutine entry may
1376 \addtoindexx{inlined subprogram entry!in concrete instance}
1378 \addtoindexx{inlined subprogram entry}
1380 \addtoindexx{entry pc attribute!for inlined subprogram}
1382 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc}
1383 attribute, representing the first executable instruction of
1384 the inline expansion (see
1385 Section \refersec{chap:entryaddress}).
1387 % Positions of the 3 targets here is a bit arbitrary.
1389 \hypertarget{chap:DWATcalllinelinenumberofinlinedsubroutinecall}
1391 \hypertarget{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}
1393 \hypertarget{chap:DWATcallfilefilecontaininginlinedsubroutinecall}
1394 may also have \livelink{chap:DWATcallfile}{DW\-\_AT\-\_call\-\_file},
1395 \livelink{chap:DWATcallline}{DW\-\_AT\-\_call\-\_line} and \livelink{chap:DWATcallcolumn}{DW\-\_AT\-\_call\-\_column} attributes,
1397 value is an integer constant. These attributes represent the
1398 source file, source line number, and source column number,
1399 respectively, of the first character of the statement or
1400 expression that caused the inline expansion. The call file,
1401 call line, and call column attributes are interpreted in
1402 the same way as the declaration file, declaration line, and
1403 declaration column attributes, respectively (see
1404 Section \refersec{chap:declarationcoordinates}).
1406 \textit{The call file, call line and call column coordinates do not
1407 describe the coordinates of the subroutine declaration that
1408 was inlined, rather they describe the coordinates of the call.
1411 An inlined subroutine entry
1412 \hypertarget{chap:DWATconstexprcompiletimeconstantfunction}
1414 \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr}
1415 attribute, which is a \livelink{chap:flag}{flag}
1416 whose presence indicates that the
1417 subroutine has been evaluated as a compile\dash time constant. Such
1418 an entry may also have a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute,
1419 whose value may be of any form that is appropriate for the
1420 representation of the subroutine's return value. The value of
1421 this attribute is the actual return value of the subroutine,
1422 represented as it would be on the target architecture.
1424 \textit{In \addtoindex{C++}, if a function or a constructor declared with constexpr
1425 is called with constant expressions, then the corresponding
1426 concrete inlined instance has a
1427 \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr} attribute,
1428 as well as a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute whose value represents
1429 the actual return value of the concrete inlined instance.}
1431 Any debugging information entry that is owned (either
1432 directly or indirectly) by a debugging information entry
1433 with the tag \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine} is referred to as a
1434 ``concrete inlined instance entry.'' Any entry that has
1436 \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}
1437 is known as a ``concrete inlined instance root.''
1438 Any set of concrete inlined instance
1439 entries that are all children (either directly or indirectly)
1440 of some concrete inlined instance root, together with the root
1441 itself, is known as a ``concrete inlined instance tree.''
1442 However, in the case where a concrete inlined instance tree
1443 is nested within another concrete instance tree, the entries
1444 in the \addtoindex{nested concrete inline instance} tree
1445 are not considered to
1446 be entries in the outer concrete instance tree.
1448 \textit{Concrete inlined instance trees are defined so that no entry
1449 is part of more than one concrete inlined instance tree. This
1450 simplifies later descriptions.}
1452 Each concrete inlined instance tree is uniquely associated
1453 with one (and only one) abstract instance tree.
1455 \textit{Note, however, that the reverse is not true. Any given abstract
1456 instance tree may be associated with several different concrete
1457 inlined instance trees, or may even be associated with zero
1458 concrete inlined instance trees.}
1460 Concrete inlined instance entries may omit attributes that
1461 are not specific to the concrete instance (but present in
1462 the abstract instance) and need include only attributes that
1463 are specific to the concrete instance (but omitted in the
1464 abstract instance). In place of these omitted attributes, each
1465 \hypertarget{chap:DWATabstractorigininlineinstance}
1466 concrete inlined instance entry
1467 \addtoindexx{abstract origin attribute}
1469 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin}
1470 attribute that may be used to obtain the missing information
1471 (indirectly) from the associated abstract instance entry. The
1472 value of the abstract origin attribute is a reference to the
1473 associated abstract instance entry.
1475 If an entry within a concrete inlined instance tree contains
1476 attributes describing the
1477 \addtoindexx{declaration coordinates!in concrete instance}
1478 declaration coordinates
1480 entry, then those attributes should refer to the file, line
1481 and column of the original declaration of the subroutine,
1482 not to the point at which it was inlined. As a consequence,
1483 they may usually be omitted from any entry that has an abstract
1486 For each pair of entries that are associated via a
1487 \addtoindexx{abstract origin attribute}
1488 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin} attribute, both members of the pair
1489 have the same tag. So, for example, an entry with the tag
1490 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable} can only be associated with another entry
1491 that also has the tag \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}. The only exception
1492 to this rule is that the root of a concrete instance tree
1493 (which must always have the tag \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine})
1494 can only be associated with the root of its associated abstract
1495 instance tree (which must have the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}).
1497 In general, the structure and content of any given concrete
1498 inlined instance tree will be closely analogous to the
1499 structure and content of its associated abstract instance
1500 tree. There are a few exceptions:
1502 \begin{enumerate}[1.]
1503 \item An entry in the concrete instance tree may be omitted if
1505 \addtoindexx{abstract origin attribute}
1506 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin} attribute and either
1507 has no children, or its children are omitted. Such entries
1508 would provide no useful information. In C\dash like languages,
1509 such entries frequently include types, including structure,
1510 union, class, and interface types; and members of types. If any
1511 entry within a concrete inlined instance tree needs to refer
1512 to an entity declared within the scope of the relevant inlined
1513 subroutine and for which no concrete instance entry exists,
1514 the reference should refer to the abstract instance entry.
1516 \item Entries in the concrete instance tree which are associated
1517 with entries in the abstract instance tree such that neither
1518 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
1519 \addtoindexx{name attribute}
1520 and neither is referenced by
1521 any other debugging information entry, may be omitted. This
1522 may happen for debugging information entries in the abstract
1523 instance trees that became unnecessary in the concrete instance
1524 tree because of additional information available there. For
1525 example, an anonymous variable might have been created and
1526 described in the abstract instance tree, but because of
1527 the actual parameters for a particular inlined expansion,
1528 it could be described as a constant value without the need
1529 for that separate debugging information entry.
1531 \item A concrete instance tree may contain entries which do
1532 not correspond to entries in the abstract instance tree
1533 to describe new entities that are specific to a particular
1534 inlined expansion. In that case, they will not have associated
1535 entries in the abstract instance tree, should not contain
1536 \addtoindexx{abstract origin attribute}
1537 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin} attributes, and must contain all their
1538 own attributes directly. This allows an abstract instance tree
1539 to omit debugging information entries for anonymous entities
1540 that are unlikely to be needed in most inlined expansions. In
1541 any expansion which deviates from that expectation, the
1542 entries can be described in its concrete inlined instance tree.
1546 \subsubsection{Out-of-Line Instances of Inlined Subroutines}
1547 \label{chap:outoflineinstancesofinlinedsubroutines}
1548 Under some conditions, compilers may need to generate concrete
1549 executable instances of inlined subroutines other than at
1550 points where those subroutines are actually called. Such
1551 concrete instances of inlined subroutines are referred to as
1552 ``concrete out\dash of\dash line instances.''
1554 \textit{In \addtoindex{C++}, for example,
1555 taking the address of a function declared
1556 to be inline can necessitate the generation of a concrete
1557 out\dash of\dash line instance of the given function.}
1559 The DWARF representation of a concrete out\dash of\dash line instance
1560 of an inlined subroutine is essentially the same as for a
1561 concrete inlined instance of that subroutine (as described in
1562 the preceding section). The representation of such a concrete
1563 % It is critical that the hypertarget and livelink be
1564 % separated to avoid problems with latex.
1565 out\dash of\dash line
1566 \addtoindexx{abstract origin attribute}
1568 \hypertarget{chap:DWATabstractoriginoutoflineinstance}
1570 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin}
1571 attributes in exactly the same way as they are used for
1572 a concrete inlined instance (that is, as references to
1573 corresponding entries within the associated abstract instance
1576 The differences between the DWARF representation of a
1577 concrete out\dash of\dash line instance of a given subroutine and the
1578 representation of a concrete inlined instance of that same
1579 subroutine are as follows:
1581 \begin{enumerate}[1.]
1582 \item The root entry for a concrete out\dash of\dash line instance
1583 of a given inlined subroutine has the same tag as does its
1584 associated (abstract) inlined subroutine entry (that is, tag
1585 \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram} rather than \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}).
1587 \item The root entry for a concrete out\dash of\dash line instance tree
1588 is normally owned by the same parent entry that also owns
1589 the root entry of the associated abstract instance. However,
1590 it is not required that the abstract and out\dash of\dash line instance
1591 trees be owned by the same parent entry.
1595 \subsubsection{Nested Inlined Subroutines}
1596 \label{nestedinlinedsubroutines}
1597 Some languages and compilers may permit the logical nesting of
1598 a subroutine within another subroutine, and may permit either
1599 the outer or the nested subroutine, or both, to be inlined.
1601 For a non\dash inlined subroutine nested within an inlined
1602 subroutine, the nested subroutine is described normally in
1603 both the abstract and concrete inlined instance trees for
1604 the outer subroutine. All rules pertaining to the abstract
1605 and concrete instance trees for the outer subroutine apply
1606 also to the abstract and concrete instance entries for the
1609 For an inlined subroutine nested within another inlined
1610 subroutine, the following rules apply to their abstract and
1611 \addtoindexx{abstract instance!nested}
1612 \addtoindexx{concrete instance!nested}
1613 concrete instance trees:
1615 \begin{enumerate}[1.]
1616 \item The abstract instance tree for the nested subroutine is
1617 described within the abstract instance tree for the outer
1618 subroutine according to the rules in
1619 Section \refersec{chap:abstractinstances}, and
1620 without regard to the fact that it is within an outer abstract
1623 \item Any abstract instance tree for a nested subroutine is
1624 always omitted within the concrete instance tree for an
1627 \item A concrete instance tree for a nested subroutine is
1628 always omitted within the abstract instance tree for an
1631 \item The concrete instance tree for any inlined or
1632 \addtoindexx{out-of-line instance}
1634 \addtoindexx{out-of-line-instance|see{concrete out-of-line-instance}}
1635 expansion of the nested subroutine is described within a
1636 concrete instance tree for the outer subroutine according
1638 Sections \refersec{chap:concreteinlinedinstances} or
1639 \refersec{chap:outoflineinstancesofinlinedsubroutines}
1641 and without regard to the fact that it is within an outer
1642 concrete instance tree.
1645 See Appendix \refersec{app:inliningexamples}
1646 for discussion and examples.
1648 \subsection{Trampolines}
1649 \label{chap:trampolines}
1651 \textit{A trampoline is a compiler\dash generated subroutine that serves as
1652 \hypertarget{chap:DWATtrampolinetargetsubroutine}
1653 an intermediary in making a call to another subroutine. It may
1654 adjust parameters and/or the result (if any) as appropriate
1655 to the combined calling and called execution contexts.}
1657 A trampoline is represented by a debugging information entry
1658 \addtoindexx{trampoline (subprogam) entry}
1659 with the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram} or \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}
1661 \addtoindexx{trampoline attribute}
1662 a \livelink{chap:DWATtrampoline}{DW\-\_AT\-\_trampoline} attribute.
1664 attribute indicates the target subroutine of the trampoline,
1665 that is, the subroutine to which the trampoline passes
1666 control. (A trampoline entry may but need not also have a
1667 \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial} attribute.)
1669 The value of the trampoline attribute may be represented
1670 using any of the following forms, which are listed in order
1674 \item If the value is of class reference, then the value
1675 specifies the debugging information entry of the target
1678 \item If the value is of class address, then the value is
1679 the relocated address of the target subprogram.
1681 \item If the value is of class string, then the value is the
1682 (possibly mangled) \addtoindexx{mangled names}
1683 name of the target subprogram.
1685 \item If the value is of class \livelink{chap:flag}{flag}, then the value true
1686 indicates that the containing subroutine is a trampoline but
1687 that the target subroutine is not known.
1691 The target subprogram may itself be a trampoline. (A sequence
1692 of trampolines necessarily ends with a non\dash trampoline
1695 \textit{In \addtoindex{C++}, trampolines may be used
1696 to implement derived virtual
1697 member functions; such trampolines typically adjust the
1698 \addtoindexx{this parameter}
1699 implicit this pointer parameter in the course of passing
1701 Other languages and environments may use trampolines
1702 in a manner sometimes known as transfer functions or transfer
1705 \textit{Trampolines may sometimes pass control to the target
1706 subprogram using a branch or jump instruction instead of a
1707 call instruction, thereby leaving no trace of their existence
1708 in the subsequent execution context. }
1710 \textit{This attribute helps make it feasible for a debugger to arrange
1711 that stepping into a trampoline or setting a breakpoint in
1712 a trampoline will result in stepping into or setting the
1713 breakpoint in the target subroutine instead. This helps to
1714 hide the compiler generated subprogram from the user. }
1716 \textit{If the target subroutine is not known, a debugger may choose
1717 to repeatedly step until control arrives in a new subroutine
1718 which can be assumed to be the target subroutine. }
1722 \section{Lexical Block Entries}
1723 \label{chap:lexicalblockentries}
1726 lexical \livetargi{chap:lexicalblock}{block}{lexical block}
1728 \addtoindexx{lexical block}
1729 a bracketed sequence of source statements
1730 that may contain any number of declarations. In some languages
1731 (including \addtoindex{C} and \addtoindex{C++}),
1732 \nolink{blocks} can be nested within other
1733 \nolink{blocks} to any depth.}
1735 % We do not need to link to the preceding paragraph.
1736 A lexical \nolink{block} is represented by a debugging information
1738 tag \livetarg{chap:DWTAGlexicalblock}{DW\-\_TAG\-\_lexical\-\_block}.
1740 The lexical \livetargi{chap:lexicalblockentry}{block}{lexical block entry}
1742 either a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
1743 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of
1745 \addtoindexx{high PC attribute}
1747 \addtoindexx{low PC attribute}
1749 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
1750 \addtoindexx{ranges attribute}
1751 whose values encode the contiguous or non-contiguous address
1752 ranges, respectively, of the machine instructions generated
1753 for the lexical \livelink{chap:lexicalblock}{block}
1754 (see Section \refersec{chap:codeaddressesandranges}).
1756 If a name has been given to the
1757 lexical \livelink{chap:lexicalblock}{block}
1759 program, then the corresponding
1760 lexical \livelink{chap:lexicalblockentry}{block} entry has a
1761 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose
1762 \addtoindexx{name attribute}
1763 value is a null\dash terminated string
1764 containing the name of the lexical \livelink{chap:lexicalblock}{block}
1768 \textit{This is not the same as a \addtoindex{C} or
1769 \addtoindex{C++} label (see below).}
1771 The lexical \livelink{chap:lexicalblockentry}{block} entry owns
1772 debugging information entries that
1773 describe the declarations within that lexical \livelink{chap:lexicalblock}{block}.
1775 one such debugging information entry for each local declaration
1776 of an identifier or inner lexical \livelink{chap:lexicalblock}{block}.
1778 \section{Label Entries}
1779 \label{chap:labelentries}
1780 \textit{A label is a way of identifying a source statement. A labeled
1781 statement is usually the target of one or more ``go to''
1785 A label is represented by a debugging information entry with
1786 \addtoindexx{label entry}
1788 tag \livetarg{chap:DWTAGlabel}{DW\-\_TAG\-\_label}.
1789 The entry for a label should be owned by
1790 the debugging information entry representing the scope within
1791 which the name of the label could be legally referenced within
1794 The label entry has a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute whose value
1795 is the relocated address of the first machine instruction
1796 generated for the statement identified by the label in
1797 the source program. The label entry also has a
1798 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1799 \addtoindexx{name attribute}
1800 whose value is a null-terminated string containing
1801 the name of the label as it appears in the source program.
1804 \section{With Statement Entries}
1805 \label{chap:withstatemententries}
1807 \textit{Both \addtoindex{Pascal} and
1808 \addtoindexx{Modula-2}
1809 Modula\dash 2 support the concept of a ``with''
1810 statement. The with statement specifies a sequence of
1811 executable statements within which the fields of a record
1812 variable may be referenced, unqualified by the name of the
1815 A with statement is represented by a
1816 \addtoindexi{debugging information entry}{with statement entry}
1817 with the tag \livetarg{chap:DWTAGwithstmt}{DW\-\_TAG\-\_with\-\_stmt}.
1819 A with statement entry may have either a
1820 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
1821 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of attributes
1822 \addtoindexx{high PC attribute}
1824 \addtoindexx{low PC attribute}
1825 a \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
1826 \addtoindexx{ranges attribute}
1827 whose values encode the contiguous or non\dash contiguous address
1828 ranges, respectively, of the machine instructions generated
1829 for the with statement
1830 (see Section \refersec{chap:codeaddressesandranges}).
1832 The with statement entry has
1833 \addtoindexx{type attribute}
1834 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, denoting
1835 the type of record whose fields may be referenced without full
1836 qualification within the body of the statement. It also has
1837 \addtoindexx{location attribute}
1838 a \livelink{chap:DWATlocation}{DW\-\_AT\-\_location} attribute, describing how to find the base
1839 address of the record object referenced within the body of
1842 \section{Try and Catch Block Entries}
1843 \label{chap:tryandcatchblockentries}
1845 \textit{In \addtoindex{C++} a lexical \livelink{chap:lexicalblock}{block} may be
1846 designated as a ``catch \nolink{block}.''
1847 A catch \livetargi{chap:catchblock}{block}{catch block} is an
1848 exception handler that handles
1849 exceptions thrown by an immediately
1850 preceding ``try \livelink{chap:tryblock}{block}.''
1851 A catch \livelink{chap:catchblock}{block}
1852 designates the type of the exception that it
1855 A try \livetargi{chap:tryblock}{block}{try block} is represented
1856 by a debugging information entry
1857 \addtoindexx{try block entry}
1858 with the tag \livetarg{chap:DWTAGtryblock}{DW\-\_TAG\-\_try\-\_block}.
1859 A catch \livelink{chap:catchblock}{block} is represented by
1860 a debugging information entry with
1861 \addtoindexx{catch block entry}
1862 the tag \livetarg{chap:DWTAGcatchblock}{DW\-\_TAG\-\_catch\-\_block}.
1864 % nolink as we have links just above and do not have a combo link for both
1865 Both try and catch \nolink{block} entries may have either a
1866 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
1867 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of attributes
1868 \addtoindexx{high PC attribute}
1870 \addtoindexx{low PC attribute}
1872 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
1873 \addtoindexx{ranges attribute}
1874 whose values encode the contiguous
1875 or non\dash contiguous address ranges, respectively, of the
1876 machine instructions generated for the \livelink{chap:lexicalblock}{block}
1878 \refersec{chap:codeaddressesandranges}).
1880 Catch \livelink{chap:catchblock}{block} entries have at
1881 least one child entry, an
1882 entry representing the type of exception accepted by
1883 that catch \livelink{chap:catchblock}{block}.
1884 This child entry has one of
1885 \addtoindexx{formal parameter entry!in catch block}
1887 \addtoindexx{unspecified parameters entry!in catch block}
1889 \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter} or
1890 \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters},
1891 and will have the same form as other parameter entries.
1893 The siblings immediately following
1894 a try \livelink{chap:tryblock}{block} entry are its
1895 corresponding catch \livelink{chap:catchblock}{block} entries.