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 \doublequote{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 \doublequote{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
83 \begin{enumerate}[1. ]
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 \addtoindexx{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.
191 This information is placed in a separate object file section
192 from the debugging information entries themselves. The
193 value of the macro information attribute is the offset in
194 the \addtoindex{.debug\_macinfo} section of the first byte of the macro
195 information for this compilation unit
196 (see Section \refersec{chap:macroinformation}).
199 \livelink{chap:DWATcompdir}{DW\-\_AT\-\_comp\-\_dir}
201 \hypertarget{chap:DWATcompdircompilationdirectory}
203 null\dash terminated string containing the current working directory
204 of the compilation command that produced this compilation
205 unit in whatever form makes sense for the host system.
207 \item A \livelink{chap:DWATproducer}{DW\-\_AT\-\_producer} attribute
208 \addtoindexx{producer attribute}
209 whose value is a null\dash
210 terminated string containing information about the compiler
211 \hypertarget{chap:DWATproducercompileridentification}
212 that produced the compilation unit. The actual contents of
213 the string will be specific to each producer, but should
214 begin with the name of the compiler vendor or some other
215 identifying character sequence that should avoid confusion
216 with other producer values.
219 \item A \livelink{chap:DWATidentifiercase}{DW\-\_AT\-\_identifier\-\_case}
221 \addtoindexx{identifier case attribute}
223 \hypertarget{chap:DWATidentifiercaseidentifiercaserule}
224 constant value is a code describing the treatment
225 of identifiers within this compilation unit. The
226 set of identifier case codes is given in
227 Table \refersec{tab:identifiercasecodes}.
229 \begin{simplenametable}{Identifier case codes}{tab:identifiercasecodes}
230 \livelink{chap:DWIDcasesensitive}{DW\-\_ID\-\_case\-\_sensitive} \\
231 \livelink{chap:DWIDupcase}{DW\-\_ID\-\_up\-\_case} \\
232 \livelink{chap:DWIDdowncase}{DW\-\_ID\-\_down\-\_case} \\
233 \livelink{chap:DWIDcaseinsensitive}{DW\-\_ID\-\_case\-\_insensitive} \\
234 \end{simplenametable}
236 \livetarg{chap:DWIDcasesensitive}{DW\-\_ID\-\_case\-\_sensitive} is the default for all compilation units
237 that do not have this attribute. It indicates that names given
238 as the values of \livelink{chap:DWATname}{DW\-\_AT\-\_name} attributes
239 \addtoindexx{name attribute}
240 in debugging information
241 entries for the compilation unit reflect the names as they
242 appear in the source program. The debugger should be sensitive
243 to the case of identifier names when doing identifier lookups.
245 \livetarg{chap:DWIDupcase}{DW\-\_ID\-\_up\-\_case} means that the
246 producer of the debugging
247 information for this compilation unit converted all source
248 names to upper case. The values of the name attributes may not
249 reflect the names as they appear in the source program. The
250 debugger should convert all names to upper case when doing
253 \livetarg{chap:DWIDdowncase}{DW\-\_ID\-\_down\-\_case} means that
254 the producer of the debugging
255 information for this compilation unit converted all source
256 names to lower case. The values of the name attributes may not
257 reflect the names as they appear in the source program. The
258 debugger should convert all names to lower case when doing
261 \livetarg{chap:DWIDcaseinsensitive}{DW\-\_ID\-\_case\-\_insensitive} means that the values of the name
262 attributes reflect the names as they appear in the source
263 program but that a case insensitive lookup should be used to
266 \item A \livelink{chap:DWATbasetypes}{DW\-\_AT\-\_base\-\_types} attribute whose value is a reference.
270 \hypertarget{chap:DWATbasetypesprimitivedatatypesofcompilationunit}
272 \addtoindexx{base types attribute}
273 points to a debugging information entry
274 representing another compilation unit. It may be used
275 to specify the compilation unit containing the base type
276 entries used by entries in the current compilation unit
277 (see Section \refersec{chap:basetypeentries}).
279 This attribute provides a consumer a way to find the definition
280 of base types for a compilation unit that does not itself
281 contain such definitions. This allows a consumer, for example,
282 to interpret a type conversion to a base type
283 % getting this link target at the right spot is tricky.
284 \hypertarget{chap:DWATuseUTF8compilationunitusesutf8strings}
287 \item A \livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8} attribute,
288 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
289 which is a \livelink{chap:flag}{flag} whose
290 presence indicates that all strings (such as the names of
291 declared entities in the source program) are represented
292 using the UTF\dash 8 representation
293 (see Section \refersec{datarep:attributeencodings}).
296 \item A \livelink{chap:DWATmainsubprogram}{DW\-\_AT\-\_main\-\_subprogram} attribute, which is a \livelink{chap:flag}{flag}
297 \addtoindexx{main subprogram attribute}
298 whose presence indicates
299 \hypertarget{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}
300 that the compilation unit contains a
301 subprogram that has been identified as the starting function
302 of the program. If more than one compilation unit contains
303 this \nolink{flag}, any one of them may contain the starting function.
305 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
307 to specify and provide a user\dash specified name for the main
308 subroutine of a program.
309 \addtoindex{C} uses the name \doublequote{main} to identify
310 the main subprogram of a program. Some other languages provide
311 similar or other means to identify the main subprogram of
316 The base address of a compilation unit is defined as the
317 value of the \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute, if present; otherwise,
318 it is undefined. If the base address is undefined, then any
319 DWARF entry or structure defined in terms of the base address
320 of that compilation unit is not valid.
323 \subsection{Imported Unit Entries}
324 \label{chap:importedunitentries}
326 \hypertarget{chap:DWATimportimportedunit}
327 place where a normal or partial unit is imported is
328 represented by a debugging information entry with the
329 \addtoindexx{imported unit entry}
330 tag \livetarg{chap:DWTAGimportedunit}{DW\-\_TAG\-\_imported\-\_unit}.
331 An imported unit entry contains
332 \addtoindexx{import attribute}
334 \livelink{chap:DWATimport}{DW\-\_AT\-\_import} attribute
335 whose value is a reference to the
336 normal or partial compilation unit whose declarations logically
337 belong at the place of the imported unit entry.
339 \textit{An imported unit entry does not necessarily correspond to
340 any entity or construct in the source program. It is merely
341 \doublequote{glue} used to relate a partial unit, or a compilation
342 unit used as a partial unit, to a place in some other
345 \subsection{Separate Type Unit Entries}
346 \label{chap:separatetypeunitentries}
347 An object file may contain any number of separate type
348 unit entries, each representing a single complete type
350 Each \addtoindex{type unit} must be uniquely identified by
351 a 64\dash bit signature, stored as part of the type unit, which
352 can be used to reference the type definition from debugging
353 information entries in other compilation units and type units.
355 A type unit is represented by a debugging information entry
356 with the tag \livetarg{chap:DWTAGtypeunit}{DW\-\_TAG\-\_type\-\_unit}.
357 A \addtoindex{type unit entry} owns debugging
358 information entries that represent the definition of a single
359 type, plus additional debugging information entries that may
360 be necessary to include as part of the definition of the type.
362 A type unit entry may have a
363 \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language} attribute,
365 \addtoindexx{language attribute}
366 constant value is an integer code indicating the source
367 language used to define the type. The set of language names
368 and their meanings are given in Table \refersec{tab:languagenames}.
370 A \addtoindex{type unit} entry for a given type T owns a debugging
371 information entry that represents a defining declaration
372 of type T. If the type is nested within enclosing types or
373 namespaces, the debugging information entry for T is nested
374 within debugging information entries describing its containers;
375 otherwise, T is a direct child of the type unit entry.
377 A type unit entry may also own additional debugging information
378 entries that represent declarations of additional types that
379 are referenced by type T and have not themselves been placed in
380 separate type units. Like T, if an additional type U is nested
381 within enclosing types or namespaces, the debugging information
382 entry for U is nested within entries describing its containers;
383 otherwise, U is a direct child of the type unit entry.
385 The containing entries for types T and U are declarations,
386 and the outermost containing entry for any given type T or
387 U is a direct child of the type unit entry. The containing
388 entries may be shared among the additional types and between
389 T and the additional types.
391 \textit{Types are not required to be placed in type units. In general,
392 only large types such as structure, class, enumeration, and
393 union types included from header files should be considered
394 for separate type units. Base types and other small types
395 are not usually worth the overhead of placement in separate
396 type units. Types that are unlikely to be replicated, such
397 as those defined in the main source file, are also better
398 left in the main compilation unit.}
400 \section{Module, Namespace and Importing Entries}
401 \textit{Modules and namespaces provide a means to collect related
402 entities into a single entity and to manage the names of
405 \subsection{Module Entries}
406 \label{chap:moduleentries}
407 \textit{Several languages have the concept of a ``module.''
408 \addtoindexx{Modula-2}
409 A Modula\dash 2 definition module
410 \addtoindexx{Modula-2!definition module}
411 may be represented by a module
413 \addtoindex{declaration attribute}
414 (\livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration}). A
415 \addtoindex{Fortran 90} module
416 \addtoindexx{Fortran!module (Fortran 90)}
417 may also be represented by a module entry
418 (but no declaration attribute is warranted because \addtoindex{Fortran}
419 has no concept of a corresponding module body).}
421 A module is represented by a debugging information entry
423 tag \livetarg{chap:DWTAGmodule}{DW\-\_TAG\-\_module}.
424 Module entries may own other
425 debugging information entries describing program entities
426 whose declaration scopes end at the end of the module itself.
428 If the module has a name, the module entry has a
429 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
430 \addtoindexx{name attribute}
431 whose value is a null\dash terminated string containing
432 the module name as it appears in the source program.
434 The \addtoindex{module entry} may have either a
435 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
436 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc}
438 \addtoindexx{high PC attribute}
440 \addtoindexx{low PC attribute}
442 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
443 \addtoindexx{ranges attribute}
444 whose values encode the contiguous or non\dash contiguous address
445 ranges, respectively, of the machine instructions generated for
446 the module initialization code
447 (see Section \refersec{chap:codeaddressesandranges}).
448 \hypertarget{chap:DWATentrypcentryaddressofmoduleinitialization}
450 \addtoindexx{entry pc attribute!for module initialization}
452 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} attribute whose value is the address of
453 the first executable instruction of that initialization code
454 (see Section \refersec{chap:entryaddress}).
457 \hypertarget{chap:DWATprioritymodulepriority}
458 the module has been assigned a priority, it may have
459 \addtoindexx{priority attribute}
461 \livelink{chap:DWATpriority}{DW\-\_AT\-\_priority} attribute.
462 The value of this attribute is a
463 reference to another debugging information entry describing
464 a variable with a constant value. The value of this variable
465 is the actual constant value of the module\textquoteright s priority,
466 represented as it would be on the target architecture.
468 \subsection{Namespace Entries}
469 \label{chap:namespaceentries}
470 \textit{\addtoindex{C++} has the notion of a namespace, which provides a way to
471 \addtoindexx{namespace (C++)}
472 implement name hiding, so that names of unrelated things
473 do not accidentally clash in the
474 \addtoindex{global namespace} when an
475 application is linked together.}
477 A namespace is represented by a debugging information entry
479 tag \livetarg{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace}.
480 A namespace extension is
481 \hypertarget{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}
483 \livelink{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace} entry
485 \addtoindexx{extension attribute}
487 \livelink{chap:DWATextension}{DW\-\_AT\-\_extension}
488 attribute referring to the previous extension, or if there
489 is no previous extension, to the original
490 \livelink{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace}
491 entry. A namespace extension entry does not need to duplicate
492 information in a previous extension entry of the namespace
493 nor need it duplicate information in the original namespace
494 entry. (Thus, for a namespace with a name,
495 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
496 \addtoindexx{name attribute}
497 need only be attached directly to the original
498 \livelink{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace} entry.)
501 Namespace and namespace extension entries may own
502 \addtoindexx{namespace extension entry}
504 \addtoindexx{namespace declaration entry}
505 debugging information entries describing program entities
506 whose declarations occur in the namespace.
508 \textit{For \addtoindex{C++}, such
509 owned program entities may be declarations,
510 including certain declarations that are also object or
511 function definitions.}
513 If a type, variable, or function declared in a namespace is
514 defined outside of the body of the namespace declaration,
515 that type, variable, or function definition entry has a
516 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
517 \addtoindexx{specification attribute}
518 whose value is a reference to the
519 debugging information entry representing the declaration of
520 the type, variable or function. Type, variable, or function
522 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
523 \addtoindexx{specification attribute}
525 to duplicate information provided by the declaration entry
526 referenced by the specification attribute.
528 \textit{The \addtoindex{C++} \addtoindex{global namespace}
530 \addtoindexx{global namespace|see{namespace (C++), global}}
532 \addtoindexx{namespace (C++)!global}
534 ``::f'', for example) is not explicitly represented in
535 DWARF with a namespace entry (thus mirroring the situation
536 in \addtoindex{C++} source).
537 Global items may be simply declared with no
538 reference to a namespace.}
540 \textit{The \addtoindex{C++}
541 compilation unit specific ``unnamed namespace'' may
542 \addtoindexx{namespace (C++)!unnamed}
543 \addtoindexx{unnamed namespace|see {namespace (C++), unnamed}}
544 be represented by a namespace entry with no name attribute in
545 the original namespace declaration entry (and therefore no name
546 attribute in any namespace extension entry of this namespace).
549 \textit{A compiler emitting namespace information may choose to
550 explicitly represent namespace extensions, or to represent the
551 final namespace declaration of a compilation unit; this is a
552 quality\dash of\dash implementation issue and no specific requirements
553 are given here. If only the final namespace is represented,
554 \addtoindexx{namespace (C++)!using declaration}
555 it is impossible for a debugger to interpret using declaration
556 references in exactly the manner defined by the
557 \addtoindex{C++} language.
560 \textit{Emitting all namespace declaration information in all
561 compilation units can result in a significant increase in the
562 size of the debug information and significant duplication of
563 information across compilation units.
564 The \addtoindex{C++} namespace std,
566 \addtoindexx{namespace (C++)!std}
567 is large and will probably be referenced in
568 every \addtoindex{C++} compilation unit.
571 \textit{For a \addtoindex{C++} namespace example,
572 see Appendix \refersec{app:namespaceexample}.
577 \subsection{Imported (or Renamed) Declaration Entries}
578 \label{chap:importedorrenameddeclarationentries}
579 \textit{Some languages support the concept of importing into or making
580 accessible in a given unit declarations made in a different
581 module or scope. An imported declaration may sometimes be
586 imported declaration is represented by one or
587 \addtoindexx{imported declaration entry}
588 more debugging information entries with the
589 tag \livetarg{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration}.
591 \hypertarget{chap:DWATimportimporteddeclaration}
593 is imported, there is one imported declaration entry for
595 \addtoindexx{import attribute}
596 Each imported declaration entry has a
597 \livelink{chap:DWATimport}{DW\-\_AT\-\_import} attribute,
598 whose value is a reference to the
599 debugging information entry representing the declaration that
602 An imported declaration may also have a
603 \livelink{chap:DWATname}{DW\-\_AT\-\_name}
605 \addtoindexx{name attribute}
606 whose value is a null\dash terminated string containing the
607 name, as it appears in the source program, by which the
608 imported entity is to be known in the context of the imported
609 declaration entry (which may be different than the name of
610 the entity being imported). If no name is present, then the
611 name by which the entity is to be known is the same as the
612 name of the entity being imported.
614 An imported declaration entry with a name attribute may be
615 used as a general means to rename or provide an alias for
616 \addtoindexx{alias declaration|see{imported declaration entry}}
617 an entity, regardless of the context in which the importing
618 declaration or the imported entity occurs.
620 \textit{A \addtoindex{C++} namespace alias may be represented by an imported
621 \hypertarget{chap:DWATimportnamespacealias}
623 \addtoindexx{namespace (C++)!alias}
624 with a name attribute whose value is
625 a null\dash terminated string containing the alias name as it
626 appears in the source program and an import attribute whose
627 value is a reference to the applicable original namespace or
628 namespace extension entry.
631 \textit{A \addtoindex{C++} using declaration may be represented by one or more
632 \hypertarget{chap:DWATimportnamespaceusingdeclaration}
634 \addtoindexx{namespace (C++)!using declaration}
635 declaration entries. When the using declaration
636 refers to an overloaded function, there is one imported
637 declaration entry corresponding to each overloading. Each
638 imported declaration entry has no name attribute but it does
639 have an import attribute that refers to the entry for the
640 entity being imported. (\addtoindex{C++}
641 provides no means to ``rename''
642 an imported entity, other than a namespace).
645 \textit{A \addtoindex{Fortran} use statement
646 \addtoindexx{Fortran!use statement}
647 \addtoindexx{use statement|see {Fortran, use statement}}
648 with an ``only list'' may be
649 represented by a series of imported declaration entries,
650 one (or more) for each entity that is imported. An entity
651 \addtoindexx{renamed declaration|see{imported declaration entry}}
652 that is renamed in the importing context may be represented
653 by an imported declaration entry with a name attribute that
654 specifies the new local name.
657 \subsection{Imported Module Entries}
658 \label{chap:importedmoduleentries}
660 \textit{Some languages support the concept of importing into or making
661 accessible in a given unit all of the declarations contained
662 within a separate module or namespace.
665 An imported module declaration is represented by a debugging
666 information entry with
667 \addtoindexx{imported module attribute}
669 \addtoindexx{imported module entry}
670 tag \livetarg{chap:DWTAGimportedmodule}{DW\-\_TAG\-\_imported\-\_module}.
672 imported module entry contains a
673 \livelink{chap:DWATimport}{DW\-\_AT\-\_import} attribute
674 \addtoindexx{import attribute}
675 whose value is a reference to the module or namespace entry
676 containing the definition and/or declaration entries for
677 the entities that are to be imported into the context of the
678 imported module entry.
680 An imported module declaration may own a set of imported
681 declaration entries, each of which refers to an entry in the
682 module whose corresponding entity is to be known in the context
683 of the imported module declaration by a name other than its
684 name in that module. Any entity in the module that is not
685 renamed in this way is known in the context of the imported
686 module entry by the same name as it is declared in the module.
688 \textit{A \addtoindex{C++} using directive
689 \addtoindexx{namespace (C++)!using directive}
690 \addtoindexx{using directive|see {namespace (C++), using directive}}
691 may be represented by an imported module
692 \hypertarget{chap:DWATimportnamespaceusingdirective}
693 entry, with an import attribute referring to the namespace
694 entry of the appropriate extension of the namespace (which
695 might be the original namespace entry) and no owned entries.
698 \textit{A \addtoindex{Fortran} use statement
699 \addtoindexx{Fortran!use statement}
700 with a \doublequote{rename list} may be
701 represented by an imported module entry with an import
702 attribute referring to the module and owned entries
703 corresponding to those entities that are renamed as part of
707 \textit{A \addtoindex{Fortran} use statement
708 \addtoindexx{Fortran!use statement}
709 with neither a \doublequote{rename list} nor
710 an \doublequote{only list} may be represented by an imported module
711 entry with an import attribute referring to the module and
712 no owned child entries.
715 \textit{A use statement with an \doublequote{only list} is represented by a
716 series of individual imported declaration entries as described
717 in Section \refersec{chap:importedorrenameddeclarationentries}.
720 \textit{A \addtoindex{Fortran} use statement for an entity in a module that is
721 \addtoindexx{Fortran!use statement}
722 itself imported by a use statement without an explicit mention
723 may be represented by an imported declaration entry that refers
724 to the original debugging information entry. For example, given
741 \textit{the imported declaration entry for Q within module C refers
742 directly to the variable declaration entry for X in module A
743 because there is no explicit representation for X in module B.
746 \textit{A similar situation arises for a \addtoindex{C++} using declaration
747 \addtoindexx{namespace (C++)!using declaration}
748 \addtoindexx{using declaration|see {namespace (C++), using declaration}}
749 that imports an entity in terms of a namespace alias. See
750 Appendix \refersec{app:namespaceexample}
754 \section{Subroutine and Entry Point Entries}
755 \label{chap:subroutineandentrypointentries}
757 The following tags exist to describe
758 debugging information entries
759 \addtoindexx{function entry|see{subroutine entry}}
761 \addtoindexx{subroutine entry}
763 \addtoindexx{subprogram entry}
765 % FIXME: is entry point entry the right index 'entry'?
766 \addtoindexx{entry point entry}
769 \begin{tabular}{lp{9.0cm}}
770 \livetarg{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram} & A subroutine or function \\
771 \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine} & A particular inlined
772 \addtoindexx{inlined subprogram entry}
773 instance of a subroutine or function \\
774 \livetarg{chap:DWTAGentrypoint}{DW\-\_TAG\-\_entry\-\_point} & An alternate entry point \\
777 \subsection{General Subroutine and Entry Point Information}
778 \label{chap:generalsubroutineandentrypointinformation}
779 The subroutine or entry point entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name}
780 attribute whose value is a null-terminated string containing the
781 subroutine or entry point name as it appears in the source program.
782 It may also have a \livelink{chap:DWATlinkagename}{DW\-\_AT\-\_linkage\-\_name} attribute as
783 described in Section \refersec{chap:linkagenames}.
785 If the name of the subroutine described by an entry with the
786 \addtoindexx{subprogram entry}
787 tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}
788 is visible outside of its containing
789 \hypertarget{chap:DWATexternalexternalsubroutine}
790 compilation unit, that entry has
791 \addtoindexx{external attribute}
793 \livelink{chap:DWATexternal}{DW\-\_AT\-\_external} attribute,
794 which is a \livelink{chap:flag}{flag}.
796 \textit{Additional attributes for functions that are members of a
797 class or structure are described in
798 Section \refersec{chap:memberfunctionentries}.
802 \hypertarget{chap:DWATmainsubprogrammainorstartingsubprogram}
805 \livelink{chap:DWATmainsubprogram}{DW\-\_AT\-\_main\-\_subprogram}
807 \addtoindexx{main subprogram attribute}
809 a \livelink{chap:flag}{flag} whose presence indicates that the
810 subroutine has been identified as the starting function of
811 the program. If more than one subprogram contains this
813 any one of them may be the starting subroutine of the program.
815 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
816 which is used to specify
817 and provide a user\dash supplied name for the main subroutine of
821 \textit{A common debugger feature is to allow the debugger user to call
822 a subroutine within the subject program. In certain cases,
823 however, the generated code for a subroutine will not obey
824 the standard calling conventions for the target architecture
825 and will therefore not be safe to call from within a debugger.
828 A subroutine entry may
829 \hypertarget{chap:DWATcallingconventionsubprogramcallingconvention}
831 \livelink{chap:DWATcallingconvention}{DW\-\_AT\-\_calling\-\_convention}
832 attribute, whose value is an integer constant. The set of
833 calling convention codes is given in
834 Table \refersec{tab:callingconventioncodes}.
836 \begin{simplenametable}[1.4in]{Calling convention codes}{tab:callingconventioncodes}
837 \addtoindex{DW\-\_CC\-\_normal} \\
838 \addtoindex{DW\-\_CC\-\_program} \\
839 \addtoindex{DW\-\_CC\-\_nocall} \\
840 \end{simplenametable}
842 If this attribute is not present, or its value is the constant
843 \livetarg{chap:DWCCnormal}{DW\-\_CC\-\_normal}, then the subroutine may be safely called by
844 obeying the ``standard'' calling conventions of the target
845 architecture. If the value of the calling convention attribute
846 is the constant \livetarg{chap:DWCCnocall}{DW\-\_CC\-\_nocall}, the subroutine does not obey
847 standard calling conventions, and it may not be safe for the
848 debugger to call this subroutine.
850 If the semantics of the language of the compilation unit
851 containing the subroutine entry distinguishes between ordinary
852 subroutines and subroutines that can serve as the ``main
853 program,'' that is, subroutines that cannot be called
854 directly according to the ordinary calling conventions,
855 then the debugging information entry for such a subroutine
856 may have a calling convention attribute whose value is the
857 constant \livetarg{chap:DWCCprogram}{DW\-\_CC\-\_program}.
859 \textit{The \livelink{chap:DWCCprogram}{DW\-\_CC\-\_program}
860 value is intended to support \addtoindex{Fortran} main
861 \addtoindexx{Fortran!main program}
862 programs which in some implementations may not be callable
863 or which must be invoked in a special way. It is not intended
864 as a way of finding the entry address for the program.
867 \textit{In \addtoindex{C}
868 there is a difference between the types of functions
869 declared using function prototype style declarations and
870 those declared using non\dash prototype declarations.
873 A subroutine entry declared with a function prototype style
875 \addtoindexx{prototyped attribute}
877 \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped} attribute, which is
878 a \livelink{chap:flag}{flag}.
880 \textit{The \addtoindex{Fortran}
881 language allows the keywords elemental, pure
882 and recursive to be included as part of the declaration of
883 a subroutine; these attributes reflect that usage. These
884 attributes are not relevant for languages that do not support
885 similar keywords or syntax. In particular, the \livelink{chap:DWATrecursive}{DW\-\_AT\-\_recursive}
886 attribute is neither needed nor appropriate in languages such
888 where functions support recursion by default.
892 \hypertarget{chap:DWATelementalelementalpropertyofasubroutine}
894 \addtoindexx{elemental attribute}
896 \livelink{chap:DWATelemental}{DW\-\_AT\-\_elemental} attribute, which
897 is a \livelink{chap:flag}{flag}.
898 The attribute indicates whether the subroutine
899 or entry point was declared with the ``elemental'' keyword
903 \hypertarget{chap:DWATpurepurepropertyofasubroutine}
904 subprogram entry may have
905 \addtoindexx{pure attribute}
907 \livelink{chap:DWATpure}{DW\-\_AT\-\_pure} attribute, which is
908 a \livelink{chap:flag}{flag}.
909 The attribute indicates whether the subroutine was
910 declared with the ``pure'' keyword or property.
913 \hypertarget{chap:DWATrecursiverecursivepropertyofasubroutine}
914 subprogram entry may have a
915 \livelink{chap:DWATrecursive}{DW\-\_AT\-\_recursive} attribute, which
916 is a \livelink{chap:flag}{flag}.
917 The attribute indicates whether the subroutine
918 or entry point was declared with the ``recursive'' keyword
923 \subsection{Subroutine and Entry Point Return Types}
924 \label{chap:subroutineandentrypointreturntypes}
927 \hypertarget{chap:DWATtypetypeofsubroutinereturn}
928 the subroutine or entry point
929 \addtoindexx{return type of subroutine}
930 is a function that returns a
931 value, then its debugging information entry has
932 \addtoindexx{type attribute}
933 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
934 to denote the type returned by that function.
936 \textit{Debugging information entries for
937 \addtoindex{C} void functions should
938 not have an attribute for the return type. }
941 \subsection{Subroutine and Entry Point Locations}
942 \label{chap:subroutineandentrypointlocations}
944 A subroutine entry may have either a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
945 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of attributes or a \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
946 \addtoindexx{ranges attribute}
948 \addtoindexx{high PC attribute}
950 \addtoindexx{low PC attribute}
951 encode the contiguous or non\dash contiguous address
952 ranges, respectively, of the machine instructions generated
953 for the subroutine (see
954 Section \refersec{chap:codeaddressesandranges}).
957 \hypertarget{chap:DWATentrypcentryaddressofsubprogram}
958 subroutine entry may also have
959 \addtoindexx{entry pc attribute!for subroutine}
961 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} attribute
962 whose value is the address of the first executable instruction
963 of the subroutine (see
964 Section \refersec{chap:entryaddress}).
966 An entry point has a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute whose value is the
967 relocated address of the first machine instruction generated
971 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} attribute
972 \addtoindexx{entry pc attribute!for subroutine}
974 also seem appropriate
975 for this purpose, historically the
976 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute
978 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} was introduced (in
979 \addtoindex{DWARF Version 3}).
980 There is insufficient reason to change this.}
986 \addtoindexx{address class!attribute}
988 \hypertarget{chap:DWATaddressclasssubroutineorsubroutinetype}
990 \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment}
992 \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class} attributes,
993 as appropriate, to specify
994 which segments the code for the subroutine resides in and
995 the addressing mode to be used in calling that subroutine.
997 A subroutine entry representing a subroutine declaration
998 that is not also a definition does not have code address or
1002 \subsection{Declarations Owned by Subroutines and Entry Points}
1003 \label{chap:declarationsownedbysubroutinesandentrypoints}
1005 The declarations enclosed by a subroutine or entry point are
1006 represented by debugging information entries that are owned
1007 by the subroutine or entry point entry. Entries representing
1008 \addtoindexx{formal parameter}
1009 the formal parameters of the subroutine or entry point appear
1010 in the same order as the corresponding declarations in the
1013 \textit{There is no ordering requirement for entries for declarations
1014 that are children of subroutine or entry point entries but
1015 that do not represent formal parameters. The formal parameter
1016 entries may be interspersed with other entries used by formal
1017 parameter entries, such as type entries.}
1019 The unspecified parameters of a variable parameter list are
1020 represented by a debugging information entry\addtoindexx{unspecified parameters entry}
1022 \livetarg{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}.
1024 The entry for a subroutine that includes
1025 \addtoindexx{Fortran!common block}
1027 \addtoindex{Fortran} common block
1028 \livelink{chap:fortrancommonblock}{common}
1029 \livelink{chap:commonblockentry}{block}
1030 \addtoindexx{common block|see{Fortran common block}}
1031 has a child entry with the
1032 tag \livetarg{chap:DWTAGcommoninclusion}{DW\-\_TAG\-\_common\-\_inclusion}.
1034 \hypertarget{chap:commonreferencecommonblockusage}
1035 common inclusion entry has a
1036 \livelink{chap:DWATcommonreference}{DW\-\_AT\-\_common\-\_reference} attribute
1037 whose value is a reference to the debugging information entry
1038 for the common \nolink{block} being included
1039 (see Section \refersec{chap:commonblockentries}).
1041 \subsection{Low-Level Information}
1042 \label{chap:lowlevelinformation}
1045 \hypertarget{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}
1046 subroutine or entry point entry may have
1047 \addtoindexx{return address attribute}
1049 \livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr}
1050 attribute, whose value is a location description. The location
1051 calculated is the place where the return address for the
1052 subroutine or entry point is stored.
1055 \hypertarget{chap:DWATframebasesubroutineframebaseaddress}
1056 subroutine or entry point entry may also have
1057 \addtoindexx{frame base attribute}
1059 \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attribute, whose value is a location
1060 description that computes the \doublequote{frame base} for the
1061 subroutine or entry point. If the location description is
1062 a simple register location description, the given register
1063 contains the frame base address. If the location description is
1064 a DWARF expression, the result of evaluating that expression
1065 is the frame base address. Finally, for a
1066 \addtoindex{location list},
1067 this interpretation applies to each location description
1068 contained in the list of \addtoindex{location list} entries.
1070 \textit{The use of one of the \livelink{chap:DWOPreg}{DW\-\_OP\-\_reg}~\textless~n~\textgreater
1072 context is equivalent to using
1073 \livelink{chap:DWOPbreg}{DW\-\_OP\-\_breg}~\textless~n~\textgreater(0)
1075 compact. However, these are not equivalent in general.}
1078 \textit{The frame base for a procedure is typically an address fixed
1079 relative to the first unit of storage allocated for the
1080 procedure\textquoteright s stack frame. The \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attribute
1081 can be used in several ways:}
1082 \begin{enumerate}[1. ]
1083 \item \textit{In procedures that need
1084 \addtoindexx{location list}
1085 location lists to locate local
1086 variables, the \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} can hold the needed location
1087 list, while all variables\textquoteright\ location descriptions can be
1088 simpler ones involving the frame base.}
1090 \item \textit{It can be used in resolving ``up\dash level'' addressing
1091 within nested routines.
1092 (See also \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link}, below)}
1093 %The -See also- here is ok, the DW\-\_AT should be
1094 %a hyperref to the def itself, which is earlier in this document.
1097 \textit{Some languages support nested subroutines. In such languages,
1098 it is possible to reference the local variables of an
1099 outer subroutine from within an inner subroutine. The
1100 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link} and \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attributes allow
1101 debuggers to support this same kind of referencing.}
1104 \hypertarget{chap:DWATstaticlinklocationofuplevelframe}
1106 \addtoindexx{address!uplevel|see {static link attribute}}
1107 \addtoindexx{uplevel address|see {static link attribute}}
1108 subroutine or entry point is nested, it may have a
1109 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link}
1110 attribute, whose value is a location
1111 description that computes the frame base of the relevant
1112 instance of the subroutine that immediately encloses the
1113 subroutine or entry point.
1115 In the context of supporting nested subroutines, the
1116 \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attribute value should obey the following
1119 \begin{enumerate}[1. ]
1120 \item It should compute a value that does not change during the
1121 life of the procedure, and
1123 \item The computed value should be unique among instances of
1124 the same subroutine. (For typical \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} use, this
1125 means that a recursive subroutine\textquoteright s stack frame must have
1126 non\dash zero size.)
1129 \textit{If a debugger is attempting to resolve an up\dash level reference
1130 to a variable, it uses the nesting structure of DWARF to
1131 determine which subroutine is the lexical parent and the
1132 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link} value to identify the appropriate active
1133 frame of the parent. It can then attempt to find the reference
1134 within the context of the parent.}
1138 \subsection{Types Thrown by Exceptions}
1139 \label{chap:typesthrownbyexceptions}
1141 \textit{In \addtoindex{C++} a subroutine may declare a set of types which
1142 it may validly throw.}
1144 If a subroutine explicitly declares that it may throw
1145 \addtoindexx{exception thrown|see{thrown type entry}}
1147 \addtoindexx{thrown exception|see{thrown type entry}}
1148 exception of one or more types, each such type is
1149 represented by a debugging information entry with
1150 \addtoindexx{thrown type entry}
1152 \livetarg{chap:DWTAGthrowntype}{DW\-\_TAG\-\_thrown\-\_type}.
1153 Each such entry is a child of the entry
1154 representing the subroutine that may throw this type. Each
1155 thrown type entry contains
1156 \addtoindexx{type attribute}
1157 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, whose
1158 value is a reference to an entry describing the type of the
1159 exception that may be thrown.
1161 \subsection{Function Template Instantiations}
1162 \label{chap:functiontemplateinstantiations}
1164 \textit{In \addtoindex{C++}, a function template is a generic definition of
1165 a function that is instantiated differently for calls with
1166 values of different types. DWARF does not represent the generic
1167 template definition, but does represent each instantiation.}
1169 A \addtoindex{template instantiation} is represented by a debugging
1170 information entry with the
1171 \addtoindexx{subprogram entry!use for template instantiation}
1172 tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}.
1174 exceptions, such an entry will contain the same attributes and
1175 will have the same types of child entries as would an entry
1176 for a subroutine defined explicitly using the instantiation
1177 types. The exceptions are:
1179 \begin{enumerate}[1. ]
1180 \item Each formal parameterized type declaration appearing in the
1181 template definition is represented by a debugging information
1183 \addtoindexx{template type parameter entry}
1184 tag \livetarg{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}.
1186 such entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
1187 \addtoindexx{name attribute}
1189 null\dash terminated string containing the name of the formal
1190 type parameter as it appears in the source program. The
1191 \addtoindexx{formal type parameter|see{template type parameter entry}}
1192 template type parameter entry also has
1193 \addtoindexx{type attribute}
1194 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1195 describing the actual type by which the formal is replaced
1196 for this instantiation.
1198 \item The subprogram entry and each of its child entries reference
1199 a template type parameter entry in any circumstance where
1200 the template definition referenced a formal parameterized type.
1202 \item If the compiler has generated a special compilation unit
1203 to hold the template instantiation and that compilation unit
1204 has a different name from the compilation unit containing
1205 the template definition, the name attribute for the debugging
1206 information entry representing that compilation unit is empty
1209 \item If the subprogram entry representing the template
1210 instantiation or any of its child entries contain declaration
1211 coordinate attributes, those attributes refer to the source
1212 for the template definition, not to any source generated
1213 artificially by the compiler for this instantiation.
1218 \subsection{Inlinable and Inlined Subroutines}
1219 A declaration or a definition of an inlinable subroutine
1220 is represented by a debugging information entry with the
1222 \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}.
1224 \addtoindexx{subprogram entry!use in inlined subprogram}
1226 \hypertarget{chap:DWATinlineinlinedsubroutine}
1227 explicitly declared to be available for inline expansion or
1228 that was expanded inline implicitly by the compiler has
1229 \addtoindexx{inline attribute}
1231 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute whose value is an integer constant. The
1232 set of values for the \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute is given in
1233 Table \refersec{tab:inlinecodes}.
1237 \caption{Inline codes}
1238 \label{tab:inlinecodes}
1239 \begin{tabular}{l|p{8cm}}
1241 Name&Meaning\\ \hline
1242 \livetarg{chap:DWINLnotinlined}{DW\-\_INL\-\_not\-\_inlined} & Not declared inline nor inlined by the
1243 \mbox{compiler} (equivalent to the absence of the
1244 containing \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute) \\
1245 \livetarg{chap:DWINLinlined}{DW\-\_INL\-\_inlined} & Not declared inline but inlined by the \mbox{compiler} \\
1246 \livetarg{chap:DWINLdeclarednotinlined}{DW\-\_INL\-\_declared\-\_not\-\_inlined} & Declared inline but
1247 not inlined by the \mbox{compiler} \\
1248 \livetarg{chap:DWINLdeclaredinlined}{DW\-\_INL\-\_declared\-\_inlined} & Declared inline and inlined by the
1254 \textit{In \addtoindex{C++}, a function or a constructor declared with
1255 constexpr is implicitly declared inline. The abstract inline
1256 instance (see below) is represented by a debugging information
1257 entry with the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}. Such an entry has a
1258 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute whose value is \livelink{chap:DWINLinlined}{DW\-\_INL\-\_inlined}.}
1261 \subsubsection{Abstract Instances}
1262 \label{chap:abstractinstances}
1263 Any debugging information entry that is owned (either
1264 \hypertarget{chap:DWATinlineabstracttinstance}
1265 directly or indirectly) by a debugging information entry
1267 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute is referred to
1268 \addtoindexx{abstract instance!entry}
1269 as an ``abstract instance entry.''
1270 Any subroutine entry
1272 \addtoindexx{inline attribute}
1273 a \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute whose value is other
1274 than \livelink{chap:DWINLnotinlined}{DW\-\_INL\-\_not\-\_inlined}
1276 \addtoindexx{abstract instance!root}
1277 an ``abstract instance root.''
1278 Any set of abstract instance entries that are all
1279 children (either directly or indirectly) of some abstract
1280 instance root, together with the root itself, is known as
1281 \addtoindexx{abstract instance!tree}
1282 an ``abstract instance tree.'' However, in the case where
1283 an abstract instance tree is nested within another abstract
1284 instance tree, the entries in the
1285 \addtoindex{nested abstract instance}
1286 tree are not considered to be entries in the outer abstract
1289 Each abstract instance root is either part of a larger
1290 \addtoindexx{abstract instance!root}
1291 tree (which gives a context for the root) or
1292 \addtoindexx{specification attribute}
1294 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
1295 to refer to the declaration in context.
1297 \textit{For example, in \addtoindex{C++} the context might be a namespace
1298 declaration or a class declaration.}
1300 \textit{Abstract instance trees are defined so that no entry is part
1301 of more than one abstract instance tree. This simplifies the
1302 following descriptions.}
1304 A debugging information entry that is a member of an abstract
1305 instance tree should not contain any attributes which describe
1306 aspects of the subroutine which vary between distinct inlined
1307 expansions or distinct out\dash of\dash line expansions. For example,
1308 \addtoindexx{entry pc attribute!and abstract instance}
1309 the \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc},
1310 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc},
1311 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges},
1312 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc},
1313 \livelink{chap:DWATlocation}{DW\-\_AT\-\_location},
1314 \livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr},
1315 \livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope},
1317 \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment}
1319 \addtoindexx{location attribute!and abstract instance}
1321 \addtoindexx{ranges attribute!and abstract instance}
1323 \addtoindexx{high PC attribute!and abstract instance}
1325 \addtoindexx{low PC attribute!and abstract instance}
1327 \addtoindexx{segment attribute!and abstract instance}
1329 \addtoindexx{return address attribute!and abstract instance}
1331 \addtoindexx{segment attribute!and abstract instance}
1333 \addtoindexx{start scope attribute!and abstract instance}
1336 \textit{It would not make sense normally to put these attributes into
1337 abstract instance entries since such entries do not represent
1338 actual (concrete) instances and thus do not actually exist at
1339 run\dash time. However,
1340 see Appendix \refersec{app:inlineouteronenormalinner}
1341 for a contrary example.}
1343 The rules for the relative location of entries belonging to
1344 abstract instance trees are exactly the same as for other
1345 similar types of entries that are not abstract. Specifically,
1346 the rule that requires that an entry representing a declaration
1347 be a direct child of the entry representing the scope of the
1348 declaration applies equally to both abstract and non\dash abstract
1349 entries. Also, the ordering rules for formal parameter entries,
1350 member entries, and so on, all apply regardless of whether
1351 or not a given entry is abstract.
1353 \subsubsection{Concrete Inlined Instances}
1354 \label{chap:concreteinlinedinstances}
1356 Each inline expansion of a subroutine is represented
1357 by a debugging information entry with the
1358 tag \livetarg{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}.
1359 Each such entry should be a direct
1360 child of the entry that represents the scope within which
1361 the inlining occurs.
1363 Each inlined subroutine entry may have either a
1364 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc}
1365 and \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair
1367 \addtoindexx{high PC attribute}
1369 \addtoindexx{low PC attribute}
1371 \addtoindexx{ranges attribute}
1373 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges}
1374 attribute whose values encode the contiguous or non\dash contiguous
1375 address ranges, respectively, of the machine instructions
1376 generated for the inlined subroutine (see
1377 Section \refersec{chap:codeaddressesandranges}).
1379 \hypertarget{chap:DWATentrypcentryaddressofinlinedsubprogram}
1380 inlined subroutine entry may
1381 \addtoindexx{inlined subprogram entry!in concrete instance}
1383 \addtoindexx{inlined subprogram entry}
1385 \addtoindexx{entry pc attribute!for inlined subprogram}
1387 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc}
1388 attribute, representing the first executable instruction of
1389 the inline expansion (see
1390 Section \refersec{chap:entryaddress}).
1392 % Positions of the 3 targets here is a bit arbitrary.
1394 \hypertarget{chap:DWATcalllinelinenumberofinlinedsubroutinecall}
1396 \hypertarget{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}
1398 \hypertarget{chap:DWATcallfilefilecontaininginlinedsubroutinecall}
1399 may also have \livelink{chap:DWATcallfile}{DW\-\_AT\-\_call\-\_file},
1400 \livelink{chap:DWATcallline}{DW\-\_AT\-\_call\-\_line} and \livelink{chap:DWATcallcolumn}{DW\-\_AT\-\_call\-\_column} attributes,
1402 value is an integer constant. These attributes represent the
1403 source file, source line number, and source column number,
1404 respectively, of the first character of the statement or
1405 expression that caused the inline expansion. The call file,
1406 call line, and call column attributes are interpreted in
1407 the same way as the declaration file, declaration line, and
1408 declaration column attributes, respectively (see
1409 Section \refersec{chap:declarationcoordinates}).
1411 \textit{The call file, call line and call column coordinates do not
1412 describe the coordinates of the subroutine declaration that
1413 was inlined, rather they describe the coordinates of the call.
1416 An inlined subroutine entry
1417 \hypertarget{chap:DWATconstexprcompiletimeconstantfunction}
1419 \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr}
1420 attribute, which is a \livelink{chap:flag}{flag}
1421 whose presence indicates that the
1422 subroutine has been evaluated as a compile\dash time constant. Such
1423 an entry may also have a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute,
1424 whose value may be of any form that is appropriate for the
1425 representation of the subroutine's return value. The value of
1426 this attribute is the actual return value of the subroutine,
1427 represented as it would be on the target architecture.
1429 \textit{In \addtoindex{C++}, if a function or a constructor declared with constexpr
1430 is called with constant expressions, then the corresponding
1431 concrete inlined instance has a
1432 \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr} attribute,
1433 as well as a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute whose value represents
1434 the actual return value of the concrete inlined instance.}
1436 Any debugging information entry that is owned (either
1437 directly or indirectly) by a debugging information entry
1438 with the tag \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine} is referred to as a
1439 ``concrete inlined instance entry.'' Any entry that has
1441 \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}
1442 is known as a ``concrete inlined instance root.''
1443 Any set of concrete inlined instance
1444 entries that are all children (either directly or indirectly)
1445 of some concrete inlined instance root, together with the root
1446 itself, is known as a ``concrete inlined instance tree.''
1447 However, in the case where a concrete inlined instance tree
1448 is nested within another concrete instance tree, the entries
1449 in the \addtoindex{nested concrete inline instance} tree
1450 are not considered to
1451 be entries in the outer concrete instance tree.
1453 \textit{Concrete inlined instance trees are defined so that no entry
1454 is part of more than one concrete inlined instance tree. This
1455 simplifies later descriptions.}
1457 Each concrete inlined instance tree is uniquely associated
1458 with one (and only one) abstract instance tree.
1460 \textit{Note, however, that the reverse is not true. Any given abstract
1461 instance tree may be associated with several different concrete
1462 inlined instance trees, or may even be associated with zero
1463 concrete inlined instance trees.}
1465 Concrete inlined instance entries may omit attributes that
1466 are not specific to the concrete instance (but present in
1467 the abstract instance) and need include only attributes that
1468 are specific to the concrete instance (but omitted in the
1469 abstract instance). In place of these omitted attributes, each
1470 \hypertarget{chap:DWATabstractorigininlineinstance}
1471 concrete inlined instance entry
1472 \addtoindexx{abstract origin attribute}
1474 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin}
1475 attribute that may be used to obtain the missing information
1476 (indirectly) from the associated abstract instance entry. The
1477 value of the abstract origin attribute is a reference to the
1478 associated abstract instance entry.
1480 If an entry within a concrete inlined instance tree contains
1481 attributes describing the
1482 \addtoindexx{declaration coordinates!in concrete instance}
1483 declaration coordinates
1485 entry, then those attributes should refer to the file, line
1486 and column of the original declaration of the subroutine,
1487 not to the point at which it was inlined. As a consequence,
1488 they may usually be omitted from any entry that has an abstract
1491 For each pair of entries that are associated via a
1492 \addtoindexx{abstract origin attribute}
1493 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin} attribute, both members of the pair
1494 have the same tag. So, for example, an entry with the tag
1495 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable} can only be associated with another entry
1496 that also has the tag \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}. The only exception
1497 to this rule is that the root of a concrete instance tree
1498 (which must always have the tag \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine})
1499 can only be associated with the root of its associated abstract
1500 instance tree (which must have the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}).
1502 In general, the structure and content of any given concrete
1503 inlined instance tree will be closely analogous to the
1504 structure and content of its associated abstract instance
1505 tree. There are a few exceptions:
1507 \begin{enumerate}[1. ]
1508 \item An entry in the concrete instance tree may be omitted if
1510 \addtoindexx{abstract origin attribute}
1511 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin} attribute and either
1512 has no children, or its children are omitted. Such entries
1513 would provide no useful information. In C\dash like languages,
1514 such entries frequently include types, including structure,
1515 union, class, and interface types; and members of types. If any
1516 entry within a concrete inlined instance tree needs to refer
1517 to an entity declared within the scope of the relevant inlined
1518 subroutine and for which no concrete instance entry exists,
1519 the reference should refer to the abstract instance entry.
1521 \item Entries in the concrete instance tree which are associated
1522 with entries in the abstract instance tree such that neither
1523 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
1524 \addtoindexx{name attribute}
1525 and neither is referenced by
1526 any other debugging information entry, may be omitted. This
1527 may happen for debugging information entries in the abstract
1528 instance trees that became unnecessary in the concrete instance
1529 tree because of additional information available there. For
1530 example, an anonymous variable might have been created and
1531 described in the abstract instance tree, but because of
1532 the actual parameters for a particular inlined expansion,
1533 it could be described as a constant value without the need
1534 for that separate debugging information entry.
1536 \item A concrete instance tree may contain entries which do
1537 not correspond to entries in the abstract instance tree
1538 to describe new entities that are specific to a particular
1539 inlined expansion. In that case, they will not have associated
1540 entries in the abstract instance tree, should not contain
1541 \addtoindexx{abstract origin attribute}
1542 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin} attributes, and must contain all their
1543 own attributes directly. This allows an abstract instance tree
1544 to omit debugging information entries for anonymous entities
1545 that are unlikely to be needed in most inlined expansions. In
1546 any expansion which deviates from that expectation, the
1547 entries can be described in its concrete inlined instance tree.
1551 \subsubsection{Out-of-Line Instances of Inlined Subroutines}
1552 \label{chap:outoflineinstancesofinlinedsubroutines}
1553 Under some conditions, compilers may need to generate concrete
1554 executable instances of inlined subroutines other than at
1555 points where those subroutines are actually called. Such
1556 concrete instances of inlined subroutines are referred to as
1557 ``concrete out\dash of\dash line instances.''
1559 \textit{In \addtoindex{C++}, for example,
1560 taking the address of a function declared
1561 to be inline can necessitate the generation of a concrete
1562 out\dash of\dash line instance of the given function.}
1564 The DWARF representation of a concrete out\dash of\dash line instance
1565 of an inlined subroutine is essentially the same as for a
1566 concrete inlined instance of that subroutine (as described in
1567 the preceding section). The representation of such a concrete
1568 % It is critical that the hypertarget and livelink be
1569 % separated to avoid problems with latex.
1570 out\dash of\dash line
1571 \addtoindexx{abstract origin attribute}
1573 \hypertarget{chap:DWATabstractoriginoutoflineinstance}
1575 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin}
1576 attributes in exactly the same way as they are used for
1577 a concrete inlined instance (that is, as references to
1578 corresponding entries within the associated abstract instance
1581 The differences between the DWARF representation of a
1582 concrete out\dash of\dash line instance of a given subroutine and the
1583 representation of a concrete inlined instance of that same
1584 subroutine are as follows:
1586 \begin{enumerate}[1. ]
1587 \item The root entry for a concrete out\dash of\dash line instance
1588 of a given inlined subroutine has the same tag as does its
1589 associated (abstract) inlined subroutine entry (that is, tag
1590 \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram} rather than \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}).
1592 \item The root entry for a concrete out\dash of\dash line instance tree
1593 is normally owned by the same parent entry that also owns
1594 the root entry of the associated abstract instance. However,
1595 it is not required that the abstract and out\dash of\dash line instance
1596 trees be owned by the same parent entry.
1600 \subsubsection{Nested Inlined Subroutines}
1601 \label{nestedinlinedsubroutines}
1602 Some languages and compilers may permit the logical nesting of
1603 a subroutine within another subroutine, and may permit either
1604 the outer or the nested subroutine, or both, to be inlined.
1606 For a non\dash inlined subroutine nested within an inlined
1607 subroutine, the nested subroutine is described normally in
1608 both the abstract and concrete inlined instance trees for
1609 the outer subroutine. All rules pertaining to the abstract
1610 and concrete instance trees for the outer subroutine apply
1611 also to the abstract and concrete instance entries for the
1614 For an inlined subroutine nested within another inlined
1615 subroutine, the following rules apply to their abstract and
1616 \addtoindexx{abstract instance!nested}
1617 \addtoindexx{concrete instance!nested}
1618 concrete instance trees:
1620 \begin{enumerate}[1. ]
1621 \item The abstract instance tree for the nested subroutine is
1622 described within the abstract instance tree for the outer
1623 subroutine according to the rules in
1624 Section \refersec{chap:abstractinstances}, and
1625 without regard to the fact that it is within an outer abstract
1628 \item Any abstract instance tree for a nested subroutine is
1629 always omitted within the concrete instance tree for an
1632 \item A concrete instance tree for a nested subroutine is
1633 always omitted within the abstract instance tree for an
1636 \item The concrete instance tree for any inlined or
1637 \addtoindexx{out-of-line instance}
1639 \addtoindexx{out-of-line-instance|see{concrete out-of-line-instance}}
1640 expansion of the nested subroutine is described within a
1641 concrete instance tree for the outer subroutine according
1643 Sections \refersec{chap:concreteinlinedinstances} or
1644 \refersec{chap:outoflineinstancesofinlinedsubroutines}
1646 and without regard to the fact that it is within an outer
1647 concrete instance tree.
1650 See Appendix \refersec{app:inliningexamples}
1651 for discussion and examples.
1653 \subsection{Trampolines}
1654 \label{chap:trampolines}
1656 \textit{A trampoline is a compiler\dash generated subroutine that serves as
1657 \hypertarget{chap:DWATtrampolinetargetsubroutine}
1658 an intermediary in making a call to another subroutine. It may
1659 adjust parameters and/or the result (if any) as appropriate
1660 to the combined calling and called execution contexts.}
1662 A trampoline is represented by a debugging information entry
1663 \addtoindexx{trampoline (subprogam) entry}
1664 with the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram} or \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}
1666 \addtoindexx{trampoline attribute}
1667 a \livelink{chap:DWATtrampoline}{DW\-\_AT\-\_trampoline} attribute.
1669 attribute indicates the target subroutine of the trampoline,
1670 that is, the subroutine to which the trampoline passes
1671 control. (A trampoline entry may but need not also have a
1672 \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial} attribute.)
1675 The value of the trampoline attribute may be represented
1676 using any of the following forms, which are listed in order
1680 \item If the value is of class reference, then the value
1681 specifies the debugging information entry of the target
1684 \item If the value is of class address, then the value is
1685 the relocated address of the target subprogram.
1687 \item If the value is of class string, then the value is the
1688 (possibly mangled) \addtoindexx{mangled names}
1689 name of the target subprogram.
1691 \item If the value is of class \livelink{chap:flag}{flag}, then the value true
1692 indicates that the containing subroutine is a trampoline but
1693 that the target subroutine is not known.
1697 The target subprogram may itself be a trampoline. (A sequence
1698 of trampolines necessarily ends with a non\dash trampoline
1701 \textit{In \addtoindex{C++}, trampolines may be used
1702 to implement derived virtual
1703 member functions; such trampolines typically adjust the
1704 \addtoindexx{this parameter}
1705 implicit this pointer parameter in the course of passing
1707 Other languages and environments may use trampolines
1708 in a manner sometimes known as transfer functions or transfer
1711 \textit{Trampolines may sometimes pass control to the target
1712 subprogram using a branch or jump instruction instead of a
1713 call instruction, thereby leaving no trace of their existence
1714 in the subsequent execution context. }
1716 \textit{This attribute helps make it feasible for a debugger to arrange
1717 that stepping into a trampoline or setting a breakpoint in
1718 a trampoline will result in stepping into or setting the
1719 breakpoint in the target subroutine instead. This helps to
1720 hide the compiler generated subprogram from the user. }
1722 \textit{If the target subroutine is not known, a debugger may choose
1723 to repeatedly step until control arrives in a new subroutine
1724 which can be assumed to be the target subroutine. }
1728 \section{Lexical Block Entries}
1729 \label{chap:lexicalblockentries}
1732 lexical \livetargi{chap:lexicalblock}{block}{lexical block}
1734 \addtoindexx{lexical block}
1735 a bracketed sequence of source statements
1736 that may contain any number of declarations. In some languages
1737 (including \addtoindex{C} and \addtoindex{C++}),
1738 \nolink{blocks} can be nested within other
1739 \nolink{blocks} to any depth.}
1741 % We do not need to link to the preceding paragraph.
1742 A lexical \nolink{block} is represented by a debugging information
1744 tag \livetarg{chap:DWTAGlexicalblock}{DW\-\_TAG\-\_lexical\-\_block}.
1746 The lexical \livetargi{chap:lexicalblockentry}{block}{lexical block entry}
1748 either a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
1749 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of
1751 \addtoindexx{high PC attribute}
1753 \addtoindexx{low PC attribute}
1755 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
1756 \addtoindexx{ranges attribute}
1757 whose values encode the contiguous or non-contiguous address
1758 ranges, respectively, of the machine instructions generated
1759 for the lexical \nolink{block}
1760 (see Section \refersec{chap:codeaddressesandranges}).
1762 If a name has been given to the
1763 lexical \nolink{block}
1765 program, then the corresponding
1766 lexical \nolink{block} entry has a
1767 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose
1768 \addtoindexx{name attribute}
1769 value is a null\dash terminated string
1770 containing the name of the lexical \nolink{block}
1774 \textit{This is not the same as a \addtoindex{C} or
1775 \addtoindex{C++} label (see below).}
1777 The lexical \nolink{block} entry owns
1778 debugging information entries that
1779 describe the declarations within that lexical \nolink{block}.
1781 one such debugging information entry for each local declaration
1782 of an identifier or inner lexical \nolink{block}.
1784 \section{Label Entries}
1785 \label{chap:labelentries}
1786 \textit{A label is a way of identifying a source statement. A labeled
1787 statement is usually the target of one or more ``go to''
1791 A label is represented by a debugging information entry with
1792 \addtoindexx{label entry}
1794 tag \livetarg{chap:DWTAGlabel}{DW\-\_TAG\-\_label}.
1795 The entry for a label should be owned by
1796 the debugging information entry representing the scope within
1797 which the name of the label could be legally referenced within
1800 The label entry has a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute whose value
1801 is the relocated address of the first machine instruction
1802 generated for the statement identified by the label in
1803 the source program. The label entry also has a
1804 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1805 \addtoindexx{name attribute}
1806 whose value is a null-terminated string containing
1807 the name of the label as it appears in the source program.
1810 \section{With Statement Entries}
1811 \label{chap:withstatemententries}
1813 \textit{Both \addtoindex{Pascal} and
1814 \addtoindexx{Modula-2}
1815 Modula\dash 2 support the concept of a ``with''
1816 statement. The with statement specifies a sequence of
1817 executable statements within which the fields of a record
1818 variable may be referenced, unqualified by the name of the
1821 A with statement is represented by a
1822 \addtoindexi{debugging information entry}{with statement entry}
1823 with the tag \livetarg{chap:DWTAGwithstmt}{DW\-\_TAG\-\_with\-\_stmt}.
1825 A with statement entry may have either a
1826 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
1827 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of attributes
1828 \addtoindexx{high PC attribute}
1830 \addtoindexx{low PC attribute}
1831 a \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
1832 \addtoindexx{ranges attribute}
1833 whose values encode the contiguous or non\dash contiguous address
1834 ranges, respectively, of the machine instructions generated
1835 for the with statement
1836 (see Section \refersec{chap:codeaddressesandranges}).
1838 The with statement entry has
1839 \addtoindexx{type attribute}
1840 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, denoting
1841 the type of record whose fields may be referenced without full
1842 qualification within the body of the statement. It also has
1843 \addtoindexx{location attribute}
1844 a \livelink{chap:DWATlocation}{DW\-\_AT\-\_location} attribute, describing how to find the base
1845 address of the record object referenced within the body of
1848 \section{Try and Catch Block Entries}
1849 \label{chap:tryandcatchblockentries}
1851 \textit{In \addtoindex{C++} a lexical \livelink{chap:lexicalblock}{block} may be
1852 designated as a ``catch \nolink{block}.''
1853 A catch \livetargi{chap:catchblock}{block}{catch block} is an
1854 exception handler that handles
1855 exceptions thrown by an immediately
1856 preceding ``try \livelink{chap:tryblock}{block}.''
1857 A catch \livelink{chap:catchblock}{block}
1858 designates the type of the exception that it
1861 A try \livetargi{chap:tryblock}{block}{try block} is represented
1862 by a debugging information entry
1863 \addtoindexx{try block entry}
1864 with the tag \livetarg{chap:DWTAGtryblock}{DW\-\_TAG\-\_try\-\_block}.
1865 A catch \livelink{chap:catchblock}{block} is represented by
1866 a debugging information entry with
1867 \addtoindexx{catch block entry}
1868 the tag \livetarg{chap:DWTAGcatchblock}{DW\-\_TAG\-\_catch\-\_block}.
1870 % nolink as we have links just above and do not have a combo link for both
1871 Both try and catch \nolink{block} entries may have either a
1872 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
1873 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of attributes
1874 \addtoindexx{high PC attribute}
1876 \addtoindexx{low PC attribute}
1878 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
1879 \addtoindexx{ranges attribute}
1880 whose values encode the contiguous
1881 or non\dash contiguous address ranges, respectively, of the
1882 machine instructions generated for the \livelink{chap:lexicalblock}{block}
1884 \refersec{chap:codeaddressesandranges}).
1886 Catch \livelink{chap:catchblock}{block} entries have at
1887 least one child entry, an
1888 entry representing the type of exception accepted by
1889 that catch \livelink{chap:catchblock}{block}.
1890 This child entry has one of
1891 \addtoindexx{formal parameter entry!in catch block}
1893 \addtoindexx{unspecified parameters entry!in catch block}
1895 \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter} or
1896 \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters},
1897 and will have the same form as other parameter entries.
1899 The siblings immediately following
1900 a try \livelink{chap:tryblock}{block} entry are its
1901 corresponding catch \livelink{chap:catchblock}{block} entries.