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
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 \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 \doublequote{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 \doublequote{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\textquoteright 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.)
500 Namespace and namespace extension entries may own
501 \addtoindexx{namespace extension entry}
503 \addtoindexx{namespace declaration entry}
504 debugging information entries describing program entities
505 whose declarations occur in the namespace.
507 \textit{For \addtoindex{C++}, such
508 owned program entities may be declarations,
509 including certain declarations that are also object or
510 function definitions.}
512 If a type, variable, or function declared in a namespace is
513 defined outside of the body of the namespace declaration,
514 that type, variable, or function definition entry has a
515 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
516 \addtoindexx{specification attribute}
517 whose value is a reference to the
518 debugging information entry representing the declaration of
519 the type, variable or function. Type, variable, or function
521 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
522 \addtoindexx{specification attribute}
524 to duplicate information provided by the declaration entry
525 referenced by the specification attribute.
527 \textit{The \addtoindex{C++} \addtoindex{global namespace}
529 \addtoindexx{global namespace|see{namespace (C++), global}}
531 \addtoindexx{namespace (C++)!global}
533 ``::f'', for example) is not explicitly represented in
534 DWARF with a namespace entry (thus mirroring the situation
535 in \addtoindex{C++} source).
536 Global items may be simply declared with no
537 reference to a namespace.}
539 \textit{The \addtoindex{C++}
540 compilation unit specific ``unnamed namespace'' may
541 \addtoindexx{namespace (C++)!unnamed}
542 \addtoindexx{unnamed namespace|see {namespace (C++), unnamed}}
543 be represented by a namespace entry with no name attribute in
544 the original namespace declaration entry (and therefore no name
545 attribute in any namespace extension entry of this namespace).
548 \textit{A compiler emitting namespace information may choose to
549 explicitly represent namespace extensions, or to represent the
550 final namespace declaration of a compilation unit; this is a
551 quality\dash of\dash implementation issue and no specific requirements
552 are given here. If only the final namespace is represented,
553 \addtoindexx{namespace (C++)!using declaration}
554 it is impossible for a debugger to interpret using declaration
555 references in exactly the manner defined by the
556 \addtoindex{C++} language.
559 \textit{Emitting all namespace declaration information in all
560 compilation units can result in a significant increase in the
561 size of the debug information and significant duplication of
562 information across compilation units.
563 The \addtoindex{C++} namespace std,
565 \addtoindexx{namespace (C++)!std}
566 is large and will probably be referenced in
567 every \addtoindex{C++} compilation unit.
570 \textit{For a \addtoindex{C++} namespace example,
571 see Appendix \refersec{app:namespaceexample}.
576 \subsection{Imported (or Renamed) Declaration Entries}
577 \label{chap:importedorrenameddeclarationentries}
578 \textit{Some languages support the concept of importing into or making
579 accessible in a given unit declarations made in a different
580 module or scope. An imported declaration may sometimes be
585 imported declaration is represented by one or
586 \addtoindex{imported declaration entry}
587 more debugging information entries with the
588 tag \livetarg{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration}.
590 \hypertarget{chap:DWATimportimporteddeclaration}
592 is imported, there is one imported declaration entry for
594 \addtoindexx{import attribute}
595 Each imported declaration entry has a
596 \livelink{chap:DWATimport}{DW\-\_AT\-\_import} attribute,
597 whose value is a reference to the
598 debugging information entry representing the declaration that
601 An imported declaration may also have a
602 \livelink{chap:DWATname}{DW\-\_AT\-\_name}
604 \addtoindexx{name attribute}
605 whose value is a null\dash terminated string containing the
606 name, as it appears in the source program, by which the
607 imported entity is to be known in the context of the imported
608 declaration entry (which may be different than the name of
609 the entity being imported). If no name is present, then the
610 name by which the entity is to be known is the same as the
611 name of the entity being imported.
613 An imported declaration entry with a name attribute may be
614 used as a general means to rename or provide an alias for
615 \addtoindexx{alias declaration|see{imported declaration entry}}
616 an entity, regardless of the context in which the importing
617 declaration or the imported entity occurs.
619 \textit{A \addtoindex{C++} namespace alias may be represented by an imported
620 \hypertarget{chap:DWATimportnamespacealias}
622 \addtoindexx{namespace (C++)!alias}
623 with a name attribute whose value is
624 a null\dash terminated string containing the alias name as it
625 appears in the source program and an import attribute whose
626 value is a reference to the applicable original namespace or
627 namespace extension entry.
630 \textit{A \addtoindex{C++} using declaration may be represented by one or more
631 \hypertarget{chap:DWATimportnamespaceusingdeclaration}
633 \addtoindexx{namespace (C++)!using declaration}
634 declaration entries. When the using declaration
635 refers to an overloaded function, there is one imported
636 declaration entry corresponding to each overloading. Each
637 imported declaration entry has no name attribute but it does
638 have an import attribute that refers to the entry for the
639 entity being imported. (\addtoindex{C++}
640 provides no means to ``rename''
641 an imported entity, other than a namespace).
644 \textit{A \addtoindex{Fortran} use statement
645 \addtoindexx{Fortran!use statement}
646 \addtoindexx{use statement|see {Fortran, use statement}}
647 with an ``only list'' may be
648 represented by a series of imported declaration entries,
649 one (or more) for each entity that is imported. An entity
650 \addtoindexx{renamed declaration|see{imported declaration entry}}
651 that is renamed in the importing context may be represented
652 by an imported declaration entry with a name attribute that
653 specifies the new local name.
656 \subsection{Imported Module Entries}
657 \label{chap:importedmoduleentries}
659 \textit{Some languages support the concept of importing into or making
660 accessible in a given unit all of the declarations contained
661 within a separate module or namespace.
664 An imported module declaration is represented by a debugging
665 information entry with
666 \addtoindexx{imported module attribute}
668 \addtoindexx{imported module entry}
669 tag \livetarg{chap:DWTAGimportedmodule}{DW\-\_TAG\-\_imported\-\_module}.
671 imported module entry contains a
672 \livelink{chap:DWATimport}{DW\-\_AT\-\_import} attribute
673 \addtoindexx{import attribute}
674 whose value is a reference to the module or namespace entry
675 containing the definition and/or declaration entries for
676 the entities that are to be imported into the context of the
677 imported module entry.
679 An imported module declaration may own a set of imported
680 declaration entries, each of which refers to an entry in the
681 module whose corresponding entity is to be known in the context
682 of the imported module declaration by a name other than its
683 name in that module. Any entity in the module that is not
684 renamed in this way is known in the context of the imported
685 module entry by the same name as it is declared in the module.
687 \textit{A \addtoindex{C++} using directive
688 \addtoindexx{namespace (C++)!using directive}
689 \addtoindexx{using directive|see {namespace (C++), using directive}}
690 may be represented by an imported module
691 \hypertarget{chap:DWATimportnamespaceusingdirective}
692 entry, with an import attribute referring to the namespace
693 entry of the appropriate extension of the namespace (which
694 might be the original namespace entry) and no owned entries.
697 \textit{A \addtoindex{Fortran} use statement
698 \addtoindexx{Fortran!use statement}
699 with a \doublequote{rename list} may be
700 represented by an imported module entry with an import
701 attribute referring to the module and owned entries
702 corresponding to those entities that are renamed as part of
706 \textit{A \addtoindex{Fortran} use statement
707 \addtoindexx{Fortran!use statement}
708 with neither a \doublequote{rename list} nor
709 an \doublequote{only list} may be represented by an imported module
710 entry with an import attribute referring to the module and
711 no owned child entries.
714 \textit{A use statement with an \doublequote{only list} is represented by a
715 series of individual imported declaration entries as described
716 in Section \refersec{chap:importedorrenameddeclarationentries}.
719 \textit{A \addtoindex{Fortran} use statement for an entity in a module that is
720 \addtoindexx{Fortran!use statement}
721 itself imported by a use statement without an explicit mention
722 may be represented by an imported declaration entry that refers
723 to the original debugging information entry. For example, given
740 \textit{the imported declaration entry for Q within module C refers
741 directly to the variable declaration entry for A in module A
742 because there is no explicit representation for X in module B.
745 \textit{A similar situation arises for a \addtoindex{C++} using declaration
746 \addtoindexx{namespace (C++)!using declaration}
747 \addtoindexx{using declaration|see {namespace (C++), using declaration}}
748 that imports an entity in terms of a namespace alias. See
749 Appendix \refersec{app:namespaceexample}
753 \section{Subroutine and Entry Point Entries}
754 \label{chap:subroutineandentrypointentries}
756 The following tags exist to describe
757 debugging information entries
758 \addtoindexx{function entry|see{subroutine entry}}
760 \addtoindexx{subroutine entry}
762 \addtoindexx{subprogram entry}
764 % FIXME: is entry point entry the right index 'entry'?
765 \addtoindexx{entry point entry}
768 \begin{tabular}{lp{9.0cm}}
769 \livetarg{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram} & A subroutine or function \\
770 \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine} & A particular inlined
771 \addtoindexx{inlined subprogram entry}
772 instance of a subroutine or function \\
773 \livetarg{chap:DWTAGentrypoint}{DW\-\_TAG\-\_entry\-\_point} & An alternate entry point \\
776 \subsection{General Subroutine and Entry Point Information}
777 \label{chap:generalsubroutineandentrypointinformation}
778 The subroutine or entry point entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name}
779 attribute whose value is a null-terminated string containing the
780 subroutine or entry point name as it appears in the source.
781 It may also have a \livelink{chap:DWATlinkagename}{DW\-\_AT\-\_linkage\-\_name} attribute as
782 described in Section \refersec{chap:linkagenames}.
784 If the name of the subroutine described by an entry with the
785 \addtoindex{subprogram entry}
786 tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}
787 is visible outside of its containing
788 \hypertarget{chap:DWATexternalexternalsubroutine}
789 compilation unit, that entry has
790 \addtoindexx{external attribute}
792 \livelink{chap:DWATexternal}{DW\-\_AT\-\_external} attribute,
793 which is a \livelink{chap:flag}{flag}.
795 \textit{Additional attributes for functions that are members of a
796 class or structure are described in
797 Section \refersec{chap:memberfunctionentries}.
801 \hypertarget{chap:DWATmainsubprogrammainorstartingsubprogram}
804 \livelink{chap:DWATmainsubprogram}{DW\-\_AT\-\_main\-\_subprogram}
806 \addtoindexx{main subprogram attribute}
808 a \livelink{chap:flag}{flag} whose presence indicates that the
809 subroutine has been identified as the starting function of
810 the program. If more than one subprogram contains this
812 any one of them may be the starting subroutine of the program.
814 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
815 which is used to specify
816 and provide a user\dash supplied name for the main subroutine of
820 \textit{A common debugger feature is to allow the debugger user to call
821 a subroutine within the subject program. In certain cases,
822 however, the generated code for a subroutine will not obey
823 the standard calling conventions for the target architecture
824 and will therefore not be safe to call from within a debugger.
827 A subroutine entry may
828 \hypertarget{chap:DWATcallingconventionsubprogramcallingconvention}
830 \livelink{chap:DWATcallingconvention}{DW\-\_AT\-\_calling\-\_convention}
831 attribute, whose value is an integer constant. The set of
832 calling convention codes is given in
833 Table \refersec{tab:callingconventioncodes}.
835 \begin{simplenametable}[1.4in]{Calling convention codes}{tab:callingconventioncodes}
836 \addtoindex{DW\-\_CC\-\_normal} \\
837 \addtoindex{DW\-\_CC\-\_program} \\
838 \addtoindex{DW\-\_CC\-\_nocall} \\
839 \end{simplenametable}
841 If this attribute is not present, or its value is the constant
842 \livetarg{chap:DWCCnormal}{DW\-\_CC\-\_normal}, then the subroutine may be safely called by
843 obeying the ``standard'' calling conventions of the target
844 architecture. If the value of the calling convention attribute
845 is the constant \livetarg{chap:DWCCnocall}{DW\-\_CC\-\_nocall}, the subroutine does not obey
846 standard calling conventions, and it may not be safe for the
847 debugger to call this subroutine.
849 If the semantics of the language of the compilation unit
850 containing the subroutine entry distinguishes between ordinary
851 subroutines and subroutines that can serve as the ``main
852 program,'' that is, subroutines that cannot be called
853 directly according to the ordinary calling conventions,
854 then the debugging information entry for such a subroutine
855 may have a calling convention attribute whose value is the
856 constant \livetarg{chap:DWCCprogram}{DW\-\_CC\-\_program}.
858 \textit{The \livelink{chap:DWCCprogram}{DW\-\_CC\-\_program}
859 value is intended to support \addtoindex{Fortran} main
860 \addtoindexx{Fortran!main program}
861 programs which in some implementations may not be callable
862 or which must be invoked in a special way. It is not intended
863 as a way of finding the entry address for the program.
866 \textit{In \addtoindex{C}
867 there is a difference between the types of functions
868 declared using function prototype style declarations and
869 those declared using non\dash prototype declarations.
872 A subroutine entry declared with a function prototype style
874 \addtoindexx{prototyped attribute}
876 \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped} attribute, which is
877 a \livelink{chap:flag}{flag}.
879 \textit{The \addtoindex{Fortran}
880 language allows the keywords elemental, pure
881 and recursive to be included as part of the declaration of
882 a subroutine; these attributes reflect that usage. These
883 attributes are not relevant for languages that do not support
884 similar keywords or syntax. In particular, the \livelink{chap:DWATrecursive}{DW\-\_AT\-\_recursive}
885 attribute is neither needed nor appropriate in languages such
887 where functions support recursion by default.
891 \hypertarget{chap:DWATelementalelementalpropertyofasubroutine}
893 \addtoindexx{elemental attribute}
895 \livelink{chap:DWATelemental}{DW\-\_AT\-\_elemental} attribute, which
896 is a \livelink{chap:flag}{flag}.
897 The attribute indicates whether the subroutine
898 or entry point was declared with the ``elemental'' keyword
902 \hypertarget{chap:DWATpurepurepropertyofasubroutine}
903 subprogram entry may have
904 \addtoindexx{pure attribute}
906 \livelink{chap:DWATpure}{DW\-\_AT\-\_pure} attribute, which is
907 a \livelink{chap:flag}{flag}.
908 The attribute indicates whether the subroutine was
909 declared with the ``pure'' keyword or property.
912 \hypertarget{chap:DWATrecursiverecursivepropertyofasubroutine}
913 subprogram entry may have a
914 \livelink{chap:DWATrecursive}{DW\-\_AT\-\_recursive} attribute, which
915 is a \livelink{chap:flag}{flag}.
916 The attribute indicates whether the subroutine
917 or entry point was declared with the ``recursive'' keyword
922 \subsection{Subroutine and Entry Point Return Types}
923 \label{chap:subroutineandentrypointreturntypes}
926 \hypertarget{chap:DWATtypetypeofsubroutinereturn}
927 the subroutine or entry point
928 \addtoindexx{return type of subroutine}
929 is a function that returns a
930 value, then its debugging information entry has
931 \addtoindexx{type attribute}
932 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
933 to denote the type returned by that function.
935 \textit{Debugging information entries for
936 \addtoindex{C} void functions should
937 not have an attribute for the return type. }
940 \subsection{Subroutine and Entry Point Locations}
941 \label{chap:subroutineandentrypointlocations}
943 A subroutine entry may have either a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
944 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of attributes or a \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
945 \addtoindexx{ranges attribute}
947 \addtoindexx{high PC attribute}
949 \addtoindexx{low PC attribute}
950 encode the contiguous or non\dash contiguous address
951 ranges, respectively, of the machine instructions generated
952 for the subroutine (see
953 Section \refersec{chap:codeaddressesandranges}).
956 \hypertarget{chap:DWATentrypcentryaddressofsubprogram}
957 subroutine entry may also have
958 \addtoindexx{entry pc attribute!for subroutine}
960 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} attribute
961 whose value is the address of the first executable instruction
962 of the subroutine (see
963 Section \refersec{chap:entryaddress}).
965 An entry point has a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute whose value is the
966 relocated address of the first machine instruction generated
970 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} attribute
971 \addtoindexx{entry pc attribute!for subroutine}
973 also seem appropriate
974 for this purpose, historically the
975 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute
977 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} was introduced (in
978 \addtoindex{DWARF Version 3}).
979 There is insufficient reason to change this.}
985 \addtoindexx{address class!attribute}
987 \hypertarget{chap:DWATaddressclasssubroutineorsubroutinetype}
989 \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment}
991 \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class} attributes,
992 as appropriate, to specify
993 which segments the code for the subroutine resides in and
994 the addressing mode to be used in calling that subroutine.
996 A subroutine entry representing a subroutine declaration
997 that is not also a definition does not have code address or
1001 \subsection{Declarations Owned by Subroutines and Entry Points}
1002 \label{chap:declarationsownedbysubroutinesandentrypoints}
1004 The declarations enclosed by a subroutine or entry point are
1005 represented by debugging information entries that are owned
1006 by the subroutine or entry point entry. Entries representing
1007 \addtoindexx{formal parameter}
1008 the formal parameters of the subroutine or entry point appear
1009 in the same order as the corresponding declarations in the
1012 \textit{There is no ordering requirement for entries for declarations
1013 that are children of subroutine or entry point entries but
1014 that do not represent formal parameters. The formal parameter
1015 entries may be interspersed with other entries used by formal
1016 parameter entries, such as type entries.}
1018 The unspecified parameters of a variable parameter list are
1019 represented by a debugging information entry\addtoindexx{unspecified parameters entry}
1021 \livetarg{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}.
1023 The entry for a subroutine that includes
1024 \addtoindexx{Fortran!common block}
1026 \addtoindex{Fortran} common block
1027 \livelink{chap:fortrancommonblock}{common}
1028 \livelink{chap:commonblockentry}{block}
1029 \addtoindexx{common block|see{Fortran common block}}
1030 has a child entry with the
1031 tag \livetarg{chap:DWTAGcommoninclusion}{DW\-\_TAG\-\_common\-\_inclusion}.
1033 \hypertarget{chap:commonreferencecommonblockusage}
1034 common inclusion entry has a
1035 \livelink{chap:DWATcommonreference}{DW\-\_AT\-\_common\-\_reference} attribute
1036 whose value is a reference to the debugging information entry
1037 for the common \nolink{block} being included
1038 (see Section \refersec{chap:commonblockentries}).
1040 \subsection{Low-Level Information}
1041 \label{chap:lowlevelinformation}
1044 \hypertarget{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}
1045 subroutine or entry point entry may have
1046 \addtoindexx{return address attribute}
1048 \livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr}
1049 attribute, whose value is a location description. The location
1050 calculated is the place where the return address for the
1051 subroutine or entry point is stored.
1054 \hypertarget{chap:DWATframebasesubroutineframebaseaddress}
1055 subroutine or entry point entry may also have
1056 \addtoindexx{frame base attribute}
1058 \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attribute, whose value is a location
1059 description that computes the \doublequote{frame base} for the
1060 subroutine or entry point. If the location description is
1061 a simple register location description, the given register
1062 contains the frame base address. If the location description is
1063 a DWARF expression, the result of evaluating that expression
1064 is the frame base address. Finally, for a
1065 \addtoindex{location list},
1066 this interpretation applies to each location description
1067 contained in the list of \addtoindex{location list} entries.
1069 \textit{The use of one of the \livelink{chap:DWOPreg}{DW\-\_OP\-\_reg}~\textless~n~\textgreater
1071 context is equivalent to using
1072 \livelink{chap:DWOPbreg}{DW\-\_OP\-\_breg}~\textless~n~\textgreater(0)
1074 compact. However, these are not equivalent in general.}
1077 \textit{The frame base for a procedure is typically an address fixed
1078 relative to the first unit of storage allocated for the
1079 procedure\textquoteright s stack frame. The \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attribute
1080 can be used in several ways:}
1081 \begin{enumerate}[1. ]
1082 \item \textit{In procedures that need
1083 \addtoindexx{location list}
1084 location lists to locate local
1085 variables, the \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} can hold the needed location
1086 list, while all variables\textquoteright\ location descriptions can be
1087 simpler ones involving the frame base.}
1089 \item \textit{It can be used in resolving ``up\dash level'' addressing
1090 within nested routines.
1091 (See also \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link}, below)}
1092 %The -See also- here is ok, the DW\-\_AT should be
1093 %a hyperref to the def itself, which is earlier in this document.
1096 \textit{Some languages support nested subroutines. In such languages,
1097 it is possible to reference the local variables of an
1098 outer subroutine from within an inner subroutine. The
1099 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link} and \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attributes allow
1100 debuggers to support this same kind of referencing.}
1103 \hypertarget{chap:DWATstaticlinklocationofuplevelframe}
1105 \addtoindexx{address!uplevel|see {static link attribute}}
1106 \addtoindexx{uplevel address|see {static link attribute}}
1107 subroutine or entry point is nested, it may have a
1108 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link}
1109 attribute, whose value is a location
1110 description that computes the frame base of the relevant
1111 instance of the subroutine that immediately encloses the
1112 subroutine or entry point.
1114 In the context of supporting nested subroutines, the
1115 \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attribute value should obey the following
1118 \begin{enumerate}[1. ]
1119 \item It should compute a value that does not change during the
1120 life of the procedure, and
1122 \item The computed value should be unique among instances of
1123 the same subroutine. (For typical \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} use, this
1124 means that a recursive subroutine\textquoteright s stack frame must have
1125 non\dash zero size.)
1128 \textit{If a debugger is attempting to resolve an up\dash level reference
1129 to a variable, it uses the nesting structure of DWARF to
1130 determine which subroutine is the lexical parent and the
1131 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link} value to identify the appropriate active
1132 frame of the parent. It can then attempt to find the reference
1133 within the context of the parent.}
1137 \subsection{Types Thrown by Exceptions}
1138 \label{chap:typesthrownbyexceptions}
1140 \textit{In \addtoindex{C++} a subroutine may declare a set of types which
1141 it may validly throw.}
1143 If a subroutine explicitly declares that it may throw
1144 \addtoindexx{exception thrown|see{thrown type entry}}
1146 \addtoindexx{thrown exception|see{thrown type entry}}
1147 exception for one or more types, each such type is
1148 represented by a debugging information entry with
1149 \addtoindexx{thrown type entry}
1151 \livetarg{chap:DWTAGthrowntype}{DW\-\_TAG\-\_thrown\-\_type}.
1152 Each such entry is a child of the entry
1153 representing the subroutine that may throw this type. Each
1154 thrown type entry contains
1155 \addtoindexx{type attribute}
1156 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, whose
1157 value is a reference to an entry describing the type of the
1158 exception that may be thrown.
1160 \subsection{Function Template Instantiations}
1161 \label{chap:functiontemplateinstantiations}
1163 \textit{In \addtoindex{C++}, a function template is a generic definition of
1164 a function that is instantiated differently when called with
1165 values of different types. DWARF does not represent the generic
1166 template definition, but does represent each instantiation.}
1168 A \addtoindex{template instantiation} is represented by a debugging
1169 information entry with the
1170 \addtoindexx{subprogram entry!use for template instantiation}
1171 tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}.
1173 exceptions, such an entry will contain the same attributes and
1174 will have the same types of child entries as would an entry
1175 for a subroutine defined explicitly using the instantiation
1176 types. The exceptions are:
1178 \begin{enumerate}[1. ]
1179 \item Each formal parameterized type declaration appearing in the
1180 template definition is represented by a debugging information
1182 \addtoindexx{template type parameter entry}
1183 tag \livetarg{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}.
1185 such entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
1186 \addtoindexx{name attribute}
1188 null\dash terminated string containing the name of the formal
1189 type parameter as it appears in the source program. The
1190 \addtoindexx{formal type parameter|see{template type parameter entry}}
1191 template type parameter entry also has
1192 \addtoindexx{type attribute}
1193 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1194 describing the actual type by which the formal is replaced
1195 for this instantiation.
1197 \item The subprogram entry and each of its child entries reference
1198 a template type parameter entry in any circumstance where
1199 the template definition referenced a formal parameterized type.
1201 \item If the compiler has generated a special compilation unit
1202 to hold the template instantiation and that compilation unit
1203 has a different name from the compilation unit containing
1204 the template definition, the name attribute for the debugging
1205 information entry representing that compilation unit is empty
1208 \item If the subprogram entry representing the template
1209 instantiation or any of its child entries contain declaration
1210 coordinate attributes, those attributes refer to the source
1211 for the template definition, not to any source generated
1212 artificially by the compiler for this instantiation.
1217 \subsection{Inlinable and Inlined Subroutines}
1218 A declaration or a definition of an inlinable subroutine
1219 is represented by a debugging information entry with the
1221 \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}.
1223 \addtoindexx{subprogram entry!use in inlined subprogram}
1225 \hypertarget{chap:DWATinlineinlinedsubroutine}
1226 explicitly declared to be available for inline expansion or
1227 that was expanded inline implicitly by the compiler has
1228 \addtoindexx{inline attribute}
1230 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute whose value is an integer constant. The
1231 set of values for the \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute is given in
1232 Table \refersec{tab:inlinecodes}.
1236 \caption{Inline codes}
1237 \label{tab:inlinecodes}
1238 \begin{tabular}{l|p{9cm}}
1240 Name&Meaning\\ \hline
1241 \livetarg{chap:DWINLnotinlined}{DW\-\_INL\-\_not\-\_inlined} & Not declared inline nor inlined by the
1242 compiler (equivalent to the absence of the containing \break
1243 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute) \\
1244 \livetarg{chap:DWINLinlined}{DW\-\_INL\-\_inlined} & Not declared inline but inlined by the compiler \\
1245 \livetarg{chap:DWINLdeclarednotinlined}{DW\-\_INL\-\_declared\-\_not\-\_inlined} & Declared inline but
1246 not inlined by the compiler \\
1247 \livetarg{chap:DWINLdeclaredinlined}{DW\-\_INL\-\_declared\-\_inlined} & Declared inline and inlined by the compiler \\
1252 \textit{In \addtoindex{C++}, a function or a constructor declared with
1253 constexpr is implicitly declared inline. The abstract inline
1254 instance (see below) is represented by a debugging information
1255 entry with the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}. Such an entry has a
1256 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute whose value is \livelink{chap:DWINLinlined}{DW\-\_INL\-\_inlined}.}
1259 \subsubsection{Abstract Instances}
1260 \label{chap:abstractinstances}
1261 Any debugging information entry that is owned (either
1262 \hypertarget{chap:DWATinlineabstracttinstance}
1263 directly or indirectly) by a debugging information entry
1265 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute is referred to
1266 \addtoindexx{abstract instance!entry}
1267 as an ``abstract instance entry.''
1268 Any subroutine entry
1270 \addtoindexx{inline attribute}
1271 a \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute whose value is other
1272 than \livelink{chap:DWINLnotinlined}{DW\-\_INL\-\_not\-\_inlined}
1274 \addtoindexx{abstract instance!root}
1275 an ``abstract instance root.''
1276 Any set of abstract instance entries that are all
1277 children (either directly or indirectly) of some abstract
1278 instance root, together with the root itself, is known as
1279 \addtoindexx{abstract instance!tree}
1280 an ``abstract instance tree.'' However, in the case where
1281 an abstract instance tree is nested within another abstract
1282 instance tree, the entries in the
1283 \addtoindex{nested abstract instance}
1284 tree are not considered to be entries in the outer abstract
1287 Each abstract instance root is either part of a larger
1288 \addtoindexx{abstract instance!root}
1289 tree (which gives a context for the root) or
1290 \addtoindexx{specification attribute}
1292 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
1293 to refer to the declaration in context.
1295 \textit{For example, in \addtoindex{C++} the context might be a namespace
1296 declaration or a class declaration.}
1298 \textit{Abstract instance trees are defined so that no entry is part
1299 of more than one abstract instance tree. This simplifies the
1300 following descriptions.}
1302 A debugging information entry that is a member of an abstract
1303 instance tree should not contain any attributes which describe
1304 aspects of the subroutine which vary between distinct inlined
1305 expansions or distinct out\dash of\dash line expansions. For example,
1306 \addtoindexx{entry pc attribute!and abstract instance}
1307 the \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc},
1308 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc},
1309 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges},
1310 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc},
1311 \livelink{chap:DWATlocation}{DW\-\_AT\-\_location},
1312 \livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr}, \livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope},
1314 \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment!and abstract instance}
1316 \addtoindexx{location attribute!and abstract instance}
1318 \addtoindexx{ranges attribute!and abstract instance}
1320 \addtoindexx{high PC attribute!and abstract instance}
1322 \addtoindexx{low PC attribute!and abstract instance}
1324 \addtoindex{segment attribute!and abstract instance}
1326 \addtoindexx{return address attribute!and abstract instance}
1328 \addtoindexx{segment attribute!and abstract instance}
1330 \addtoindexx{start scope attribute!and abstract instance}
1333 \textit{It would not make sense normally to put these attributes into
1334 abstract instance entries since such entries do not represent
1335 actual (concrete) instances and thus do not actually exist at
1336 run\dash time. However,
1337 see Appendix \refersec{app:inlineouteronenormalinner}
1338 for a contrary example.}
1340 The rules for the relative location of entries belonging to
1341 abstract instance trees are exactly the same as for other
1342 similar types of entries that are not abstract. Specifically,
1343 the rule that requires that an entry representing a declaration
1344 be a direct child of the entry representing the scope of the
1345 declaration applies equally to both abstract and non\dash abstract
1346 entries. Also, the ordering rules for formal parameter entries,
1347 member entries, and so on, all apply regardless of whether
1348 or not a given entry is abstract.
1350 \subsubsection{Concrete Inlined Instances}
1351 \label{chap:concreteinlinedinstances}
1353 Each inline expansion of a subroutine is represented
1354 by a debugging information entry with the
1355 tag \livetarg{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}.
1356 Each such entry should be a direct
1357 child of the entry that represents the scope within which
1358 the inlining occurs.
1360 Each inlined subroutine entry may have either a
1361 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc}
1362 and \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair
1364 \addtoindexx{high PC attribute}
1366 \addtoindexx{low PC attribute}
1368 \addtoindexx{ranges attribute}
1370 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges}
1371 attribute whose values encode the contiguous or non\dash contiguous
1372 address ranges, respectively, of the machine instructions
1373 generated for the inlined subroutine (see
1374 Section \refersec{chap:codeaddressesandranges}).
1376 \hypertarget{chap:DWATentrypcentryaddressofinlinedsubprogram}
1377 inlined subroutine entry may
1378 \addtoindexx{inlined subprogram entry!in concrete instance}
1380 \addtoindexx{inlined subprogram entry}
1382 \addtoindexx{entry pc attribute!for inlined subprogram}
1384 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc}
1385 attribute, representing the first executable instruction of
1386 the inline expansion (see
1387 Section \refersec{chap:entryaddress}).
1389 % Positions of the 3 targets here is a bit arbitrary.
1391 \hypertarget{chap:DWATcalllinelinenumberofinlinedsubroutinecall}
1393 \hypertarget{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}
1395 \hypertarget{chap:DWATcallfilefilecontaininginlinedsubroutinecall}
1396 may also have \livelink{chap:DWATcallfile}{DW\-\_AT\-\_call\-\_file},
1397 \livelink{chap:DWATcallline}{DW\-\_AT\-\_call\-\_line} and \livelink{chap:DWATcallcolumn}{DW\-\_AT\-\_call\-\_column} attributes,
1399 value is an integer constant. These attributes represent the
1400 source file, source line number, and source column number,
1401 respectively, of the first character of the statement or
1402 expression that caused the inline expansion. The call file,
1403 call line, and call column attributes are interpreted in
1404 the same way as the declaration file, declaration line, and
1405 declaration column attributes, respectively (see
1406 Section \refersec{chap:declarationcoordinates}).
1408 \textit{The call file, call line and call column coordinates do not
1409 describe the coordinates of the subroutine declaration that
1410 was inlined, rather they describe the coordinates of the call.
1413 An inlined subroutine entry
1414 \hypertarget{chap:DWATconstexprcompiletimeconstantfunction}
1416 \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr}
1417 attribute, which is a \livelink{chap:flag}{flag}
1418 whose presence indicates that the
1419 subroutine has been evaluated as a compile\dash time constant. Such
1420 an entry may also have a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute,
1421 whose value may be of any form that is appropriate for the
1422 representation of the subroutine's return value. The value of
1423 this attribute is the actual return value of the subroutine,
1424 represented as it would be on the target architecture.
1426 \textit{In \addtoindex{C++}, if a function or a constructor declared with constexpr
1427 is called with constant expressions, then the corresponding
1428 concrete inlined instance has a
1429 \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr} attribute,
1430 as well as a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute whose value represents
1431 the actual return value of the concrete inlined instance.}
1433 Any debugging information entry that is owned (either
1434 directly or indirectly) by a debugging information entry
1435 with the tag \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine} is referred to as a
1436 ``concrete inlined instance entry.'' Any entry that has
1438 \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}
1439 is known as a ``concrete inlined instance root.''
1440 Any set of concrete inlined instance
1441 entries that are all children (either directly or indirectly)
1442 of some concrete inlined instance root, together with the root
1443 itself, is known as a ``concrete inlined instance tree.''
1444 However, in the case where a concrete inlined instance tree
1445 is nested within another concrete instance tree, the entries
1446 in the \addtoindex{nested concrete inline instance} tree
1447 are not considered to
1448 be entries in the outer concrete instance tree.
1450 \textit{Concrete inlined instance trees are defined so that no entry
1451 is part of more than one concrete inlined instance tree. This
1452 simplifies later descriptions.}
1454 Each concrete inlined instance tree is uniquely associated
1455 with one (and only one) abstract instance tree.
1457 \textit{Note, however, that the reverse is not true. Any given abstract
1458 instance tree may be associated with several different concrete
1459 inlined instance trees, or may even be associated with zero
1460 concrete inlined instance trees.}
1462 Concrete inlined instance entries may omit attributes that
1463 are not specific to the concrete instance (but present in
1464 the abstract instance) and need include only attributes that
1465 are specific to the concrete instance (but omitted in the
1466 abstract instance). In place of these omitted attributes, each
1467 \hypertarget{chap:DWATabstractorigininlineinstance}
1468 concrete inlined instance entry
1469 \addtoindexx{abstract origin attribute}
1471 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin}
1472 attribute that may be used to obtain the missing information
1473 (indirectly) from the associated abstract instance entry. The
1474 value of the abstract origin attribute is a reference to the
1475 associated abstract instance entry.
1477 If an entry within a concrete inlined instance tree contains
1478 attributes describing the
1479 \addtoindexx{declaration coordinates!in concrete instance}
1480 declaration coordinates
1482 entry, then those attributes should refer to the file, line
1483 and column of the original declaration of the subroutine,
1484 not to the point at which it was inlined. As a consequence,
1485 they may usually be omitted from any entry that has an abstract
1488 For each pair of entries that are associated via a
1489 \addtoindexx{abstract origin attribute}
1490 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin} attribute, both members of the pair
1491 have the same tag. So, for example, an entry with the tag
1492 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable} can only be associated with another entry
1493 that also has the tag \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}. The only exception
1494 to this rule is that the root of a concrete instance tree
1495 (which must always have the tag \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine})
1496 can only be associated with the root of its associated abstract
1497 instance tree (which must have the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}).
1499 In general, the structure and content of any given concrete
1500 inlined instance tree will be closely analogous to the
1501 structure and content of its associated abstract instance
1502 tree. There are a few exceptions:
1504 \begin{enumerate}[1. ]
1505 \item An entry in the concrete instance tree may be omitted if
1507 \addtoindexx{abstract origin attribute}
1508 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin} attribute and either
1509 has no children, or its children are omitted. Such entries
1510 would provide no useful information. In C\dash like languages,
1511 such entries frequently include types, including structure,
1512 union, class, and interface types; and members of types. If any
1513 entry within a concrete inlined instance tree needs to refer
1514 to an entity declared within the scope of the relevant inlined
1515 subroutine and for which no concrete instance entry exists,
1516 the reference should refer to the abstract instance entry.
1518 \item Entries in the concrete instance tree which are associated
1519 with entries in the abstract instance tree such that neither
1520 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
1521 \addtoindexx{name attribute}
1522 and neither is referenced by
1523 any other debugging information entry, may be omitted. This
1524 may happen for debugging information entries in the abstract
1525 instance trees that became unnecessary in the concrete instance
1526 tree because of additional information available there. For
1527 example, an anonymous variable might have been created and
1528 described in the abstract instance tree, but because of
1529 the actual parameters for a particular inlined expansion,
1530 it could be described as a constant value without the need
1531 for that separate debugging information entry.
1533 \item A concrete instance tree may contain entries which do
1534 not correspond to entries in the abstract instance tree
1535 to describe new entities that are specific to a particular
1536 inlined expansion. In that case, they will not have associated
1537 entries in the abstract instance tree, should not contain
1538 \addtoindexx{abstract origin attribute}
1539 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin} attributes, and must contain all their
1540 own attributes directly. This allows an abstract instance tree
1541 to omit debugging information entries for anonymous entities
1542 that are unlikely to be needed in most inlined expansions. In
1543 any expansion which deviates from that expectation, the
1544 entries can be described in its concrete inlined instance tree.
1548 \subsubsection{Out-of-Line Instances of Inlined Subroutines}
1549 \label{chap:outoflineinstancesofinlinedsubroutines}
1550 Under some conditions, compilers may need to generate concrete
1551 executable instances of inlined subroutines other than at
1552 points where those subroutines are actually called. Such
1553 concrete instances of inlined subroutines are referred to as
1554 ``concrete out\dash of\dash line instances.''
1556 \textit{In \addtoindex{C++}, for example,
1557 taking the address of a function declared
1558 to be inline can necessitate the generation of a concrete
1559 out\dash of\dash line instance of the given function.}
1561 The DWARF representation of a concrete out\dash of\dash line instance
1562 of an inlined subroutine is essentially the same as for a
1563 concrete inlined instance of that subroutine (as described in
1564 the preceding section). The representation of such a concrete
1565 % It is critical that the hypertarget and livelink be
1566 % separated to avoid problems with latex.
1567 out\dash of\dash line
1568 \addtoindexx{abstract origin attribute}
1570 \hypertarget{chap:DWATabstractoriginoutoflineinstance}
1572 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin}
1573 attributes in exactly the same way as they are used for
1574 a concrete inlined instance (that is, as references to
1575 corresponding entries within the associated abstract instance
1578 The differences between the DWARF representation of a
1579 concrete out\dash of\dash line instance of a given subroutine and the
1580 representation of a concrete inlined instance of that same
1581 subroutine are as follows:
1583 \begin{enumerate}[1. ]
1584 \item The root entry for a concrete out\dash of\dash line instance
1585 of a given inlined subroutine has the same tag as does its
1586 associated (abstract) inlined subroutine entry (that is, tag
1587 \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram} rather than \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}).
1589 \item The root entry for a concrete out\dash of\dash line instance tree
1590 is normally owned by the same parent entry that also owns
1591 the root entry of the associated abstract instance. However,
1592 it is not required that the abstract and out\dash of\dash line instance
1593 trees be owned by the same parent entry.
1597 \subsubsection{Nested Inlined Subroutines}
1598 \label{nestedinlinedsubroutines}
1599 Some languages and compilers may permit the logical nesting of
1600 a subroutine within another subroutine, and may permit either
1601 the outer or the nested subroutine, or both, to be inlined.
1603 For a non\dash inlined subroutine nested within an inlined
1604 subroutine, the nested subroutine is described normally in
1605 both the abstract and concrete inlined instance trees for
1606 the outer subroutine. All rules pertaining to the abstract
1607 and concrete instance trees for the outer subroutine apply
1608 also to the abstract and concrete instance entries for the
1611 For an inlined subroutine nested within another inlined
1612 subroutine, the following rules apply to their abstract and
1613 \addtoindexx{abstract instance!nested}
1614 \addtoindexx{concrete instance!nested}
1615 concrete instance trees:
1617 \begin{enumerate}[1. ]
1618 \item The abstract instance tree for the nested subroutine is
1619 described within the abstract instance tree for the outer
1620 subroutine according to the rules in
1621 Section \refersec{chap:abstractinstances}, and
1622 without regard to the fact that it is within an outer abstract
1625 \item Any abstract instance tree for a nested subroutine is
1626 always omitted within the concrete instance tree for an
1629 \item A concrete instance tree for a nested subroutine is
1630 always omitted within the abstract instance tree for an
1633 \item The concrete instance tree for any inlined or
1634 \addtoindexx{out-of-line instance}
1636 \addtoindexx{out-of-line-instance|see{concrete out-of-line-instance}}
1637 expansion of the nested subroutine is described within a
1638 concrete instance tree for the outer subroutine according
1640 Sections \refersec{chap:concreteinlinedinstances} or
1641 \refersec{chap:outoflineinstancesofinlinedsubroutines}
1643 and without regard to the fact that it is within an outer
1644 concrete instance tree.
1647 See Appendix \refersec{app:inliningexamples}
1648 for discussion and examples.
1650 \subsection{Trampolines}
1651 \label{chap:trampolines}
1653 \textit{A trampoline is a compiler\dash generated subroutine that serves as
1654 \hypertarget{chap:DWATtrampolinetargetsubroutine}
1655 an intermediary in making a call to another subroutine. It may
1656 adjust parameters and/or the result (if any) as appropriate
1657 to the combined calling and called execution contexts.}
1659 A trampoline is represented by a debugging information entry
1660 \addtoindexx{trampoline (subprogam) entry}
1661 with the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram} or \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}
1663 \addtoindexx{trampoline attribute}
1664 a \livelink{chap:DWATtrampoline}{DW\-\_AT\-\_trampoline} attribute.
1666 attribute indicates the target subroutine of the trampoline,
1667 that is, the subroutine to which the trampoline passes
1668 control. (A trampoline entry may but need not also have a
1669 \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial} attribute.)
1671 The value of the trampoline attribute may be represented
1672 using any of the following forms, which are listed in order
1676 \item If the value is of class reference, then the value
1677 specifies the debugging information entry of the target
1680 \item If the value is of class address, then the value is
1681 the relocated address of the target subprogram.
1683 \item If the value is of class string, then the value is the
1684 (possibly mangled) \addtoindexx{mangled names}
1685 name of the target subprogram.
1687 \item If the value is of class \livelink{chap:flag}{flag}, then the value true
1688 indicates that the containing subroutine is a trampoline but
1689 that the target subroutine is not known.
1693 The target subprogram may itself be a trampoline. (A sequence
1694 of trampolines necessarily ends with a non\dash trampoline
1697 \textit{In \addtoindex{C++}, trampolines may be used
1698 to implement derived virtual
1699 member functions; such trampolines typically adjust the
1700 \addtoindexx{this parameter}
1701 implicit this pointer parameter in the course of passing
1703 Other languages and environments may use trampolines
1704 in a manner sometimes known as transfer functions or transfer
1707 \textit{Trampolines may sometimes pass control to the target
1708 subprogram using a branch or jump instruction instead of a
1709 call instruction, thereby leaving no trace of their existence
1710 in the subsequent execution context. }
1712 \textit{This attribute helps make it feasible for a debugger to arrange
1713 that stepping into a trampoline or setting a breakpoint in
1714 a trampoline will result in stepping into or setting the
1715 breakpoint in the target subroutine instead. This helps to
1716 hide the compiler generated subprogram from the user. }
1718 \textit{If the target subroutine is not known, a debugger may choose
1719 to repeatedly step until control arrives in a new subroutine
1720 which can be assumed to be the target subroutine. }
1724 \section{Lexical Block Entries}
1725 \label{chap:lexicalblockentries}
1728 lexical \livetargi{chap:lexicalblock}{block}{lexical block}
1730 \addtoindexx{lexical block}
1731 a bracketed sequence of source statements
1732 that may contain any number of declarations. In some languages
1733 (including \addtoindex{C} and \addtoindex{C++}),
1734 \nolink{blocks} can be nested within other
1735 \nolink{blocks} to any depth.}
1737 % We do not need to link to the preceding paragraph.
1738 A lexical \nolink{block} is represented by a debugging information
1740 tag \livetarg{chap:DWTAGlexicalblock}{DW\-\_TAG\-\_lexical\-\_block}.
1742 The lexical \livetargi{chap:lexicalblockentry}{block}{lexical block entry}
1744 either a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
1745 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of
1747 \addtoindexx{high PC attribute}
1749 \addtoindexx{low PC attribute}
1751 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
1752 \addtoindexx{ranges attribute}
1753 whose values encode the contiguous or non-contiguous address
1754 ranges, respectively, of the machine instructions generated
1755 for the lexical \livelink{chap:lexicalblock}{block}
1756 (see Section \refersec{chap:codeaddressesandranges}).
1758 If a name has been given to the
1759 lexical \livelink{chap:lexicalblock}{block}
1761 program, then the corresponding
1762 lexical \livelink{chap:lexicalblockentry}{block} entry has a
1763 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose
1764 \addtoindexx{name attribute}
1765 value is a null\dash terminated string
1766 containing the name of the lexical \livelink{chap:lexicalblock}{block}
1770 \textit{This is not the same as a \addtoindex{C} or
1771 \addtoindex{C++} label (see below).}
1773 The lexical \livelink{chap:lexicalblockentry}{block} entry owns
1774 debugging information entries that
1775 describe the declarations within that lexical \livelink{chap:lexicalblock}{block}.
1777 one such debugging information entry for each local declaration
1778 of an identifier or inner lexical \livelink{chap:lexicalblock}{block}.
1780 \section{Label Entries}
1781 \label{chap:labelentries}
1782 \textit{A label is a way of identifying a source statement. A labeled
1783 statement is usually the target of one or more ``go to''
1787 A label is represented by a debugging information entry with
1788 \addtoindexx{label entry}
1790 tag \livetarg{chap:DWTAGlabel}{DW\-\_TAG\-\_label}.
1791 The entry for a label should be owned by
1792 the debugging information entry representing the scope within
1793 which the name of the label could be legally referenced within
1796 The label entry has a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute whose value
1797 is the relocated address of the first machine instruction
1798 generated for the statement identified by the label in
1799 the source program. The label entry also has a
1800 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1801 \addtoindexx{name attribute}
1802 whose value is a null-terminated string containing
1803 the name of the label as it appears in the source program.
1806 \section{With Statement Entries}
1807 \label{chap:withstatemententries}
1809 \textit{Both \addtoindex{Pascal} and
1810 \addtoindexx{Modula-2}
1811 Modula\dash 2 support the concept of a ``with''
1812 statement. The with statement specifies a sequence of
1813 executable statements within which the fields of a record
1814 variable may be referenced, unqualified by the name of the
1817 A with statement is represented by a
1818 \addtoindexi{debugging information entry}{with statement entry}
1819 with the tag \livetarg{chap:DWTAGwithstmt}{DW\-\_TAG\-\_with\-\_stmt}.
1821 A with statement entry may have either a
1822 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
1823 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of attributes
1824 \addtoindexx{high PC attribute}
1826 \addtoindexx{low PC attribute}
1827 a \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
1828 \addtoindexx{ranges attribute}
1829 whose values encode the contiguous or non\dash contiguous address
1830 ranges, respectively, of the machine instructions generated
1831 for the with statement
1832 (see Section \refersec{chap:codeaddressesandranges}).
1834 The with statement entry has
1835 \addtoindexx{type attribute}
1836 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, denoting
1837 the type of record whose fields may be referenced without full
1838 qualification within the body of the statement. It also has
1839 \addtoindexx{location attribute}
1840 a \livelink{chap:DWATlocation}{DW\-\_AT\-\_location} attribute, describing how to find the base
1841 address of the record object referenced within the body of
1844 \section{Try and Catch Block Entries}
1845 \label{chap:tryandcatchblockentries}
1847 \textit{In \addtoindex{C++} a lexical \livelink{chap:lexicalblock}{block} may be
1848 designated as a ``catch \nolink{block}.''
1849 A catch \livetargi{chap:catchblock}{block}{catch block} is an
1850 exception handler that handles
1851 exceptions thrown by an immediately
1852 preceding ``try \livelink{chap:tryblock}{block}.''
1853 A catch \livelink{chap:catchblock}{block}
1854 designates the type of the exception that it
1857 A try \livetargi{chap:tryblock}{block}{try block} is represented
1858 by a debugging information entry
1859 \addtoindexx{try block entry}
1860 with the tag \livetarg{chap:DWTAGtryblock}{DW\-\_TAG\-\_try\-\_block}.
1861 A catch \livelink{chap:catchblock}{block} is represented by
1862 a debugging information entry with
1863 \addtoindexx{catch block entry}
1864 the tag \livetarg{chap:DWTAGcatchblock}{DW\-\_TAG\-\_catch\-\_block}.
1866 % nolink as we have links just above and do not have a combo link for both
1867 Both try and catch \nolink{block} entries may have either a
1868 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
1869 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of attributes
1870 \addtoindexx{high PC attribute}
1872 \addtoindexx{low PC attribute}
1874 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
1875 \addtoindexx{ranges attribute}
1876 whose values encode the contiguous
1877 or non\dash contiguous address ranges, respectively, of the
1878 machine instructions generated for the \livelink{chap:lexicalblock}{block}
1880 \refersec{chap:codeaddressesandranges}).
1882 Catch \livelink{chap:catchblock}{block} entries have at
1883 least one child entry, an
1884 entry representing the type of exception accepted by
1885 that catch \livelink{chap:catchblock}{block}.
1886 This child entry has one of
1887 \addtoindexx{formal parameter entry!in catch block}
1889 \addtoindexx{unspecified parameters entry!in catch block}
1891 \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter} or
1892 \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters},
1893 and will have the same form as other parameter entries.
1895 The siblings immediately following
1896 a try \livelink{chap:tryblock}{block} entry are its
1897 corresponding catch \livelink{chap:catchblock}{block} entries.