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{compilation unit}
15 \addtoindexx{normal compilation unit}
16 normal compilation units,
17 partial compilation units and
18 \addtoindexx{type unit}
20 \addtoindex{partial compilation unit}
21 is related to one or more other compilation units that
23 \addtoindex{type unit} represents
24 a single complete type in a
25 separate unit. Either a normal compilation unit or a
26 \addtoindex{partial compilation unit}
27 may be logically incorporated into another
28 compilation unit using an
29 \addtoindex{imported unit entry}.
31 \subsection[Normal and Partial CU Entries]{Normal and Partial Compilation Unit Entries}
32 \label{chap:normalandpartialcompilationunitentries}
34 A \addtoindex{normal compilation unit} is represented by a debugging
35 information entry with the
36 tag \livetarg{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit}.
37 A \addtoindex{partial compilation unit} is represented by a debugging information
39 tag \livetarg{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit}.
41 In a simple normal compilation, a single compilation unit with
43 \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit} represents a complete object file
45 \livelink{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit} is not used.
47 employing the DWARF space compression and duplicate elimination
49 Appendix \refersec{app:usingcompilationunits},
50 multiple compilation units using
52 \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit} and/or
53 \livelink{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit} are
54 used to represent portions of an object file.
56 \textit{A normal compilation unit typically represents the text and
57 data contributed to an executable by a single relocatable
58 object file. It may be derived from several source files,
59 including pre\dash processed ``include files.''
60 A \addtoindex{partial compilation unit} typically represents a part of the text
61 and data of a relocatable object file, in a manner that can
62 potentially be shared with the results of other compilations
63 to save space. It may be derived from an ``include file'',
64 template instantiation, or other implementation\dash dependent
65 portion of a compilation. A normal compilation unit can also
66 function in a manner similar to a partial compilation unit
69 A compilation unit entry owns debugging information
70 entries that represent all or part of the declarations
71 made in the corresponding compilation. In the case of a
72 partial compilation unit, the containing scope of its owned
73 declarations is indicated by imported unit entries in one
74 or more other compilation unit entries that refer to that
75 partial compilation unit (see
76 Section \refersec{chap:importedunitentries}).
79 Compilation unit entries may have the following
83 \item Either a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
84 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of
85 \addtoindexx{high PC attribute}
87 \addtoindexx{low PC attribute}
89 \addtoindexx{ranges attribute}
91 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
92 \addtoindexx{ranges attribute}
94 \addtoindexx{discontiguous address ranges|see{non-contiguous address ranges}}
97 non\dash contiguous address ranges, respectively,
98 of the machine instructions generated for the compilation
99 unit (see Section {chap:codeaddressesandranges}).
100 A \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute
104 \addtoindexx{ranges attribute}
106 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} to specify the
107 \addtoindexx{ranges attribute}
108 default base address for use in
109 \addtoindexx{location list}
110 location lists (see Section
111 \refersec{chap:locationlists}) and range lists
112 \addtoindexx{range list}
113 (see Section \refersec{chap:noncontiguousaddressranges}).
115 \item A \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
116 \addtoindexx{name attribute}
117 whose value is a null\dash terminated
119 \hypertarget{chap:DWATnamepathnameofcompilationsource}
120 containing the full or relative path name of the primary
121 source file from which the compilation unit was derived.
123 \item A \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language} attribute
124 \addtoindexx{language attribute}
125 whose constant value is an
126 \hypertarget{chap:DWATlanguageprogramminglanguage}
128 \addtoindexx{language attribute}
129 indicating the source language of the compilation
130 unit. The set of language names and their meanings are given
132 Figure \refersec{fig:languagenames}.
136 \caption{Language names}
137 \label{fig:languagenames}
139 Language name & Meaning\\ \hline
140 \livetarg{chap:DWLANGAda83}{DW\-\_LANG\-\_Ada83} \dag&ISO \addtoindex{Ada}:1983 \addtoindexx{Ada} \\
141 \livetarg{chap:DWLANGAda95}{DW\-\_LANG\-\_Ada95} \dag&ISO Ada:1995 \addtoindexx{Ada} \\
142 \livetarg{chap:DWLANGC}{DW\-\_LANG\-\_C}&Non-standardized C, such as K\&R \\
143 \livetarg{chap:DWLANGC89}{DW\-\_LANG\-\_C89}&ISO C:1989 \\
144 \livetarg{chap:DWLANGC99}{DW\-\_LANG\-\_C99} & ISO \addtoindex{C}:1999 \\
145 \livetarg{chap:DWLANGCplusplus}{DW\-\_LANG\-\_C\-\_plus\-\_plus}&ISO \addtoindex{C++}:1998 \\
146 \livetarg{chap:DWLANGCobol74}{DW\-\_LANG\-\_Cobol74}& ISO \addtoindex{Cobol}:1974 \\
147 \livetarg{chap:DWLANGCobol85}{DW\-\_LANG\-\_Cobol85} & ISO \addtoindex{Cobol}:1985 \\
148 \livetarg{chap:DWLANGD}{DW\-\_LANG\-\_D} \dag & D \addtoindexx{D language} \\
149 \livetarg{chap:DWLANGFortran77}{DW\-\_LANG\-\_Fortran77} &ISO \addtoindex{FORTRAN} 77\\
150 \livetarg{chap:DWLANGFortran90}{DW\-\_LANG\-\_Fortran90} & ISO \addtoindex{Fortran 90}\\
151 \livetarg{chap:DWLANGFortran95}{DW\-\_LANG\-\_Fortran95} & ISO \addtoindex{Fortran 95}\\
152 \livetarg{chap:DWLANGJava}{DW\-\_LANG\-\_Java} & \addtoindex{Java}\\
153 \livetarg{chap:DWLANGModula2}{DW\-\_LANG\-\_Modula2} & ISO Modula\dash 2:1996 \addtoindexx{Modula-2}\\
154 \livetarg{chap:DWLANGObjC}{DW\-\_LANG\-\_ObjC} & \addtoindex{Objective C}\\
155 \livetarg{chap:DWLANGObjCplusplus}{DW\-\_LANG\-\_ObjC\-\_plus\-\_plus} & \addtoindex{Objective C++}\\
156 \livetarg{chap:DWLANGPascal83}{DW\-\_LANG\-\_Pascal83} & ISO \addtoindex{Pascal}:1983\\
157 \livetarg{chap:DWLANGPLI}{DW\-\_LANG\-\_PLI} \dag & ANSI \addtoindex{PL/I}:1976\\
158 \livetarg{chap:DWLANGPython}{DW\-\_LANG\-\_Python} \dag & \addtoindex{Python}\\
159 \livetarg{chap:DWLANGUPC}{DW\-\_LANG\-\_UPC} &\addtoindex{Unified Parallel C}\\ \hline
160 \dag \ \ Support for these languages is limited.& \\
164 \item A \livelink{chap:DWATstmtlist}{DW\-\_AT\-\_stmt\-\_list} attribute whose value is
165 \addtoindexx{statement list attribute}
167 \addtoindexx{section offset!in statement list attribute}
169 \hypertarget{chap:DWATstmtlistlinenumberinformationforunit}
171 to the line number information for this compilation
172 unit. This information is placed in a separate object file
173 section from the debugging information entries themselves. The
174 value of the statement list attribute is the offset in the
175 \addtoindex{.debug\_line} section of the first byte of the line number
176 information for this compilation unit
177 (see Section \refersec{chap:linenumberinformation}).
179 \item A \livelink{chap:DWATmacroinfo}{DW\-\_AT\-\_macro\-\_info} attribute
180 \addtoindex{macro information attribute}
182 \addtoindexx{section offset!in macro information attribute}
184 \hypertarget{chap:DWATmacroinfomacroinformation}
185 offset to the macro information for this compilation unit.
186 This information is placed in a separate object file section
187 from the debugging information entries themselves. The
188 value of the macro information attribute is the offset in
189 the \addtoindex{.debug\_macinfo} section of the first byte of the macro
190 information for this compilation unit
191 (see Section \refersec{chap:macroinformation}).
194 \livelink{chap:DWATcompdir}{DW\-\_AT\-\_comp\-\_dir}
196 \hypertarget{chap:DWATcompdircompilationdirectory}
198 null\dash terminated string containing the current working directory
199 of the compilation command that produced this compilation
200 unit in whatever form makes sense for the host system.
202 \item A \livelink{chap:DWATproducer}{DW\-\_AT\-\_producer} attribute
203 \addtoindexx{producer attribute}
204 whose value is a null\dash
205 terminated string containing information about the compiler
206 \hypertarget{chap:DWATproducercompileridentification}
207 that produced the compilation unit. The actual contents of
208 the string will be specific to each producer, but should
209 begin with the name of the compiler vendor or some other
210 identifying character sequence that should avoid confusion
211 with other producer values.
214 \item A \livelink{chap:DWATidentifiercase}{DW\-\_AT\-\_identifier\-\_case}
216 \addtoindexx{identifier case attribute}
218 \hypertarget{chap:DWATidentifiercaseidentifiercaserule}
219 constant value is a code describing the treatment
220 of identifiers within this compilation unit. The
221 set of identifier case codes
223 \refersec{fig:identifiercasecodes}.
226 \autorows[0pt]{c}{1}{l}{
227 \livelink{chap:DWIDcasesensitive}{DW\-\_ID\-\_case\-\_sensitive},
228 \livelink{chap:DWIDupcase}{DW\-\_ID\-\_up\-\_case},
229 \livelink{chap:DWIDdowncase}{DW\-\_ID\-\_down\-\_case},
230 \livelink{chap:DWIDcaseinsensitive}{DW\-\_ID\-\_case\-\_insensitive}
232 \caption{Identifier case codes}\label{fig:identifiercasecodes}
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 which is a \livelink{chap:flag}{flag} whose
288 presence indicates that all strings (such as the names of
289 declared entities in the source program) are represented
290 using the UTF\dash 8 representation
291 (see Section \refersec{datarep:attributeencodings}).
294 \item A \livelink{chap:DWATmainsubprogram}{DW\-\_AT\-\_main\-\_subprogram} attribute, which is a \livelink{chap:flag}{flag}
295 \addtoindexx{main subprogram attribute}
296 whose presence indicates
297 \hypertarget{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}
298 that the compilation unit contains a
299 subprogram that has been identified as the starting function
300 of the program. If more than one compilation unit contains
301 this \nolink{flag}, any one of them may contain the starting function.
303 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
305 to specify and provide a user\dash specified name for the main
306 subroutine of a program.
307 \addtoindex{C} uses the name “main” to identify
308 the main subprogram of a program. Some other languages provide
309 similar or other means to identify the main subprogram of
314 The base address of a compilation unit is defined as the
315 value of the \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute, if present; otherwise,
316 it is undefined. If the base address is undefined, then any
317 DWARF entry or structure defined in terms of the base address
318 of that compilation unit is not valid.
321 \subsection{Imported Unit Entries}
322 \label{chap:importedunitentries}
324 \hypertarget{chap:DWATimportimportedunit}
325 place where a normal or partial unit is imported is
326 represented by a debugging information entry with the
327 \addtoindexx{imported unit entry}
328 tag \livetarg{chap:DWTAGimportedunit}{DW\-\_TAG\-\_imported\-\_unit}.
329 An imported unit entry contains
330 \addtoindexx{import attribute}
332 \livelink{chap:DWATimport}{DW\-\_AT\-\_import} attribute
333 whose value is a reference to the
334 normal or partial compilation unit whose declarations logically
335 belong at the place of the imported unit entry.
337 An imported unit entry does not necessarily correspond to
338 any entity or construct in the source program. It is merely
339 “glue” used to relate a partial unit, or a compilation
340 unit used as a partial unit, to a place in some other
343 \subsection{Separate Type Unit Entries}
344 \label{chap:separatetypeunitentries}
345 An object file may contain any number of separate type
346 unit entries, each representing a single complete type
348 Each \addtoindex{type unit} must be uniquely identified by
349 a 64\dash bit signature, stored as part of the type unit, which
350 can be used to reference the type definition from debugging
351 information entries in other compilation units and type units.
353 A type unit is represented by a debugging information entry
354 with the tag \livetarg{chap:DWTAGtypeunit}{DW\-\_TAG\-\_type\-\_unit}.
355 A \addtoindex{type unit entry} owns debugging
356 information entries that represent the definition of a single
357 type, plus additional debugging information entries that may
358 be necessary to include as part of the definition of the type.
360 A type unit entry may have a
361 \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language} attribute,
363 \addtoindexx{language attribute}
364 constant value is an integer code indicating the source
365 language used to define the type. The set of language names
366 and their meanings are given in Figure \refersec{fig:languagenames}.
368 A \addtoindex{type unit} entry for a given type T owns a debugging
369 information entry that represents a defining declaration
370 of type T. If the type is nested within enclosing types or
371 namespaces, the debugging information entry for T is nested
372 within debugging information entries describing its containers;
373 otherwise, T is a direct child of the type unit entry.
375 A type unit entry may also own additional debugging information
376 entries that represent declarations of additional types that
377 are referenced by type T and have not themselves been placed in
378 separate type units. Like T, if an additional type U is nested
379 within enclosing types or namespaces, the debugging information
380 entry for U is nested within entries describing its containers;
381 otherwise, U is a direct child of the type unit entry.
383 The containing entries for types T and U are declarations,
384 and the outermost containing entry for any given type T or
385 U is a direct child of the type unit entry. The containing
386 entries may be shared among the additional types and between
387 T and the additional types.
389 Types are not required to be placed in type units. In general,
390 only large types such as structure, class, enumeration, and
391 union types included from header files should be considered
392 for separate type units. Base types and other small types
393 are not usually worth the overhead of placement in separate
394 type units. Types that are unlikely to be replicated, such
395 as those defined in the main source file, are also better
396 left in the main compilation unit.
398 \section{Module, Namespace and Importing Entries}
399 \textit{Modules and namespaces provide a means to collect related
400 entities into a single entity and to manage the names of
403 \subsection{Module Entries}
404 \label{chap:moduleentries}
405 \textit{Several languages have the concept of a ``module.''
406 \addtoindexx{Modula-2}
407 A Modula\dash 2 definition module
408 \addtoindexx{Modula-2!definition module}
409 may be represented by a module
411 \addtoindex{declaration attribute}
412 (\livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration}). A
413 \addtoindex{Fortran 90} module
414 \addtoindexx{Fortran!module (Fortran 90)}
415 may also be represented by a module entry
416 (but no declaration attribute is warranted because \addtoindex{Fortran}
417 has no concept of a corresponding module body).}
419 A module is represented by a debugging information entry
421 tag \livetarg{chap:DWTAGmodule}{DW\-\_TAG\-\_module}.
422 Module entries may own other
423 debugging information entries describing program entities
424 whose declaration scopes end at the end of the module itself.
426 If the module has a name, the module entry has a
427 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
428 \addtoindexx{name attribute}
429 whose value is a null\dash terminated string containing
430 the module name as it appears in the source program.
432 The \addtoindex{module entry} may have either a
433 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
434 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc}
436 \addtoindexx{high PC attribute}
438 \addtoindexx{low PC attribute}
440 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
441 \addtoindexx{ranges attribute}
442 whose values encode the contiguous or non\dash contiguous address
443 ranges, respectively, of the machine instructions generated for
444 the module initialization code
445 (see Section \refersec{chap:codeaddressesandranges}).
446 \hypertarget{chap:DWATentrypcentryaddressofmoduleinitialization}
448 \addtoindexx{entry pc attribute!for module initialization}
450 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} attribute whose value is the address of
451 the first executable instruction of that initialization code
452 (see Section \refersec{chap:entryaddress}).
455 \hypertarget{chap:DWATprioritymodulepriority}
456 the module has been assigned a priority, it may have
457 \addtoindexx{priority attribute}
459 \livelink{chap:DWATpriority}{DW\-\_AT\-\_priority} attribute.
460 The value of this attribute is a
461 reference to another debugging information entry describing
462 a variable with a constant value. The value of this variable
463 is the actual constant value of the module’s priority,
464 represented as it would be on the target architecture.
466 \subsection{Namespace Entries}
467 \label{chap:namespaceentries}
468 \textit{\addtoindex{C++} has the notion of a namespace, which provides a way to
469 \addtoindexx{namespace (C++)}
470 implement name hiding, so that names of unrelated things
471 do not accidentally clash in the
472 \addtoindex{global namespace} when an
473 application is linked together.}
475 A namespace is represented by a debugging information entry
477 tag \livetarg{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace}.
478 A namespace extension is
479 \hypertarget{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}
481 \livelink{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace} entry
483 \addtoindexx{extension attribute}
485 \livelink{chap:DWATextension}{DW\-\_AT\-\_extension}
486 attribute referring to the previous extension, or if there
487 is no previous extension, to the original
488 \livelink{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace}
489 entry. A namespace extension entry does not need to duplicate
490 information in a previous extension entry of the namespace
491 nor need it duplicate information in the original namespace
492 entry. (Thus, for a namespace with a name,
493 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
494 \addtoindexx{name attribute}
495 need only be attached directly to the original
496 \livelink{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace} entry.)
498 Namespace and namespace extension entries may own
499 \addtoindexx{namespace extension entry}
501 \addtoindexx{namespace declaration entry}
502 debugging information entries describing program entities
503 whose declarations occur in the namespace.
505 \textit{For \addtoindex{C++}, such
506 owned program entities may be declarations,
507 including certain declarations that are also object or
508 function definitions.}
510 If a type, variable, or function declared in a namespace is
511 defined outside of the body of the namespace declaration,
512 that type, variable, or function definition entry has a
513 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
514 \addtoindexx{specification attribute}
515 whose value is a reference to the
516 debugging information entry representing the declaration of
517 the type, variable or function. Type, variable, or function
519 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
520 \addtoindexx{specification attribute}
522 to duplicate information provided by the declaration entry
523 referenced by the specification attribute.
525 \textit{The \addtoindex{C++} \addtoindex{global namespace}
527 \addtoindexx{global namespace|see{namespace (C++), global}}
529 \addtoindexx{namespace (C++)!global}
531 ``::f'', for example) is not explicitly represented in
532 DWARF with a namespace entry (thus mirroring the situation
533 in \addtoindex{C++} source).
534 Global items may be simply declared with no
535 reference to a namespace.}
537 \textit{The \addtoindex{C++}
538 compilation unit specific ``unnamed namespace'' may
539 \addtoindexx{namespace (C++)!unnamed}
540 be represented by a namespace entry with no name attribute in
541 the original namespace declaration entry (and therefore no name
542 attribute in any namespace extension entry of this namespace).
545 \textit{A compiler emitting namespace information may choose to
546 explicitly represent namespace extensions, or to represent the
547 final namespace declaration of a compilation unit; this is a
548 quality\dash of\dash implementation issue and no specific requirements
549 are given here. If only the final namespace is represented,
550 \addtoindexx{namespace (C++)!using declaration}
551 it is impossible for a debugger to interpret using declaration
552 references in exactly the manner defined by the
553 \addtoindex{C++} language.
556 \textit{Emitting all namespace declaration information in all
557 compilation units can result in a significant increase in the
558 size of the debug information and significant duplication of
559 information across compilation units.
560 The \addtoindex{C++} namespace std,
562 \addtoindexx{namespace (C++)!std}
563 is large and will probably be referenced in
564 every \addtoindex{C++} compilation unit.
567 \textit{For a \addtoindex{C++} namespace example,
568 see Appendix \refersec{app:namespaceexample}.
573 \subsection{Imported (or Renamed) Declaration Entries}
574 \label{chap:importedorrenameddeclarationentries}
575 \textit{Some languages support the concept of importing into or making
576 accessible in a given unit declarations made in a different
577 module or scope. An imported declaration may sometimes be
582 imported declaration is represented by one or
583 \addtoindex{imported declaration entry}
584 more debugging information entries with the
585 tag \livetarg{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration}.
587 \hypertarget{chap:DWATimportimporteddeclaration}
589 is imported, there is one imported declaration entry for
591 \addtoindexx{import attribute}
592 Each imported declaration entry has a
593 \livelink{chap:DWATimport}{DW\-\_AT\-\_import} attribute,
594 whose value is a reference to the
595 debugging information entry representing the declaration that
598 An imported declaration may also have a
599 \livelink{chap:DWATname}{DW\-\_AT\-\_name}
601 \addtoindexx{name attribute}
602 whose value is a null\dash terminated string containing the
603 name, as it appears in the source program, by which the
604 imported entity is to be known in the context of the imported
605 declaration entry (which may be different than the name of
606 the entity being imported). If no name is present, then the
607 name by which the entity is to be known is the same as the
608 name of the entity being imported.
610 An imported declaration entry with a name attribute may be
611 used as a general means to rename or provide an alias for
612 \addtoindexx{alias declaration|see{imported declaration entry}}
613 an entity, regardless of the context in which the importing
614 declaration or the imported entity occurs.
616 \textit{A \addtoindex{C++} namespace alias may be represented by an imported
617 \hypertarget{chap:DWATimportnamespacealias}
619 \addtoindexx{namespace (C++)!alias}
620 with a name attribute whose value is
621 a null\dash terminated string containing the alias name as it
622 appears in the source program and an import attribute whose
623 value is a reference to the applicable original namespace or
624 namespace extension entry.
627 \textit{A \addtoindex{C++} using declaration may be represented by one or more
628 \hypertarget{chap:DWATimportnamespaceusingdeclaration}
630 \addtoindexx{namespace (C++)!using declaration}
631 declaration entries. When the using declaration
632 refers to an overloaded function, there is one imported
633 declaration entry corresponding to each overloading. Each
634 imported declaration entry has no name attribute but it does
635 have an import attribute that refers to the entry for the
636 entity being imported. (\addtoindex{C++}
637 provides no means to ``rename''
638 an imported entity, other than a namespace).
641 \textit{A \addtoindex{Fortran} use statement
642 \addtoindexx{Fortran!use statement}
643 with an ``only list'' may be
644 represented by a series of imported declaration entries,
645 one (or more) for each entity that is imported. An entity
646 \addtoindexx{renamed declaration|see{imported declaration entry}}
647 that is renamed in the importing context may be represented
648 by an imported declaration entry with a name attribute that
649 specifies the new local name.
652 \subsection{Imported Module Entries}
653 \label{chap:importedmoduleentries}
655 \textit{Some languages support the concept of importing into or making
656 accessible in a given unit all of the declarations contained
657 within a separate module or namespace.
660 An imported module declaration is represented by a debugging
661 information entry with
662 \addtoindexx{imported module attribute}
664 \addtoindexx{imported module entry}
665 tag \livetarg{chap:DWTAGimportedmodule}{DW\-\_TAG\-\_imported\-\_module}.
667 imported module entry contains a
668 \livelink{chap:DWATimport}{DW\-\_AT\-\_import} attribute
669 \addtoindexx{import attribute}
670 whose value is a reference to the module or namespace entry
671 containing the definition and/or declaration entries for
672 the entities that are to be imported into the context of the
673 imported module entry.
675 An imported module declaration may own a set of imported
676 declaration entries, each of which refers to an entry in the
677 module whose corresponding entity is to be known in the context
678 of the imported module declaration by a name other than its
679 name in that module. Any entity in the module that is not
680 renamed in this way is known in the context of the imported
681 module entry by the same name as it is declared in the module.
683 \textit{A \addtoindex{C++} using directive
684 may be represented by an
685 \addtoindexx{namespace (C++)!using directive}
687 \hypertarget{chap:DWATimportnamespaceusingdirective}
688 entry, with an import attribute referring to the namespace
689 entry of the appropriate extension of the namespace (which
690 might be the original namespace entry) and no owned entries.
693 \textit{A \addtoindex{Fortran} use statement
694 \addtoindexx{Fortran!use statement}
695 with a “rename list” may be
696 represented by an imported module entry with an import
697 attribute referring to the module and owned entries
698 corresponding to those entities that are renamed as part of
702 \textit{A \addtoindex{Fortran} use statement
703 with neither a “rename list” nor
704 an “only list” may be represented by an imported module
705 entry with an import attribute referring to the module and
706 no owned child entries.
709 \textit{A use statement with an “only list” is represented by a
710 series of individual imported declaration entries as described
711 in Section \refersec{chap:importedorrenameddeclarationentries}.
714 \textit{A \addtoindex{Fortran} use statement for an entity in a module that is
715 itself imported by a use statement without an explicit mention
716 may be represented by an imported declaration entry that refers
717 to the original debugging information entry. For example, given
733 the imported declaration entry for Q within module C refers
734 directly to the variable declaration entry for A in module A
735 because there is no explicit representation for X in module B.
737 A similar situation arises for a \addtoindex{C++} using declaration that
738 imports an entity in terms of a namespace alias. See
739 Appendix \refersec{app:namespaceexample}
743 \section{Subroutine and Entry Point Entries}
744 \label{chap:subroutineandentrypointentries}
746 The following tags exist to describe
747 debugging information entries
748 \addtoindexx{function entry|see{subroutine entry}}
750 \addtoindexx{subroutine entry}
752 \addtoindexx{subprogram entry}
754 % FIXME: is entry point entry the right index 'entry'?
755 \addtoindexx{entry point entry}
758 \begin{tabular}{lp{9.0cm}}
759 \livetarg{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram} & A subroutine or function. \\
760 \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine} & A particular inlined
761 \addtoindexx{inlined subprogram entry}
762 instance of a subroutine or function. \\
763 \livetarg{chap:DWTAGentrypoint}{DW\-\_TAG\-\_entry\-\_point} & An alternate entry point. \\
766 \subsection{General Subroutine and Entry Point Information}
767 \label{chap:generalsubroutineandentrypointinformation}
769 It may also have a \livelink{chap:DWATlinkagename}{DW\-\_AT\-\_linkage\-\_name} attribute as
770 described in Section \refersec{chap:linkagenames}.
772 If the name of the subroutine described by an entry with the
773 \addtoindex{subprogram entry}
774 tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}
775 is visible outside of its containing
776 \hypertarget{chap:DWATexternalexternalsubroutine}
777 compilation unit, that entry has
778 \addtoindexx{external attribute}
780 \livelink{chap:DWATexternal}{DW\-\_AT\-\_external} attribute,
781 which is a \livelink{chap:flag}{flag}.
783 \textit{Additional attributes for functions that are members of a
784 class or structure are described in
785 Section \refersec{chap:memberfunctionentries}.
789 \hypertarget{chap:DWATmainsubprogrammainorstartingsubprogram}
792 \livelink{chap:DWATmainsubprogram}{DW\-\_AT\-\_main\-\_subprogram}
794 \addtoindexx{main subprogram attribute}
796 a \livelink{chap:flag}{flag} whose presence indicates that the
797 subroutine has been identified as the starting function of
798 the program. If more than one subprogram contains this
800 any one of them may be the starting subroutine of the program.
802 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
803 which is used to specify
804 and provide a user\dash supplied name for the main subroutine of
808 \textit{A common debugger feature is to allow the debugger user to call
809 a subroutine within the subject program. In certain cases,
810 however, the generated code for a subroutine will not obey
811 the standard calling conventions for the target architecture
812 and will therefore not be safe to call from within a debugger.
815 A subroutine entry may
816 \hypertarget{chap:DWATcallingconventionsubprogramcallingconvention}
818 \livelink{chap:DWATcallingconvention}{DW\-\_AT\-\_calling\-\_convention}
819 attribute, whose value is an integer constant. The set of
820 calling convention codes is given in
821 Figure \refersec{fig:callingconventioncodes}.
824 \autorows[0pt]{c}{1}{l}{
825 \addtoindex{DW\-\_CC\-\_normal},
826 \addtoindex{DW\-\_CC\-\_program},
827 \addtoindex{DW\-\_CC\-\_nocall},
829 \caption{Calling convention codes}\label{fig:callingconventioncodes}
832 If this attribute is not present, or its value is the constant
833 \livetarg{chap:DWCCnormal}{DW\-\_CC\-\_normal}, then the subroutine may be safely called by
834 obeying the ``standard'' calling conventions of the target
835 architecture. If the value of the calling convention attribute
836 is the constant \livetarg{chap:DWCCnocall}{DW\-\_CC\-\_nocall}, the subroutine does not obey
837 standard calling conventions, and it may not be safe for the
838 debugger to call this subroutine.
840 If the semantics of the language of the compilation unit
841 containing the subroutine entry distinguishes between ordinary
842 subroutines and subroutines that can serve as the ``main
843 program,'' that is, subroutines that cannot be called
844 directly according to the ordinary calling conventions,
845 then the debugging information entry for such a subroutine
846 may have a calling convention attribute whose value is the
847 constant \livetarg{chap:DWCCprogram}{DW\-\_CC\-\_program}.
849 \textit{The \livelink{chap:DWCCprogram}{DW\-\_CC\-\_program}
850 value is intended to support \addtoindex{Fortran} main
851 \addtoindexx{Fortran!main program}
852 programs which in some implementations may not be callable
853 or which must be invoked in a special way. It is not intended
854 as a way of finding the entry address for the program.
857 \textit{In \addtoindex{C}
858 there is a difference between the types of functions
859 declared using function prototype style declarations and
860 those declared using non\dash prototype declarations.
863 A subroutine entry declared with a function prototype style
865 \addtoindexx{prototyped attribute}
867 \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped} attribute, which is
868 a \livelink{chap:flag}{flag}.
870 \textit{The \addtoindex{Fortran}
871 language allows the keywords elemental, pure
872 and recursive to be included as part of the declaration of
873 a subroutine; these attributes reflect that usage. These
874 attributes are not relevant for languages that do not support
875 similar keywords or syntax. In particular, the \livelink{chap:DWATrecursive}{DW\-\_AT\-\_recursive}
876 attribute is neither needed nor appropriate in languages such
878 where functions support recursion by default.
882 \hypertarget{chap:DWATelementalelementalpropertyofasubroutine}
884 \addtoindexx{elemental attribute}
886 \livelink{chap:DWATelemental}{DW\-\_AT\-\_elemental} attribute, which
887 is a \livelink{chap:flag}{flag}.
888 The attribute indicates whether the subroutine
889 or entry point was declared with the ``elemental'' keyword
893 \hypertarget{chap:DWATpurepurepropertyofasubroutine}
894 subprogram entry may have
895 \addtoindexx{pure attribute}
897 \livelink{chap:DWATpure}{DW\-\_AT\-\_pure} attribute, which is
898 a \livelink{chap:flag}{flag}.
899 The attribute indicates whether the subroutine was
900 declared with the ``pure'' keyword or property.
903 \hypertarget{chap:DWATrecursiverecursivepropertyofasubroutine}
904 subprogram entry may have a
905 \livelink{chap:DWATrecursive}{DW\-\_AT\-\_recursive} attribute, which
906 is a \livelink{chap:flag}{flag}.
907 The attribute indicates whether the subroutine
908 or entry point was declared with the ``recursive'' keyword
913 \subsection{Subroutine and Entry Point Return Types}
914 \label{chap:subroutineandentrypointreturntypes}
917 \hypertarget{chap:DWATtypetypeofsubroutinereturn}
918 the subroutine or entry point
919 \addtoindexx{return type of subroutine}
920 is a function that returns a
921 value, then its debugging information entry has
922 \addtoindexx{type attribute}
923 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
924 to denote the type returned by that function.
926 \textit{Debugging information entries for
927 \addtoindex{C} void functions should
928 not have an attribute for the return type. }
931 \subsection{Subroutine and Entry Point Locations}
932 \label{chap:subroutineandentrypointlocations}
934 A subroutine entry may have either a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
935 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of attributes or a \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
936 \addtoindexx{ranges attribute}
938 \addtoindexx{high PC attribute}
940 \addtoindexx{low PC attribute}
941 encode the contiguous or non\dash contiguous address
942 ranges, respectively, of the machine instructions generated
943 for the subroutine (see
944 Section \refersec{chap:codeaddressesandranges}).
947 \hypertarget{chap:DWATentrypcentryaddressofsubprogram}
948 subroutine entry may also have
949 \addtoindexx{entry pc attribute!for subroutine}
951 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} attribute
952 whose value is the address of the first executable instruction
953 of the subroutine (see
954 Section \refersec{chap:entryaddress}).
956 An entry point has a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute whose value is the
957 relocated address of the first machine instruction generated
961 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} attribute
962 \addtoindexx{entry pc attribute!for subroutine}
964 also seem appropriate
965 for this purpose, historically the
966 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute
968 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} was introduced (in
969 \addtoindex{DWARF Version 3}).
970 There is insufficient reason to change this.}
976 \addtoindexx{address class!attribute}
978 \hypertarget{chap:DWATaddressclasssubroutineorsubroutinetype}
980 \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment}
982 \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class} attributes,
983 as appropriate, to specify
984 which segments the code for the subroutine resides in and
985 the addressing mode to be used in calling that subroutine.
987 A subroutine entry representing a subroutine declaration
988 that is not also a definition does not have code address or
992 \subsection{Declarations Owned by Subroutines and Entry Points}
993 \label{chap:declarationsownedbysubroutinesandentrypoints}
995 The declarations enclosed by a subroutine or entry point are
996 represented by debugging information entries that are owned
997 by the subroutine or entry point entry. Entries representing
998 \addtoindexx{formal parameter}
999 the formal parameters of the subroutine or entry point appear
1000 in the same order as the corresponding declarations in the
1003 \textit{There is no ordering requirement for entries for declarations
1004 that are children of subroutine or entry point entries but
1005 that do not represent formal parameters. The formal parameter
1006 entries may be interspersed with other entries used by formal
1007 parameter entries, such as type entries.}
1009 The unspecified parameters of a variable parameter list are
1010 represented by a debugging information entry\addtoindexx{unspecified parameters entry}
1012 \livetarg{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}.
1014 The entry for a subroutine that includes
1015 \addtoindexx{Fortran!common block}
1017 \addtoindex{Fortran} common block
1018 \livelink{chap:fortrancommonblock}{common}
1019 \livelink{chap:commonblockentry}{block}
1020 \addtoindexx{common block|see{Fortran common block}}
1021 has a child entry with the
1022 tag \livetarg{chap:DWTAGcommoninclusion}{DW\-\_TAG\-\_common\-\_inclusion}.
1024 \hypertarget{chap:commonreferencecommonblockusage}
1025 common inclusion entry has a
1026 \livelink{chap:DWATcommonreference}{DW\-\_AT\-\_common\-\_reference} attribute
1027 whose value is a reference to the debugging information entry
1028 for the common \nolink{block} being included
1029 (see Section \refersec{chap:commonblockentries}).
1031 \subsection{Low-Level Information}
1032 \label{chap:lowlevelinformation}
1035 \hypertarget{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}
1036 subroutine or entry point entry may have
1037 \addtoindexx{return address attribute}
1039 \livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr}
1040 attribute, whose value is a location description. The location
1041 calculated is the place where the return address for the
1042 subroutine or entry point is stored.
1045 \hypertarget{chap:DWATframebasesubroutineframebaseaddress}
1046 subroutine or entry point entry may also have
1047 \addtoindexx{frame base attribute}
1049 \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attribute, whose value is a location
1050 description that computes the “frame base” for the
1051 subroutine or entry point. If the location description is
1052 a simple register location description, the given register
1053 contains the frame base address. If the location description is
1054 a DWARF expression, the result of evaluating that expression
1055 is the frame base address. Finally, for a
1056 \addtoindex{location list},
1057 this interpretation applies to each location description
1058 contained in the list of \addtoindex{location list} entries.
1060 \textit{The use of one of the \livelink{chap:DWOPreg}{DW\-\_OP\-\_reg}~\textless~n~\textgreater
1062 context is equivalent to using
1063 \livelink{chap:DWOPbreg}{DW\-\_OP\-\_breg}~\textless~n~\textgreater(0)
1065 compact. However, these are not equivalent in general.}
1067 \textit{The frame base for a procedure is typically an address fixed
1068 relative to the first unit of storage allocated for the
1069 procedure’s stack frame. The \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attribute
1070 can be used in several ways:}
1072 \begin{enumerate}[1.]
1073 \item \textit{In procedures that need
1074 \addtoindexx{location list}
1075 location lists to locate local
1076 variables, the \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} can hold the needed location
1077 list, while all variables’ location descriptions can be
1078 simpler ones involving the frame base.}
1080 \item \textit{It can be used in resolving ``up\dash level'' addressing
1081 within nested routines.
1082 (See also \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link}, below)}
1083 %The -See also- here is ok, the DW\-\_AT should be
1084 %a hyperref to the def itself, which is earlier in this document.
1087 \textit{Some languages support nested subroutines. In such languages,
1088 it is possible to reference the local variables of an
1089 outer subroutine from within an inner subroutine. The
1090 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link} and \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attributes allow
1091 debuggers to support this same kind of referencing.}
1094 \hypertarget{chap:DWATstaticlinklocationofuplevelframe}
1096 \addtoindexx{address!uplevel|see{static link attribute}}
1097 subroutine or entry point is nested, it may have a
1098 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link}
1099 attribute, whose value is a location
1100 description that computes the frame base of the relevant
1101 instance of the subroutine that immediately encloses the
1102 subroutine or entry point.
1104 In the context of supporting nested subroutines, the
1105 \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attribute value should obey the following
1108 \begin{enumerate}[1.]
1109 \item It should compute a value that does not change during the
1110 life of the procedure, and
1112 \item The computed value should be unique among instances of
1113 the same subroutine. (For typical \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} use, this
1114 means that a recursive subroutine’s stack frame must have
1115 non\dash zero size.)
1118 \textit{If a debugger is attempting to resolve an up\dash level reference
1119 to a variable, it uses the nesting structure of DWARF to
1120 determine which subroutine is the lexical parent and the
1121 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link} value to identify the appropriate active
1122 frame of the parent. It can then attempt to find the reference
1123 within the context of the parent.}
1127 \subsection{Types Thrown by Exceptions}
1128 \label{chap:typesthrownbyexceptions}
1130 \textit{In \addtoindex{C++} a subroutine may declare a set of types which
1131 it may validly throw.}
1133 If a subroutine explicitly declares that it may throw
1134 \addtoindexx{exception thrown|see{thrown type entry}}
1136 \addtoindexx{thrown exception|see{thrown type entry}}
1137 exception for one or more types, each such type is
1139 represented by a debugging information entry with
1140 \addtoindexx{thrown type entry}
1142 \livetarg{chap:DWTAGthrowntype}{DW\-\_TAG\-\_thrown\-\_type}.
1143 Each such entry is a child of the entry
1144 representing the subroutine that may throw this type. Each
1145 thrown type entry contains
1146 \addtoindexx{type attribute}
1147 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, whose
1148 value is a reference to an entry describing the type of the
1149 exception that may be thrown.
1151 \subsection{Function Template Instantiations}
1152 \label{chap:functiontemplateinstantiations}
1154 \textit{In \addtoindex{C++}, a function template is a generic definition of
1155 a function that is instantiated differently when called with
1156 values of different types. DWARF does not represent the generic
1157 template definition, but does represent each instantiation.}
1159 A \addtoindex{template instantiation} is represented by a debugging
1160 information entry with the
1161 \addtoindexx{subprogram entry!use for template instantiation}
1162 tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}.
1164 exceptions, such an entry will contain the same attributes and
1165 will have the same types of child entries as would an entry
1166 for a subroutine defined explicitly using the instantiation
1167 types. The exceptions are:
1169 \begin{enumerate}[1.]
1170 \item Each formal parameterized type declaration appearing in the
1171 template definition is represented by a debugging information
1173 \addtoindexx{template type parameter entry}
1174 tag \livetarg{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}.
1176 such entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
1177 \addtoindexx{name attribute}
1179 null\dash terminated string containing the name of the formal
1180 type parameter as it appears in the source program. The
1181 \addtoindexx{formal type parameter|see{template type parameter entry}}
1182 template type parameter entry also has
1183 \addtoindexx{type attribute}
1184 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1185 describing the actual type by which the formal is replaced
1186 for this instantiation.
1188 \item The subprogram entry and each of its child entries reference
1189 a template type parameter entry in any circumstance where
1190 the template definition referenced a formal parameterized type.
1192 \item If the compiler has generated a special compilation unit
1193 to hold the template instantiation and that compilation unit
1194 has a different name from the compilation unit containing
1195 the template definition, the name attribute for the debugging
1196 information entry representing that compilation unit is empty
1199 \item If the subprogram entry representing the template
1200 instantiation or any of its child entries contain declaration
1201 coordinate attributes, those attributes refer to the source
1202 for the template definition, not to any source generated
1203 artificially by the compiler for this instantiation.
1208 \subsection{Inlinable and Inlined Subroutines}
1209 A declaration or a definition of an inlinable subroutine
1210 is represented by a debugging information entry with the
1212 \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}.
1214 \addtoindexx{subprogram entry!use in inlined subprogram}
1216 \hypertarget{chap:DWATinlineinlinedsubroutine}
1217 explicitly declared to be available for inline expansion or
1218 that was expanded inline implicitly by the compiler has
1219 \addtoindexx{inline attribute}
1221 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute whose value is an integer constant. The
1222 set of values for the \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute is given in
1223 Figure \refersec{fig:inlinecodes}.
1225 \begin{figure}[here]
1227 \caption{Inline codes}
1228 \label{fig:inlinecodes}
1229 \begin{tabular}{lp{9cm}}
1230 Name&Meaning\\ \hline
1231 \livetarg{chap:DWINLnotinlined}{DW\-\_INL\-\_not\-\_inlined} & Not declared inline nor inlined by the
1232 compiler(equivalent to the absence of the containing
1233 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute) \\
1234 \livetarg{chap:DWINLinlined}{DW\-\_INL\-\_inlined} & Not declared inline but inlined by the compiler \\
1235 \livetarg{chap:DWINLdeclarednotinlined}{DW\-\_INL\-\_declared\-\_not\-\_inlined} & Declared inline but
1236 not inlined by the compiler \\
1237 \livetarg{chap:DWINLdeclaredinlined}{DW\-\_INL\-\_declared\-\_inlined} & Declared inline and inlined by the compiler \\
1241 \textit{In \addtoindex{C++}, a function or a constructor declared with
1242 constexpr is implicitly declared inline. The abstract inline
1243 instance (see below) is represented by a debugging information
1244 entry with the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}. Such an entry has a
1245 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute whose value is \livelink{chap:DWINLinlined}{DW\-\_INL\-\_inlined}.}
1248 \paragraph{Abstract Instances}
1249 \label{chap:abstractinstances}
1250 Any debugging information entry that is owned (either
1251 \hypertarget{chap:DWATinlineabstracttinstance}
1252 directly or indirectly) by a debugging information entry
1254 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute is referred to
1255 \addtoindexx{abstract instance!entry}
1256 as an ``abstract instance entry.''
1257 Any subroutine entry
1259 \addtoindexx{inline attribute}
1260 a \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute whose value is other
1261 than \livelink{chap:DWINLnotinlined}{DW\-\_INL\-\_not\-\_inlined}
1263 \addtoindexx{abstract instance!root}
1264 an ``abstract instance root.''
1265 Any set of abstract instance entries that are all
1266 children (either directly or indirectly) of some abstract
1267 instance root, together with the root itself, is known as
1268 \addtoindexx{abstract instance!tree}
1269 an ``abstract instance tree.'' However, in the case where
1270 an abstract instance tree is nested within another abstract
1271 instance tree, the entries in the
1272 \addtoindex{nested abstract instance}
1273 tree are not considered to be entries in the outer abstract
1276 Each abstract instance root is either part of a larger
1277 \addtoindexx{abstract instance!root}
1278 tree (which gives a context for the root) or
1279 \addtoindexx{specification attribute}
1281 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
1282 to refer to the declaration in context.
1284 \textit{For example, in \addtoindex{C++} the context might be a namespace
1285 declaration or a class declaration.}
1287 \textit{Abstract instance trees are defined so that no entry is part
1288 of more than one abstract instance tree. This simplifies the
1289 following descriptions.}
1291 A debugging information entry that is a member of an abstract
1292 instance tree should not contain any attributes which describe
1293 aspects of the subroutine which vary between distinct inlined
1294 expansions or distinct out\dash of\dash line expansions. For example,
1295 \addtoindexx{entry pc attribute!and abstract instance}
1296 the \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc},
1297 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc},
1298 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges},
1299 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc},
1300 \livelink{chap:DWATlocation}{DW\-\_AT\-\_location},
1301 \livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr}, \livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope},
1303 \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment!and abstract instance}
1305 \addtoindexx{location attribute!and abstract instance}
1307 \addtoindexx{ranges attribute!and abstract instance}
1309 \addtoindexx{high PC attribute!and abstract instance}
1311 \addtoindexx{low PC attribute!and abstract instance}
1313 \addtoindex{segment attribute!and abstract instance}
1315 \addtoindexx{return address attribute!and abstract instance}
1317 \addtoindexx{segment attribute!and abstract instance}
1319 \addtoindexx{start scope attribute!and abstract instance}
1322 \textit{It would not make sense normally to put these attributes into
1323 abstract instance entries since such entries do not represent
1324 actual (concrete) instances and thus do not actually exist at
1325 run\dash time. However,
1326 see Appendix \refersec{app:inlineouteronenormalinner}
1327 for a contrary example.}
1329 The rules for the relative location of entries belonging to
1330 abstract instance trees are exactly the same as for other
1331 similar types of entries that are not abstract. Specifically,
1332 the rule that requires that an entry representing a declaration
1333 be a direct child of the entry representing the scope of the
1334 declaration applies equally to both abstract and non\dash abstract
1335 entries. Also, the ordering rules for formal parameter entries,
1336 member entries, and so on, all apply regardless of whether
1337 or not a given entry is abstract.
1339 \paragraph{Concrete Inlined Instances}
1340 \label{chap:concreteinlinedinstances}
1342 Each inline expansion of a subroutine is represented
1343 by a debugging information entry with the
1344 tag \livetarg{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}.
1345 Each such entry should be a direct
1346 child of the entry that represents the scope within which
1347 the inlining occurs.
1349 Each inlined subroutine entry may have either a
1350 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc}
1351 and \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair
1353 \addtoindexx{high PC attribute}
1355 \addtoindexx{low PC attribute}
1357 \addtoindexx{ranges attribute}
1359 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges}
1360 attribute whose values encode the contiguous or non\dash contiguous
1361 address ranges, respectively, of the machine instructions
1362 generated for the inlined subroutine (see
1363 Section \refersec{chap:codeaddressesandranges}).
1365 \hypertarget{chap:DWATentrypcentryaddressofinlinedsubprogram}
1366 inlined subroutine entry may
1367 \addtoindexx{inlined subprogram entry!in concrete instance}
1369 \addtoindexx{inlined subprogram entry}
1371 \addtoindexx{entry pc attribute!for inlined subprogram}
1373 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc}
1374 attribute, representing the first executable instruction of
1375 the inline expansion (see
1376 Section \refersec{chap:entryaddress}).
1378 % Positions of the 3 targets here is a bit arbitrary.
1380 \hypertarget{chap:DWATcalllinelinenumberofinlinedsubroutinecall}
1382 \hypertarget{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}
1384 \hypertarget{chap:DWATcallfilefilecontaininginlinedsubroutinecall}
1385 may also have \livelink{chap:DWATcallfile}{DW\-\_AT\-\_call\-\_file},
1386 \livelink{chap:DWATcallline}{DW\-\_AT\-\_call\-\_line} and \livelink{chap:DWATcallcolumn}{DW\-\_AT\-\_call\-\_column} attributes,
1388 value is an integer constant. These attributes represent the
1389 source file, source line number, and source column number,
1390 respectively, of the first character of the statement or
1391 expression that caused the inline expansion. The call file,
1392 call line, and call column attributes are interpreted in
1393 the same way as the declaration file, declaration line, and
1394 declaration column attributes, respectively (see
1395 Section \refersec{chap:declarationcoordinates}).
1397 The call file, call line and call column coordinates do not
1398 describe the coordinates of the subroutine declaration that
1399 was inlined, rather they describe the coordinates of the call.
1401 An inlined subroutine entry
1402 \hypertarget{chap:DWATconstexprcompiletimeconstantfunction}
1404 \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr}
1405 attribute, which is a \livelink{chap:flag}{flag}
1406 whose presence indicates that the
1407 subroutine has been evaluated as a compile\dash time constant. Such
1408 an entry may also have a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute,
1409 whose value may be of any form that is appropriate for the
1410 representation of the subroutine's return value. The value of
1411 this attribute is the actual return value of the subroutine,
1412 represented as it would be on the target architecture.
1414 \textit{In \addtoindex{C++}, if a function or a constructor declared with constexpr
1415 is called with constant expressions, then the corresponding
1416 concrete inlined instance has a
1417 \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr} attribute,
1418 as well as a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute whose value represents
1419 the actual return value of the concrete inlined instance.}
1421 Any debugging information entry that is owned (either
1422 directly or indirectly) by a debugging information entry
1423 with the tag \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine} is referred to as a
1424 ``concrete inlined instance entry.'' Any entry that has
1426 \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}
1427 is known as a ``concrete inlined instance root.''
1428 Any set of concrete inlined instance
1429 entries that are all children (either directly or indirectly)
1430 of some concrete inlined instance root, together with the root
1431 itself, is known as a ``concrete inlined instance tree.''
1432 However, in the case where a concrete inlined instance tree
1433 is nested within another concrete instance tree, the entries
1434 in the \addtoindex{nested concrete inline instance} tree
1435 are not considered to
1436 be entries in the outer concrete instance tree.
1438 \textit{Concrete inlined instance trees are defined so that no entry
1439 is part of more than one concrete inlined instance tree. This
1440 simplifies later descriptions.}
1442 Each concrete inlined instance tree is uniquely associated
1443 with one (and only one) abstract instance tree.
1445 \textit{Note, however, that the reverse is not true. Any given abstract
1446 instance tree may be associated with several different concrete
1447 inlined instance trees, or may even be associated with zero
1448 concrete inlined instance trees.}
1450 Concrete inlined instance entries may omit attributes that
1451 are not specific to the concrete instance (but present in
1452 the abstract instance) and need include only attributes that
1453 are specific to the concrete instance (but omitted in the
1454 abstract instance). In place of these omitted attributes, each
1455 \hypertarget{chap:DWATabstractorigininlineinstance}
1456 concrete inlined instance entry
1457 \addtoindexx{abstract origin attribute}
1459 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin}
1460 attribute that may be used to obtain the missing information
1461 (indirectly) from the associated abstract instance entry. The
1462 value of the abstract origin attribute is a reference to the
1463 associated abstract instance entry.
1465 If an entry within a concrete inlined instance tree contains
1466 attributes describing the
1467 \addtoindexx{declaration coordinates!in concrete instance}
1468 declaration coordinates
1470 entry, then those attributes should refer to the file, line
1471 and column of the original declaration of the subroutine,
1472 not to the point at which it was inlined. As a consequence,
1473 they may usually be omitted from any entry that has an abstract
1476 For each pair of entries that are associated via a
1477 \addtoindexx{abstract origin attribute}
1478 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin} attribute, both members of the pair
1479 have the same tag. So, for example, an entry with the tag
1480 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable} can only be associated with another entry
1481 that also has the tag \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}. The only exception
1482 to this rule is that the root of a concrete instance tree
1483 (which must always have the tag \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine})
1484 can only be associated with the root of its associated abstract
1485 instance tree (which must have the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}).
1487 In general, the structure and content of any given concrete
1488 inlined instance tree will be closely analogous to the
1489 structure and content of its associated abstract instance
1490 tree. There are a few exceptions:
1492 \begin{enumerate}[1.]
1493 \item An entry in the concrete instance tree may be omitted if
1495 \addtoindexx{abstract origin attribute}
1496 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin} attribute and either
1497 has no children, or its children are omitted. Such entries
1498 would provide no useful information. In C\dash like languages,
1499 such entries frequently include types, including structure,
1500 union, class, and interface types; and members of types. If any
1501 entry within a concrete inlined instance tree needs to refer
1502 to an entity declared within the scope of the relevant inlined
1503 subroutine and for which no concrete instance entry exists,
1504 the reference should refer to the abstract instance entry.
1506 \item Entries in the concrete instance tree which are associated
1507 with entries in the abstract instance tree such that neither
1508 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
1509 \addtoindexx{name attribute}
1510 and neither is referenced by
1511 any other debugging information entry, may be omitted. This
1512 may happen for debugging information entries in the abstract
1513 instance trees that became unnecessary in the concrete instance
1514 tree because of additional information available there. For
1515 example, an anonymous variable might have been created and
1516 described in the abstract instance tree, but because of
1517 the actual parameters for a particular inlined expansion,
1518 it could be described as a constant value without the need
1519 for that separate debugging information entry.
1521 \item A concrete instance tree may contain entries which do
1522 not correspond to entries in the abstract instance tree
1523 to describe new entities that are specific to a particular
1524 inlined expansion. In that case, they will not have associated
1525 entries in the abstract instance tree, should not contain
1526 \addtoindexx{abstract origin attribute}
1527 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin} attributes, and must contain all their
1528 own attributes directly. This allows an abstract instance tree
1529 to omit debugging information entries for anonymous entities
1530 that are unlikely to be needed in most inlined expansions. In
1531 any expansion which deviates from that expectation, the
1532 entries can be described in its concrete inlined instance tree.
1536 \paragraph{Out-of-Line Instances of Inlined Subroutines}
1537 \label{chap:outoflineinstancesofinlinedsubroutines}
1538 Under some conditions, compilers may need to generate concrete
1539 executable instances of inlined subroutines other than at
1540 points where those subroutines are actually called. Such
1541 concrete instances of inlined subroutines are referred to as
1542 ``concrete out\dash of\dash line instances.''
1544 \textit{In \addtoindex{C++}, for example,
1545 taking the address of a function declared
1546 to be inline can necessitate the generation of a concrete
1547 out\dash of\dash line instance of the given function.}
1549 The DWARF representation of a concrete out\dash of\dash line instance
1550 of an inlined subroutine is essentially the same as for a
1551 concrete inlined instance of that subroutine (as described in
1552 the preceding section). The representation of such a concrete
1553 % It is critical that the hypertarget and livelink be
1554 % separated to avoid problems with latex.
1555 out\dash of\dash line
1556 \addtoindexx{abstract origin attribute}
1558 \hypertarget{chap:DWATabstractoriginoutoflineinstance}
1560 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin}
1561 attributes in exactly the same way as they are used for
1562 a concrete inlined instance (that is, as references to
1563 corresponding entries within the associated abstract instance
1566 The differences between the DWARF representation of a
1567 concrete out\dash of\dash line instance of a given subroutine and the
1568 representation of a concrete inlined instance of that same
1569 subroutine are as follows:
1571 \begin{enumerate}[1.]
1572 \item The root entry for a concrete out\dash of\dash line instance
1573 of a given inlined subroutine has the same tag as does its
1574 associated (abstract) inlined subroutine entry (that is, tag
1575 \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram} rather than \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}).
1577 \item The root entry for a concrete out\dash of\dash line instance tree
1578 is normally owned by the same parent entry that also owns
1579 the root entry of the associated abstract instance. However,
1580 it is not required that the abstract and out\dash of\dash line instance
1581 trees be owned by the same parent entry.
1585 \paragraph{Nested Inlined Subroutines}
1586 \label{nestedinlinedsubroutines}
1587 Some languages and compilers may permit the logical nesting of
1588 a subroutine within another subroutine, and may permit either
1589 the outer or the nested subroutine, or both, to be inlined.
1591 For a non\dash inlined subroutine nested within an inlined
1592 subroutine, the nested subroutine is described normally in
1593 both the abstract and concrete inlined instance trees for
1594 the outer subroutine. All rules pertaining to the abstract
1595 and concrete instance trees for the outer subroutine apply
1596 also to the abstract and concrete instance entries for the
1599 For an inlined subroutine nested within another inlined
1600 subroutine, the following rules apply to their abstract and
1601 \addtoindexx{abstract instance!nested}
1602 \addtoindexx{concrete instance!nested}
1603 concrete instance trees:
1605 \begin{enumerate}[1.]
1606 \item The abstract instance tree for the nested subroutine is
1607 described within the abstract instance tree for the outer
1608 subroutine according to the rules in
1609 Section \refersec{chap:abstractinstances}, and
1610 without regard to the fact that it is within an outer abstract
1613 \item Any abstract instance tree for a nested subroutine is
1614 always omitted within the concrete instance tree for an
1617 \item A concrete instance tree for a nested subroutine is
1618 always omitted within the abstract instance tree for an
1621 \item The concrete instance tree for any inlined or
1622 \addtoindexx{out-of-line instance}
1624 \addtoindexx{out-of-line-instance|see{concrete out-of-line-instance}}
1625 expansion of the nested subroutine is described within a
1626 concrete instance tree for the outer subroutine according
1628 Sections \refersec{chap:concreteinlinedinstances} or
1629 \refersec{chap:outoflineinstancesofinlinedsubroutines}
1631 and without regard to the fact that it is within an outer
1632 concrete instance tree.
1635 See Appendix \refersec{app:inliningexamples}
1636 for discussion and examples.
1638 \subsection{Trampolines}
1639 \label{chap:trampolines}
1641 \textit{A trampoline is a compiler\dash generated subroutine that serves as
1642 \hypertarget{chap:DWATtrampolinetargetsubroutine}
1643 an intermediary in making a call to another subroutine. It may
1644 adjust parameters and/or the result (if any) as appropriate
1645 to the combined calling and called execution contexts.}
1647 A trampoline is represented by a debugging information entry
1648 \addtoindexx{trampoline (subprogam) entry}
1649 with the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram} or \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}
1651 \addtoindexx{trampoline attribute}
1652 a \livelink{chap:DWATtrampoline}{DW\-\_AT\-\_trampoline} attribute.
1654 attribute indicates the target subroutine of the trampoline,
1655 that is, the subroutine to which the trampoline passes
1656 control. (A trampoline entry may but need not also have a
1657 \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial} attribute.)
1659 The value of the trampoline attribute may be represented
1660 using any of the following forms, which are listed in order
1664 \item If the value is of class reference, then the value
1665 specifies the debugging information entry of the target
1668 \item If the value is of class address, then the value is
1669 the relocated address of the target subprogram.
1671 \item If the value is of class string, then the value is the
1672 (possibly mangled) \addtoindexx{mangled names}
1673 name of the target subprogram.
1675 \item If the value is of class \livelink{chap:flag}{flag}, then the value true
1676 indicates that the containing subroutine is a trampoline but
1677 that the target subroutine is not known.
1681 The target subprogram may itself be a trampoline. (A sequence
1682 of trampolines necessarily ends with a non\dash trampoline
1685 \textit{In \addtoindex{C++}, trampolines may be used
1686 to implement derived virtual
1687 member functions; such trampolines typically adjust the
1688 \addtoindexx{this parameter}
1689 implicit this pointer parameter in the course of passing
1691 Other languages and environments may use trampolines
1692 in a manner sometimes known as transfer functions or transfer
1695 \textit{Trampolines may sometimes pass control to the target
1696 subprogram using a branch or jump instruction instead of a
1697 call instruction, thereby leaving no trace of their existence
1698 in the subsequent execution context. }
1700 \textit{This attribute helps make it feasible for a debugger to arrange
1701 that stepping into a trampoline or setting a breakpoint in
1702 a trampoline will result in stepping into or setting the
1703 breakpoint in the target subroutine instead. This helps to
1704 hide the compiler generated subprogram from the user. }
1706 \textit{If the target subroutine is not known, a debugger may choose
1707 to repeatedly step until control arrives in a new subroutine
1708 which can be assumed to be the target subroutine. }
1712 \section{Lexical Block Entries}
1713 \label{chap:lexicalblockentries}
1716 lexical \livetargi{chap:lexicalblock}{block}{lexical block}
1718 \addtoindexx{lexical block}
1719 a bracketed sequence of source statements
1720 that may contain any number of declarations. In some languages
1721 (including \addtoindex{C} and \addtoindex{C++}),
1722 \nolink{blocks} can be nested within other
1723 \nolink{blocks} to any depth.}
1725 % We do not need to link to the preceding paragraph.
1726 A lexical \nolink{block} is represented by a debugging information
1728 tag \livetarg{chap:DWTAGlexicalblock}{DW\-\_TAG\-\_lexical\-\_block}.
1730 The lexical \livetargi{chap:lexicalblockentry}{block}{lexical block entry}
1733 either a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
1734 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of
1736 \addtoindexx{high PC attribute}
1738 \addtoindexx{low PC attribute}
1740 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
1741 \addtoindexx{ranges attribute}
1742 whose values encode the contiguous or non-contiguous address
1743 ranges, respectively, of the machine instructions generated
1744 for the lexical \livelink{chap:lexicalblock}{block}
1745 (see Section \refersec{chap:codeaddressesandranges}).
1747 If a name has been given to the
1748 lexical \livelink{chap:lexicalblock}{block}
1750 program, then the corresponding
1751 lexical \livelink{chap:lexicalblockentry}{block} entry has a
1752 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose
1753 \addtoindexx{name attribute}
1754 value is a null\dash terminated string
1755 containing the name of the lexical \livelink{chap:lexicalblock}{block}
1759 \textit{This is not the same as a \addtoindex{C} or
1760 \addtoindex{C++} label (see below).}
1762 The lexical \livelink{chap:lexicalblockentry}{block} entry owns
1763 debugging information entries that
1764 describe the declarations within that lexical \livelink{chap:lexicalblock}{block}.
1766 one such debugging information entry for each local declaration
1767 of an identifier or inner lexical \livelink{chap:lexicalblock}{block}.
1769 \section{Label Entries}
1770 \label{chap:labelentries}
1772 A label is a way of identifying a source statement. A labeled
1773 statement is usually the target of one or more ``go to''
1776 A label is represented by a debugging information entry with
1777 \addtoindexx{label entry}
1779 tag \livetarg{chap:DWTAGlabel}{DW\-\_TAG\-\_label}.
1780 The entry for a label should be owned by
1781 the debugging information entry representing the scope within
1782 which the name of the label could be legally referenced within
1785 The label entry has a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute whose value
1786 is the relocated address of the first machine instruction
1787 generated for the statement identified by the label in
1788 the source program. The label entry also has a
1789 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1790 \addtoindexx{name attribute}
1791 whose value is a null-terminated string containing
1792 the name of the label as it appears in the source program.
1795 \section{With Statement Entries}
1796 \label{chap:withstatemententries}
1798 \textit{Both \addtoindex{Pascal} and
1799 \addtoindexx{Modula-2}
1800 Modula\dash 2 support the concept of a ``with''
1801 statement. The with statement specifies a sequence of
1802 executable statements within which the fields of a record
1803 variable may be referenced, unqualified by the name of the
1806 A with statement is represented by a
1807 \addtoindexi{debugging information entry}{with statement entry}
1808 with the tag \livetarg{chap:DWTAGwithstmt}{DW\-\_TAG\-\_with\-\_stmt}.
1810 A with statement entry may have either a
1811 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
1812 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of attributes
1813 \addtoindexx{high PC attribute}
1815 \addtoindexx{low PC attribute}
1816 a \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
1817 \addtoindexx{ranges attribute}
1818 whose values encode the contiguous or non\dash contiguous address
1819 ranges, respectively, of the machine instructions generated
1820 for the with statement
1821 (see Section \refersec{chap:codeaddressesandranges}).
1823 The with statement entry has
1824 \addtoindexx{type attribute}
1825 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, denoting
1826 the type of record whose fields may be referenced without full
1827 qualification within the body of the statement. It also has
1828 \addtoindexx{location attribute}
1829 a \livelink{chap:DWATlocation}{DW\-\_AT\-\_location} attribute, describing how to find the base
1830 address of the record object referenced within the body of
1833 \section{Try and Catch Block Entries}
1834 \label{chap:tryandcatchblockentries}
1836 \textit{In \addtoindex{C++} a lexical \livelink{chap:lexicalblock}{block} may be
1837 designated as a ``catch \nolink{block}.''
1838 A catch \livetargi{chap:catchblock}{block}{catch block} is an
1839 exception handler that handles
1840 exceptions thrown by an immediately
1841 preceding ``try \livelink{chap:tryblock}{block}.''
1842 A catch \livelink{chap:catchblock}{block}
1843 designates the type of the exception that it
1846 A try \livetargi{chap:tryblock}{block}{try block} is represented
1847 by a debugging information entry
1848 \addtoindexx{try block entry}
1849 with the tag \livetarg{chap:DWTAGtryblock}{DW\-\_TAG\-\_try\-\_block}.
1850 A catch \livelink{chap:catchblock}{block} is represented by
1851 a debugging information entry with
1852 \addtoindexx{catch block entry}
1853 the tag \livetarg{chap:DWTAGcatchblock}{DW\-\_TAG\-\_catch\-\_block}.
1855 % nolink as we have links just above and do not have a combo link for both
1856 Both try and catch \nolink{block} entries may have either a
1857 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
1858 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of attributes
1859 \addtoindexx{high PC attribute}
1861 \addtoindexx{low PC attribute}
1863 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
1864 \addtoindexx{ranges attribute}
1865 whose values encode the contiguous
1866 or non\dash contiguous address ranges, respectively, of the
1867 machine instructions generated for the \livelink{chap:lexicalblock}{block}
1869 \refersec{chap:codeaddressesandranges}).
1871 Catch \livelink{chap:catchblock}{block} entries have at
1872 least one child entry, an
1873 entry representing the type of exception accepted by
1874 that catch \livelink{chap:catchblock}{block}.
1876 This child entry has one of
1877 \addtoindexx{formal parameter entry!in catch block}
1879 \addtoindexx{unspecified parameters entry!in catch block}
1881 \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter} or
1882 \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters},
1883 and will have the same form as other parameter entries.
1885 The siblings immediately following
1886 a try \livelink{chap:tryblock}{block} entry are its
1887 corresponding catch \livelink{chap:catchblock}{block} entries.