1 \chapter{Program Scope Entries}
2 \label{chap:programscopeentries}
3 This section describes debugging information entries that
4 relate to different levels of program scope: compilation,
5 module, subprogram, and so on. Except for separate type
6 entries (see Section \refersec{chap:separatetypeunitentries}),
7 these entries may be thought of
8 as bounded by ranges of text addresses within the program.
10 \section{Unit Entries}
11 An object file may contain one or more compilation units,
13 \addtoindexx{unit|see {compilation unit, partial unit \textit{or} type unit}}
14 \addtoindexx{compilation unit}
16 \addtoindexx{normal compilation unit}
17 \addtoindexx{normal compilation unit|see {compilation unit}}
18 normal compilation units,
19 partial compilation units and
20 \addtoindexx{type unit}
22 \addtoindex{partial compilation unit}
23 is related to one or more other compilation units that
25 \addtoindex{type unit} represents
26 a single complete type in a
27 separate unit. Either a normal compilation unit or a
28 \addtoindex{partial compilation unit}
29 may be logically incorporated into another
30 compilation unit using an
31 \addtoindex{imported unit entry}.
33 \subsection[Normal and Partial CU Entries]{Normal and Partial Compilation Unit Entries}
34 \label{chap:normalandpartialcompilationunitentries}
36 A \addtoindex{normal compilation unit} is represented by a debugging
37 information entry with the
38 tag \livetarg{chap:DWTAGcompileunit}{DW\_TAG\_compile\_unit}.
39 A \addtoindex{partial compilation unit} is represented by a debugging information
41 tag \livetarg{chap:DWTAGpartialunit}{DW\_TAG\_partial\_unit}.
43 In a simple normal compilation, a single compilation unit with
45 \livelink{chap:DWTAGcompileunit}{DW\_TAG\_compile\_unit} represents a complete object file
47 \livelink{chap:DWTAGpartialunit}{DW\_TAG\_partial\_unit} is not used.
49 employing the DWARF space compression and duplicate elimination
51 Appendix \refersec{app:usingcompilationunits},
52 multiple compilation units using
54 \livelink{chap:DWTAGcompileunit}{DW\_TAG\_compile\_unit} and/or
55 \livelink{chap:DWTAGpartialunit}{DW\_TAG\_partial\_unit} are
56 used to represent portions of an object file.
58 \textit{A normal compilation unit typically represents the text and
59 data contributed to an executable by a single relocatable
60 object file. It may be derived from several source files,
61 including pre\dash processed \doublequote{include files}.
62 A \addtoindex{partial compilation unit} typically represents a part of the text
63 and data of a relocatable object file, in a manner that can
64 potentially be shared with the results of other compilations
65 to save space. It may be derived from an \doublequote{include file},
66 template instantiation, or other implementation\dash dependent
67 portion of a compilation. A normal compilation unit can also
68 function in a manner similar to a partial compilation unit
71 A compilation unit entry owns debugging information
72 entries that represent all or part of the declarations
73 made in the corresponding compilation. In the case of a
74 partial compilation unit, the containing scope of its owned
75 declarations is indicated by imported unit entries in one
76 or more other compilation unit entries that refer to that
77 partial compilation unit (see
78 Section \refersec{chap:importedunitentries}).
81 Compilation unit entries may have the following
83 \begin{enumerate}[1. ]
84 \item Either a \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} and
85 \livelink{chap:DWAThighpc}{DW\_AT\_high\_pc} pair of
86 \addtoindexx{high PC attribute}
88 \addtoindexx{low PC attribute}
90 \addtoindexx{ranges attribute}
92 \livelink{chap:DWATranges}{DW\_AT\_ranges} attribute
93 \addtoindexx{ranges attribute}
95 \addtoindexx{discontiguous address ranges|see{non-contiguous address ranges}}
98 non\dash contiguous address ranges, respectively,
99 of the machine instructions generated for the compilation
100 unit (see Section \refersec{chap:codeaddressesandranges}).
102 A \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} attribute
106 \addtoindexx{ranges attribute}
108 \livelink{chap:DWATranges}{DW\_AT\_ranges} to specify the
109 \addtoindexx{ranges attribute}
110 default base address for use in
111 \addtoindexx{location list}
112 location lists (see Section
113 \refersec{chap:locationlists}) and range lists
114 \addtoindexx{range list}
115 (see Section \refersec{chap:noncontiguousaddressranges}).
117 \item A \livelink{chap:DWATname}{DW\_AT\_name} attribute
118 \addtoindexx{name attribute}
119 whose value is a null\dash terminated
121 \hypertarget{chap:DWATnamepathnameofcompilationsource}
122 containing the full or relative path name of the primary
123 source file from which the compilation unit was derived.
125 \item A \livelink{chap:DWATlanguage}{DW\_AT\_language} attribute
126 \addtoindexx{language attribute}
127 whose constant value is an
128 \hypertarget{chap:DWATlanguageprogramminglanguage}
130 \addtoindexx{language attribute}
131 indicating the source language of the compilation
132 unit. The set of language names and their meanings are given
133 in Table \refersec{tab:languagenames}.
137 \caption{Language names}
138 \label{tab:languagenames}
141 Language name & Meaning\\ \hline
142 \livetarg{chap:DWLANGAda83}{DW\_LANG\_Ada83} \dag&ISO \addtoindex{Ada}:1983 \addtoindexx{Ada} \\
143 \livetarg{chap:DWLANGAda95}{DW\_LANG\_Ada95} \dag&ISO Ada:1995 \addtoindexx{Ada} \\
144 \livetarg{chap:DWLANGC}{DW\_LANG\_C}&Non-standardized C, such as K\&R \\
145 \livetarg{chap:DWLANGC89}{DW\_LANG\_C89}&ISO C:1989 \\
146 \livetarg{chap:DWLANGC99}{DW\_LANG\_C99} & ISO \addtoindex{C}:1999 \\
147 \livetarg{chap:DWLANGCplusplus}{DW\_LANG\_C\_plus\_plus}&ISO \addtoindex{C++}:1998 \\
148 \livetarg{chap:DWLANGCobol74}{DW\_LANG\_Cobol74}& ISO \addtoindex{Cobol}:1974 \\
149 \livetarg{chap:DWLANGCobol85}{DW\_LANG\_Cobol85} & ISO \addtoindex{Cobol}:1985 \\
150 \livetarg{chap:DWLANGD}{DW\_LANG\_D} \dag & D \addtoindexx{D language} \\
151 \livetarg{chap:DWLANGFortran77}{DW\_LANG\_Fortran77} &ISO \addtoindex{FORTRAN} 77\\
152 \livetarg{chap:DWLANGFortran90}{DW\_LANG\_Fortran90} & ISO \addtoindex{Fortran 90}\\
153 \livetarg{chap:DWLANGFortran95}{DW\_LANG\_Fortran95} & ISO \addtoindex{Fortran 95}\\
154 \livetarg{chap:DWLANGJava}{DW\_LANG\_Java} & \addtoindex{Java}\\
155 \livetarg{chap:DWLANGModula2}{DW\_LANG\_Modula2} & ISO Modula\dash 2:1996 \addtoindexx{Modula-2}\\
156 \livetarg{chap:DWLANGObjC}{DW\_LANG\_ObjC} & \addtoindex{Objective C}\\
157 \livetarg{chap:DWLANGObjCplusplus}{DW\_LANG\_ObjC\_plus\_plus} & \addtoindex{Objective C++}\\
158 \livetarg{chap:DWLANGPascal83}{DW\_LANG\_Pascal83} & ISO \addtoindex{Pascal}:1983\\
159 \livetarg{chap:DWLANGPLI}{DW\_LANG\_PLI} \dag & ANSI \addtoindex{PL/I}:1976\\
160 \livetarg{chap:DWLANGPython}{DW\_LANG\_Python} \dag & \addtoindex{Python}\\
161 \livetarg{chap:DWLANGUPC}{DW\_LANG\_UPC} &\addtoindex{Unified Parallel C}\addtoindexx{UPC}\\ \hline
162 \dag \ \ \textit{Support for these languages is limited.}& \\
166 \item A \livelink{chap:DWATstmtlist}{DW\_AT\_stmt\_list}
167 attribute whose value is
168 \addtoindexx{statement list attribute}
170 \addtoindexx{section offset!in statement list attribute}
172 \hypertarget{chap:DWATstmtlistlinenumberinformationforunit}
173 offset to the line number information for this compilation
176 This information is placed in a separate object file
177 section from the debugging information entries themselves. The
178 value of the statement list attribute is the offset in the
179 \addtoindex{.debug\_line} section of the first byte of the line number
180 information for this compilation unit
181 (see Section \refersec{chap:linenumberinformation}).
183 \item A \livelink{chap:DWATmacroinfo}{DW\_AT\_macro\_info} attribute
184 \addtoindexx{macro information attribute}
186 \addtoindexx{section offset!in macro information attribute}
188 \hypertarget{chap:DWATmacroinfomacroinformation}
189 offset to the macro information for this compilation unit.
191 This information is placed in a separate object file section
192 from the debugging information entries themselves. The
193 value of the macro information attribute is the offset in
194 the \addtoindex{.debug\_macinfo} section of the first byte of the macro
195 information for this compilation unit
196 (see Section \refersec{chap:macroinformation}).
199 \livelink{chap:DWATcompdir}{DW\_AT\_comp\_dir}
201 \hypertarget{chap:DWATcompdircompilationdirectory}
203 null\dash terminated string containing the current working directory
204 of the compilation command that produced this compilation
205 unit in whatever form makes sense for the host system.
207 \item A \livelink{chap:DWATproducer}{DW\_AT\_producer} attribute
208 \addtoindexx{producer attribute}
209 whose value is a null\dash
210 terminated string containing information about the compiler
211 \hypertarget{chap:DWATproducercompileridentification}
212 that produced the compilation unit. The actual contents of
213 the string will be specific to each producer, but should
214 begin with the name of the compiler vendor or some other
215 identifying character sequence that should avoid confusion
216 with other producer values.
219 \item A \livelink{chap:DWATidentifiercase}{DW\_AT\_identifier\_case}
221 \addtoindexx{identifier case attribute}
223 \hypertarget{chap:DWATidentifiercaseidentifiercaserule}
224 constant value is a code describing the treatment
225 of identifiers within this compilation unit. The
226 set of identifier case codes is given in
227 Table \refersec{tab:identifiercasecodes}.
229 \begin{simplenametable}{Identifier case codes}{tab:identifiercasecodes}
230 \livelink{chap:DWIDcasesensitive}{DW\_ID\_case\_sensitive} \\
231 \livelink{chap:DWIDupcase}{DW\_ID\_up\_case} \\
232 \livelink{chap:DWIDdowncase}{DW\_ID\_down\_case} \\
233 \livelink{chap:DWIDcaseinsensitive}{DW\_ID\_case\_insensitive} \\
234 \end{simplenametable}
236 \livetarg{chap:DWIDcasesensitive}{DW\_ID\_case\_sensitive} is the default for all compilation units
237 that do not have this attribute. It indicates that names given
238 as the values of \livelink{chap:DWATname}{DW\_AT\_name} attributes
239 \addtoindexx{name attribute}
240 in debugging information
241 entries for the compilation unit reflect the names as they
242 appear in the source program. The debugger should be sensitive
243 to the case of identifier names when doing identifier lookups.
245 \livetarg{chap:DWIDupcase}{DW\_ID\_up\_case} means that the
246 producer of the debugging
247 information for this compilation unit converted all source
248 names to upper case. The values of the name attributes may not
249 reflect the names as they appear in the source program. The
250 debugger should convert all names to upper case when doing
253 \livetarg{chap:DWIDdowncase}{DW\_ID\_down\_case} means that
254 the producer of the debugging
255 information for this compilation unit converted all source
256 names to lower case. The values of the name attributes may not
257 reflect the names as they appear in the source program. The
258 debugger should convert all names to lower case when doing
261 \livetarg{chap:DWIDcaseinsensitive}{DW\_ID\_case\_insensitive} means that the values of the name
262 attributes reflect the names as they appear in the source
263 program but that a case insensitive lookup should be used to
266 \item A \livelink{chap:DWATbasetypes}{DW\_AT\_base\_types} attribute whose value is a reference.
270 \hypertarget{chap:DWATbasetypesprimitivedatatypesofcompilationunit}
272 \addtoindexx{base types attribute}
273 points to a debugging information entry
274 representing another compilation unit. It may be used
275 to specify the compilation unit containing the base type
276 entries used by entries in the current compilation unit
277 (see Section \refersec{chap:basetypeentries}).
280 This attribute provides a consumer a way to find the definition
281 of base types for a compilation unit that does not itself
282 contain such definitions. This allows a consumer, for example,
283 to interpret a type conversion to a base type
284 % getting this link target at the right spot is tricky.
285 \hypertarget{chap:DWATuseUTF8compilationunitusesutf8strings}
288 \item A \livelink{chap:DWATuseUTF8}{DW\_AT\_use\_UTF8} attribute,
289 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
290 which is a \livelink{chap:flag}{flag} whose
291 presence indicates that all strings (such as the names of
292 declared entities in the source program) are represented
293 using the UTF\dash 8 representation
294 (see Section \refersec{datarep:attributeencodings}).
297 \item A \livelink{chap:DWATmainsubprogram}{DW\_AT\_main\_subprogram} attribute, which is a \livelink{chap:flag}{flag}
298 \addtoindexx{main subprogram attribute}
299 whose presence indicates
300 \hypertarget{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}
301 that the compilation unit contains a
302 subprogram that has been identified as the starting function
303 of the program. If more than one compilation unit contains
304 this \nolink{flag}, any one of them may contain the starting function.
306 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
308 to specify and provide a user\dash specified name for the main
309 subroutine of a program.
310 \addtoindex{C} uses the name \doublequote{main} to identify
311 the main subprogram of a program. Some other languages provide
312 similar or other means to identify the main subprogram of
317 The base address of a compilation unit is defined as the
318 value of the \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} attribute, if present; otherwise,
319 it is undefined. If the base address is undefined, then any
320 DWARF entry or structure defined in terms of the base address
321 of that compilation unit is not valid.
324 \subsection{Imported Unit Entries}
325 \label{chap:importedunitentries}
327 \hypertarget{chap:DWATimportimportedunit}
328 place where a normal or partial unit is imported is
329 represented by a debugging information entry with the
330 \addtoindexx{imported unit entry}
331 tag \livetarg{chap:DWTAGimportedunit}{DW\_TAG\_imported\_unit}.
332 An imported unit entry contains
333 \addtoindexx{import attribute}
335 \livelink{chap:DWATimport}{DW\_AT\_import} attribute
336 whose value is a reference to the
337 normal or partial compilation unit whose declarations logically
338 belong at the place of the imported unit entry.
340 \textit{An imported unit entry does not necessarily correspond to
341 any entity or construct in the source program. It is merely
342 \doublequote{glue} used to relate a partial unit, or a compilation
343 unit used as a partial unit, to a place in some other
346 \subsection{Separate Type Unit Entries}
347 \label{chap:separatetypeunitentries}
348 An object file may contain any number of separate type
349 unit entries, each representing a single complete type
351 Each \addtoindex{type unit} must be uniquely identified by
352 a 64\dash bit signature, stored as part of the type unit, which
353 can be used to reference the type definition from debugging
354 information entries in other compilation units and type units.
356 A type unit is represented by a debugging information entry
357 with the tag \livetarg{chap:DWTAGtypeunit}{DW\_TAG\_type\_unit}.
358 A \addtoindex{type unit entry} owns debugging
359 information entries that represent the definition of a single
360 type, plus additional debugging information entries that may
361 be necessary to include as part of the definition of the type.
363 A type unit entry may have a
364 \livelink{chap:DWATlanguage}{DW\_AT\_language} attribute,
366 \addtoindexx{language attribute}
367 constant value is an integer code indicating the source
368 language used to define the type. The set of language names
369 and their meanings are given in Table \refersec{tab:languagenames}.
371 A \addtoindex{type unit} entry for a given type T owns a debugging
372 information entry that represents a defining declaration
373 of type T. If the type is nested within enclosing types or
374 namespaces, the debugging information entry for T is nested
375 within debugging information entries describing its containers;
376 otherwise, T is a direct child of the type unit entry.
378 A type unit entry may also own additional debugging information
379 entries that represent declarations of additional types that
380 are referenced by type T and have not themselves been placed in
381 separate type units. Like T, if an additional type U is nested
382 within enclosing types or namespaces, the debugging information
383 entry for U is nested within entries describing its containers;
384 otherwise, U is a direct child of the type unit entry.
386 The containing entries for types T and U are declarations,
387 and the outermost containing entry for any given type T or
388 U is a direct child of the type unit entry. The containing
389 entries may be shared among the additional types and between
390 T and the additional types.
392 \textit{Types are not required to be placed in type units. In general,
393 only large types such as structure, class, enumeration, and
394 union types included from header files should be considered
395 for separate type units. Base types and other small types
396 are not usually worth the overhead of placement in separate
397 type units. Types that are unlikely to be replicated, such
398 as those defined in the main source file, are also better
399 left in the main compilation unit.}
401 \section{Module, Namespace and Importing Entries}
402 \textit{Modules and namespaces provide a means to collect related
403 entities into a single entity and to manage the names of
406 \subsection{Module Entries}
407 \label{chap:moduleentries}
408 \textit{Several languages have the concept of a ``module.''
409 \addtoindexx{Modula-2}
410 A Modula\dash 2 definition module
411 \addtoindexx{Modula-2!definition module}
412 may be represented by a module
414 \addtoindex{declaration attribute}
415 (\livelink{chap:DWATdeclaration}{DW\_AT\_declaration}). A
416 \addtoindex{Fortran 90} module
417 \addtoindexx{Fortran!module (Fortran 90)}
418 may also be represented by a module entry
419 (but no declaration attribute is warranted because \addtoindex{Fortran}
420 has no concept of a corresponding module body).}
422 A module is represented by a debugging information entry
424 tag \livetarg{chap:DWTAGmodule}{DW\_TAG\_module}.
425 Module entries may own other
426 debugging information entries describing program entities
427 whose declaration scopes end at the end of the module itself.
429 If the module has a name, the module entry has a
430 \livelink{chap:DWATname}{DW\_AT\_name} attribute
431 \addtoindexx{name attribute}
432 whose value is a null\dash terminated string containing
433 the module name as it appears in the source program.
435 The \addtoindex{module entry} may have either a
436 \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} and
437 \livelink{chap:DWAThighpc}{DW\_AT\_high\_pc}
439 \addtoindexx{high PC attribute}
441 \addtoindexx{low PC attribute}
443 \livelink{chap:DWATranges}{DW\_AT\_ranges} attribute
444 \addtoindexx{ranges attribute}
445 whose values encode the contiguous or non\dash contiguous address
446 ranges, respectively, of the machine instructions generated for
447 the module initialization code
448 (see Section \refersec{chap:codeaddressesandranges}).
449 \hypertarget{chap:DWATentrypcentryaddressofmoduleinitialization}
451 \addtoindexx{entry pc attribute!for module initialization}
453 \livelink{chap:DWATentrypc}{DW\_AT\_entry\_pc} attribute whose value is the address of
454 the first executable instruction of that initialization code
455 (see Section \refersec{chap:entryaddress}).
458 \hypertarget{chap:DWATprioritymodulepriority}
459 the module has been assigned a priority, it may have
460 \addtoindexx{priority attribute}
462 \livelink{chap:DWATpriority}{DW\_AT\_priority} attribute.
463 The value of this attribute is a
464 reference to another debugging information entry describing
465 a variable with a constant value. The value of this variable
466 is the actual constant value of the module\textquoteright s priority,
467 represented as it would be on the target architecture.
469 \subsection{Namespace Entries}
470 \label{chap:namespaceentries}
471 \textit{\addtoindex{C++} has the notion of a namespace, which provides a way to
472 \addtoindexx{namespace (C++)}
473 implement name hiding, so that names of unrelated things
474 do not accidentally clash in the
475 \addtoindex{global namespace} when an
476 application is linked together.}
478 A namespace is represented by a debugging information entry
480 tag \livetarg{chap:DWTAGnamespace}{DW\_TAG\_namespace}.
481 A namespace extension is
482 \hypertarget{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}
484 \livelink{chap:DWTAGnamespace}{DW\_TAG\_namespace} entry
486 \addtoindexx{extension attribute}
488 \livelink{chap:DWATextension}{DW\_AT\_extension}
489 attribute referring to the previous extension, or if there
490 is no previous extension, to the original
491 \livelink{chap:DWTAGnamespace}{DW\_TAG\_namespace}
492 entry. A namespace extension entry does not need to duplicate
493 information in a previous extension entry of the namespace
494 nor need it duplicate information in the original namespace
495 entry. (Thus, for a namespace with a name,
496 a \livelink{chap:DWATname}{DW\_AT\_name} attribute
497 \addtoindexx{name attribute}
498 need only be attached directly to the original
499 \livelink{chap:DWTAGnamespace}{DW\_TAG\_namespace} entry.)
502 Namespace and namespace extension entries may own
503 \addtoindexx{namespace extension entry}
505 \addtoindexx{namespace declaration entry}
506 debugging information entries describing program entities
507 whose declarations occur in the namespace.
509 \textit{For \addtoindex{C++}, such
510 owned program entities may be declarations,
511 including certain declarations that are also object or
512 function definitions.}
514 If a type, variable, or function declared in a namespace is
515 defined outside of the body of the namespace declaration,
516 that type, variable, or function definition entry has a
517 \livelink{chap:DWATspecification}{DW\_AT\_specification} attribute
518 \addtoindexx{specification attribute}
519 whose value is a reference to the
520 debugging information entry representing the declaration of
521 the type, variable or function. Type, variable, or function
523 \livelink{chap:DWATspecification}{DW\_AT\_specification} attribute
524 \addtoindexx{specification attribute}
526 to duplicate information provided by the declaration entry
527 referenced by the specification attribute.
529 \textit{The \addtoindex{C++} \addtoindex{global namespace}
531 \addtoindexx{global namespace|see{namespace (C++), global}}
533 \addtoindexx{namespace (C++)!global}
535 ``::f'', for example) is not explicitly represented in
536 DWARF with a namespace entry (thus mirroring the situation
537 in \addtoindex{C++} source).
538 Global items may be simply declared with no
539 reference to a namespace.}
541 \textit{The \addtoindex{C++}
542 compilation unit specific ``unnamed namespace'' may
543 \addtoindexx{namespace (C++)!unnamed}
544 \addtoindexx{unnamed namespace|see {namespace (C++), unnamed}}
545 be represented by a namespace entry with no name attribute in
546 the original namespace declaration entry (and therefore no name
547 attribute in any namespace extension entry of this namespace).
550 \textit{A compiler emitting namespace information may choose to
551 explicitly represent namespace extensions, or to represent the
552 final namespace declaration of a compilation unit; this is a
553 quality\dash of\dash implementation issue and no specific requirements
554 are given here. If only the final namespace is represented,
555 \addtoindexx{namespace (C++)!using declaration}
556 it is impossible for a debugger to interpret using declaration
557 references in exactly the manner defined by the
558 \addtoindex{C++} language.
561 \textit{Emitting all namespace declaration information in all
562 compilation units can result in a significant increase in the
563 size of the debug information and significant duplication of
564 information across compilation units.
565 The \addtoindex{C++} namespace std,
567 \addtoindexx{namespace (C++)!std}
568 is large and will probably be referenced in
569 every \addtoindex{C++} compilation unit.
572 \textit{For a \addtoindex{C++} namespace example,
573 see Appendix \refersec{app:namespaceexample}.
578 \subsection{Imported (or Renamed) Declaration Entries}
579 \label{chap:importedorrenameddeclarationentries}
580 \textit{Some languages support the concept of importing into or making
581 accessible in a given unit declarations made in a different
582 module or scope. An imported declaration may sometimes be
587 imported declaration is represented by one or
588 \addtoindexx{imported declaration entry}
589 more debugging information entries with the
590 tag \livetarg{chap:DWTAGimporteddeclaration}{DW\_TAG\_imported\_declaration}.
592 \hypertarget{chap:DWATimportimporteddeclaration}
594 is imported, there is one imported declaration entry for
596 \addtoindexx{import attribute}
597 Each imported declaration entry has a
598 \livelink{chap:DWATimport}{DW\_AT\_import} attribute,
599 whose value is a reference to the
600 debugging information entry representing the declaration that
603 An imported declaration may also have a
604 \livelink{chap:DWATname}{DW\_AT\_name}
606 \addtoindexx{name attribute}
607 whose value is a null\dash terminated string containing the
608 name, as it appears in the source program, by which the
609 imported entity is to be known in the context of the imported
610 declaration entry (which may be different than the name of
611 the entity being imported). If no name is present, then the
612 name by which the entity is to be known is the same as the
613 name of the entity being imported.
615 An imported declaration entry with a name attribute may be
616 used as a general means to rename or provide an alias for
617 \addtoindexx{alias declaration|see{imported declaration entry}}
618 an entity, regardless of the context in which the importing
619 declaration or the imported entity occurs.
621 \textit{A \addtoindex{C++} namespace alias may be represented by an imported
622 \hypertarget{chap:DWATimportnamespacealias}
624 \addtoindexx{namespace (C++)!alias}
625 with a name attribute whose value is
626 a null\dash terminated string containing the alias name as it
627 appears in the source program and an import attribute whose
628 value is a reference to the applicable original namespace or
629 namespace extension entry.
632 \textit{A \addtoindex{C++} using declaration may be represented by one or more
633 \hypertarget{chap:DWATimportnamespaceusingdeclaration}
635 \addtoindexx{namespace (C++)!using declaration}
636 declaration entries. When the using declaration
637 refers to an overloaded function, there is one imported
638 declaration entry corresponding to each overloading. Each
639 imported declaration entry has no name attribute but it does
640 have an import attribute that refers to the entry for the
641 entity being imported. (\addtoindex{C++}
642 provides no means to ``rename''
643 an imported entity, other than a namespace).
646 \textit{A \addtoindex{Fortran} use statement
647 \addtoindexx{Fortran!use statement}
648 \addtoindexx{use statement|see {Fortran, use statement}}
649 with an ``only list'' may be
650 represented by a series of imported declaration entries,
651 one (or more) for each entity that is imported. An entity
652 \addtoindexx{renamed declaration|see{imported declaration entry}}
653 that is renamed in the importing context may be represented
654 by an imported declaration entry with a name attribute that
655 specifies the new local name.
658 \subsection{Imported Module Entries}
659 \label{chap:importedmoduleentries}
661 \textit{Some languages support the concept of importing into or making
662 accessible in a given unit all of the declarations contained
663 within a separate module or namespace.
666 An imported module declaration is represented by a debugging
667 information entry with
668 \addtoindexx{imported module attribute}
670 \addtoindexx{imported module entry}
671 tag \livetarg{chap:DWTAGimportedmodule}{DW\_TAG\_imported\_module}.
673 imported module entry contains a
674 \livelink{chap:DWATimport}{DW\_AT\_import} attribute
675 \addtoindexx{import attribute}
676 whose value is a reference to the module or namespace entry
677 containing the definition and/or declaration entries for
678 the entities that are to be imported into the context of the
679 imported module entry.
681 An imported module declaration may own a set of imported
682 declaration entries, each of which refers to an entry in the
683 module whose corresponding entity is to be known in the context
684 of the imported module declaration by a name other than its
685 name in that module. Any entity in the module that is not
686 renamed in this way is known in the context of the imported
687 module entry by the same name as it is declared in the module.
689 \textit{A \addtoindex{C++} using directive
690 \addtoindexx{namespace (C++)!using directive}
691 \addtoindexx{using directive|see {namespace (C++), using directive}}
692 may be represented by an imported module
693 \hypertarget{chap:DWATimportnamespaceusingdirective}
694 entry, with an import attribute referring to the namespace
695 entry of the appropriate extension of the namespace (which
696 might be the original namespace entry) and no owned entries.
699 \textit{A \addtoindex{Fortran} use statement
700 \addtoindexx{Fortran!use statement}
701 with a \doublequote{rename list} may be
702 represented by an imported module entry with an import
703 attribute referring to the module and owned entries
704 corresponding to those entities that are renamed as part of
708 \textit{A \addtoindex{Fortran} use statement
709 \addtoindexx{Fortran!use statement}
710 with neither a \doublequote{rename list} nor
711 an \doublequote{only list} may be represented by an imported module
712 entry with an import attribute referring to the module and
713 no owned child entries.
716 \textit{A use statement with an \doublequote{only list} is represented by a
717 series of individual imported declaration entries as described
718 in Section \refersec{chap:importedorrenameddeclarationentries}.
721 \textit{A \addtoindex{Fortran} use statement for an entity in a module that is
722 \addtoindexx{Fortran!use statement}
723 itself imported by a use statement without an explicit mention
724 may be represented by an imported declaration entry that refers
725 to the original debugging information entry. For example, given
742 \textit{the imported declaration entry for Q within module C refers
743 directly to the variable declaration entry for X in module A
744 because there is no explicit representation for X in module B.
747 \textit{A similar situation arises for a \addtoindex{C++} using declaration
748 \addtoindexx{namespace (C++)!using declaration}
749 \addtoindexx{using declaration|see {namespace (C++), using declaration}}
750 that imports an entity in terms of a namespace alias. See
751 Appendix \refersec{app:namespaceexample}
755 \section{Subroutine and Entry Point Entries}
756 \label{chap:subroutineandentrypointentries}
758 The following tags exist to describe
759 debugging information entries
760 \addtoindexx{function entry|see{subroutine entry}}
762 \addtoindexx{subroutine entry}
764 \addtoindexx{subprogram entry}
766 % FIXME: is entry point entry the right index 'entry'?
767 \addtoindexx{entry point entry}
770 \begin{tabular}{lp{9.0cm}}
771 \livetarg{chap:DWTAGsubprogram}{DW\_TAG\_subprogram} & A subroutine or function \\
772 \livelink{chap:DWTAGinlinedsubroutine}{DW\_TAG\_inlined\_subroutine} & A particular inlined
773 \addtoindexx{inlined subprogram entry}
774 instance of a subroutine or function \\
775 \livetarg{chap:DWTAGentrypoint}{DW\_TAG\_entry\_point} & An alternate entry point \\
778 \subsection{General Subroutine and Entry Point Information}
779 \label{chap:generalsubroutineandentrypointinformation}
780 The subroutine or entry point entry has a \livelink{chap:DWATname}{DW\_AT\_name}
781 attribute whose value is a null-terminated string containing the
782 subroutine or entry point name as it appears in the source program.
783 It may also have a \livelink{chap:DWATlinkagename}{DW\_AT\_linkage\_name} attribute as
784 described in Section \refersec{chap:linkagenames}.
786 If the name of the subroutine described by an entry with the
787 \addtoindexx{subprogram entry}
788 tag \livelink{chap:DWTAGsubprogram}{DW\_TAG\_subprogram}
789 is visible outside of its containing
790 \hypertarget{chap:DWATexternalexternalsubroutine}
791 compilation unit, that entry has
792 \addtoindexx{external attribute}
794 \livelink{chap:DWATexternal}{DW\_AT\_external} attribute,
795 which is a \livelink{chap:flag}{flag}.
797 \textit{Additional attributes for functions that are members of a
798 class or structure are described in
799 Section \refersec{chap:memberfunctionentries}.
803 \hypertarget{chap:DWATmainsubprogrammainorstartingsubprogram}
806 \livelink{chap:DWATmainsubprogram}{DW\_AT\_main\_subprogram}
808 \addtoindexx{main subprogram attribute}
810 a \livelink{chap:flag}{flag} whose presence indicates that the
811 subroutine has been identified as the starting function of
812 the program. If more than one subprogram contains this
814 any one of them may be the starting subroutine of the program.
816 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
817 which is used to specify
818 and provide a user\dash supplied name for the main subroutine of
822 \textit{A common debugger feature is to allow the debugger user to call
823 a subroutine within the subject program. In certain cases,
824 however, the generated code for a subroutine will not obey
825 the standard calling conventions for the target architecture
826 and will therefore not be safe to call from within a debugger.
829 A subroutine entry may
830 \hypertarget{chap:DWATcallingconventionsubprogramcallingconvention}
832 \livelink{chap:DWATcallingconvention}{DW\_AT\_calling\_convention}
833 attribute, whose value is an integer constant. The set of
834 calling convention codes is given in
835 Table \refersec{tab:callingconventioncodes}.
837 \begin{simplenametable}[1.4in]{Calling convention codes}{tab:callingconventioncodes}
838 \addtoindex{DW\_CC\_normal} \\
839 \addtoindex{DW\_CC\_program} \\
840 \addtoindex{DW\_CC\_nocall} \\
841 \end{simplenametable}
843 If this attribute is not present, or its value is the constant
844 \livetarg{chap:DWCCnormal}{DW\_CC\_normal}, then the subroutine may be safely called by
845 obeying the ``standard'' calling conventions of the target
846 architecture. If the value of the calling convention attribute
847 is the constant \livetarg{chap:DWCCnocall}{DW\_CC\_nocall}, the subroutine does not obey
848 standard calling conventions, and it may not be safe for the
849 debugger to call this subroutine.
851 If the semantics of the language of the compilation unit
852 containing the subroutine entry distinguishes between ordinary
853 subroutines and subroutines that can serve as the ``main
854 program,'' that is, subroutines that cannot be called
855 directly according to the ordinary calling conventions,
856 then the debugging information entry for such a subroutine
857 may have a calling convention attribute whose value is the
858 constant \livetarg{chap:DWCCprogram}{DW\_CC\_program}.
860 \textit{The \livelink{chap:DWCCprogram}{DW\_CC\_program}
861 value is intended to support \addtoindex{Fortran} main
862 \addtoindexx{Fortran!main program}
863 programs which in some implementations may not be callable
864 or which must be invoked in a special way. It is not intended
865 as a way of finding the entry address for the program.
868 \textit{In \addtoindex{C}
869 there is a difference between the types of functions
870 declared using function prototype style declarations and
871 those declared using non\dash prototype declarations.
874 A subroutine entry declared with a function prototype style
876 \addtoindexx{prototyped attribute}
878 \livelink{chap:DWATprototyped}{DW\_AT\_prototyped} attribute, which is
879 a \livelink{chap:flag}{flag}.
881 \textit{The \addtoindex{Fortran}
882 language allows the keywords elemental, pure
883 and recursive to be included as part of the declaration of
884 a subroutine; these attributes reflect that usage. These
885 attributes are not relevant for languages that do not support
886 similar keywords or syntax. In particular, the \livelink{chap:DWATrecursive}{DW\_AT\_recursive}
887 attribute is neither needed nor appropriate in languages such
889 where functions support recursion by default.
893 \hypertarget{chap:DWATelementalelementalpropertyofasubroutine}
895 \addtoindexx{elemental attribute}
897 \livelink{chap:DWATelemental}{DW\_AT\_elemental} attribute, which
898 is a \livelink{chap:flag}{flag}.
899 The attribute indicates whether the subroutine
900 or entry point was declared with the ``elemental'' keyword
904 \hypertarget{chap:DWATpurepurepropertyofasubroutine}
905 subprogram entry may have
906 \addtoindexx{pure attribute}
908 \livelink{chap:DWATpure}{DW\_AT\_pure} attribute, which is
909 a \livelink{chap:flag}{flag}.
910 The attribute indicates whether the subroutine was
911 declared with the ``pure'' keyword or property.
914 \hypertarget{chap:DWATrecursiverecursivepropertyofasubroutine}
915 subprogram entry may have a
916 \livelink{chap:DWATrecursive}{DW\_AT\_recursive} attribute, which
917 is a \livelink{chap:flag}{flag}.
918 The attribute indicates whether the subroutine
919 or entry point was declared with the ``recursive'' keyword
924 \subsection{Subroutine and Entry Point Return Types}
925 \label{chap:subroutineandentrypointreturntypes}
928 \hypertarget{chap:DWATtypetypeofsubroutinereturn}
929 the subroutine or entry point
930 \addtoindexx{return type of subroutine}
931 is a function that returns a
932 value, then its debugging information entry has
933 \addtoindexx{type attribute}
934 a \livelink{chap:DWATtype}{DW\_AT\_type} attribute
935 to denote the type returned by that function.
937 \textit{Debugging information entries for
938 \addtoindex{C} void functions should
939 not have an attribute for the return type. }
942 \subsection{Subroutine and Entry Point Locations}
943 \label{chap:subroutineandentrypointlocations}
945 A subroutine entry may have either a \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} and
946 \livelink{chap:DWAThighpc}{DW\_AT\_high\_pc} pair of attributes or a \livelink{chap:DWATranges}{DW\_AT\_ranges} attribute
947 \addtoindexx{ranges attribute}
949 \addtoindexx{high PC attribute}
951 \addtoindexx{low PC attribute}
952 encode the contiguous or non\dash contiguous address
953 ranges, respectively, of the machine instructions generated
954 for the subroutine (see
955 Section \refersec{chap:codeaddressesandranges}).
958 \hypertarget{chap:DWATentrypcentryaddressofsubprogram}
959 subroutine entry may also have
960 \addtoindexx{entry pc attribute!for subroutine}
962 \livelink{chap:DWATentrypc}{DW\_AT\_entry\_pc} attribute
963 whose value is the address of the first executable instruction
964 of the subroutine (see
965 Section \refersec{chap:entryaddress}).
967 An entry point has a \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} attribute whose value is the
968 relocated address of the first machine instruction generated
972 \livelink{chap:DWATentrypc}{DW\_AT\_entry\_pc} attribute
973 \addtoindexx{entry pc attribute!for subroutine}
975 also seem appropriate
976 for this purpose, historically the
977 \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} attribute
979 \livelink{chap:DWATentrypc}{DW\_AT\_entry\_pc} was introduced (in
980 \addtoindex{DWARF Version 3}).
981 There is insufficient reason to change this.}
987 \addtoindexx{address class!attribute}
989 \hypertarget{chap:DWATaddressclasssubroutineorsubroutinetype}
991 \livelink{chap:DWATsegment}{DW\_AT\_segment}
993 \livelink{chap:DWATaddressclass}{DW\_AT\_address\_class} attributes,
994 as appropriate, to specify
995 which segments the code for the subroutine resides in and
996 the addressing mode to be used in calling that subroutine.
998 A subroutine entry representing a subroutine declaration
999 that is not also a definition does not have code address or
1003 \subsection{Declarations Owned by Subroutines and Entry Points}
1004 \label{chap:declarationsownedbysubroutinesandentrypoints}
1006 The declarations enclosed by a subroutine or entry point are
1007 represented by debugging information entries that are owned
1008 by the subroutine or entry point entry. Entries representing
1009 \addtoindexx{formal parameter}
1010 the formal parameters of the subroutine or entry point appear
1011 in the same order as the corresponding declarations in the
1015 \textit{There is no ordering requirement for entries for declarations
1016 that are children of subroutine or entry point entries but
1017 that do not represent formal parameters. The formal parameter
1018 entries may be interspersed with other entries used by formal
1019 parameter entries, such as type entries.}
1021 The unspecified parameters of a variable parameter list are
1022 represented by a debugging information entry\addtoindexx{unspecified parameters entry}
1024 \livetarg{chap:DWTAGunspecifiedparameters}{DW\_TAG\_unspecified\_parameters}.
1026 The entry for a subroutine that includes
1027 \addtoindexx{Fortran!common block}
1029 \addtoindex{Fortran} common block
1030 \livelink{chap:fortrancommonblock}{common}
1031 \livelink{chap:commonblockentry}{block}
1032 \addtoindexx{common block|see{Fortran common block}}
1033 has a child entry with the
1034 tag \livetarg{chap:DWTAGcommoninclusion}{DW\_TAG\_common\_inclusion}.
1036 \hypertarget{chap:commonreferencecommonblockusage}
1037 common inclusion entry has a
1038 \livelink{chap:DWATcommonreference}{DW\_AT\_common\_reference} attribute
1039 whose value is a reference to the debugging information entry
1040 for the common \nolink{block} being included
1041 (see Section \refersec{chap:commonblockentries}).
1043 \subsection{Low-Level Information}
1044 \label{chap:lowlevelinformation}
1047 \hypertarget{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}
1048 subroutine or entry point entry may have
1049 \addtoindexx{return address attribute}
1051 \livelink{chap:DWATreturnaddr}{DW\_AT\_return\_addr}
1052 attribute, whose value is a location description. The location
1053 calculated is the place where the return address for the
1054 subroutine or entry point is stored.
1057 \hypertarget{chap:DWATframebasesubroutineframebaseaddress}
1058 subroutine or entry point entry may also have
1059 \addtoindexx{frame base attribute}
1061 \livelink{chap:DWATframebase}{DW\_AT\_frame\_base} attribute, whose value is a location
1062 description that computes the \doublequote{frame base} for the
1063 subroutine or entry point. If the location description is
1064 a simple register location description, the given register
1065 contains the frame base address. If the location description is
1066 a DWARF expression, the result of evaluating that expression
1067 is the frame base address. Finally, for a
1068 \addtoindex{location list},
1069 this interpretation applies to each location description
1070 contained in the list of \addtoindex{location list} entries.
1072 \textit{The use of one of the \livelink{chap:DWOPreg}{DW\_OP\_reg}~\textless~n~\textgreater
1074 context is equivalent to using
1075 \livelink{chap:DWOPbreg}{DW\_OP\_breg}~\textless~n~\textgreater(0)
1077 compact. However, these are not equivalent in general.}
1080 \textit{The frame base for a procedure is typically an address fixed
1081 relative to the first unit of storage allocated for the
1082 procedure\textquoteright s stack frame. The \livelink{chap:DWATframebase}{DW\_AT\_frame\_base} attribute
1083 can be used in several ways:}
1084 \begin{enumerate}[1. ]
1085 \item \textit{In procedures that need
1086 \addtoindexx{location list}
1087 location lists to locate local
1088 variables, the \livelink{chap:DWATframebase}{DW\_AT\_frame\_base} can hold the needed location
1089 list, while all variables\textquoteright\ location descriptions can be
1090 simpler ones involving the frame base.}
1092 \item \textit{It can be used in resolving ``up\dash level'' addressing
1093 within nested routines.
1094 (See also \livelink{chap:DWATstaticlink}{DW\_AT\_static\_link}, below)}
1095 %The -See also- here is ok, the DW\_AT should be
1096 %a hyperref to the def itself, which is earlier in this document.
1100 \textit{Some languages support nested subroutines. In such languages,
1101 it is possible to reference the local variables of an
1102 outer subroutine from within an inner subroutine. The
1103 \livelink{chap:DWATstaticlink}{DW\_AT\_static\_link} and \livelink{chap:DWATframebase}{DW\_AT\_frame\_base} attributes allow
1104 debuggers to support this same kind of referencing.}
1107 \hypertarget{chap:DWATstaticlinklocationofuplevelframe}
1109 \addtoindexx{address!uplevel|see {static link attribute}}
1110 \addtoindexx{uplevel address|see {static link attribute}}
1111 subroutine or entry point is nested, it may have a
1112 \livelink{chap:DWATstaticlink}{DW\_AT\_static\_link}
1113 attribute, whose value is a location
1114 description that computes the frame base of the relevant
1115 instance of the subroutine that immediately encloses the
1116 subroutine or entry point.
1118 In the context of supporting nested subroutines, the
1119 \livelink{chap:DWATframebase}{DW\_AT\_frame\_base} attribute value should obey the following
1122 \begin{enumerate}[1. ]
1123 \item It should compute a value that does not change during the
1124 life of the procedure, and
1126 \item The computed value should be unique among instances of
1127 the same subroutine. (For typical \livelink{chap:DWATframebase}{DW\_AT\_frame\_base} use, this
1128 means that a recursive subroutine\textquoteright s stack frame must have
1129 non\dash zero size.)
1132 \textit{If a debugger is attempting to resolve an up\dash level reference
1133 to a variable, it uses the nesting structure of DWARF to
1134 determine which subroutine is the lexical parent and the
1135 \livelink{chap:DWATstaticlink}{DW\_AT\_static\_link} value to identify the appropriate active
1136 frame of the parent. It can then attempt to find the reference
1137 within the context of the parent.}
1141 \subsection{Types Thrown by Exceptions}
1142 \label{chap:typesthrownbyexceptions}
1144 \textit{In \addtoindex{C++} a subroutine may declare a set of types which
1145 it may validly throw.}
1147 If a subroutine explicitly declares that it may throw
1148 \addtoindexx{exception thrown|see{thrown type entry}}
1150 \addtoindexx{thrown exception|see{thrown type entry}}
1151 exception of one or more types, each such type is
1152 represented by a debugging information entry with
1153 \addtoindexx{thrown type entry}
1155 \livetarg{chap:DWTAGthrowntype}{DW\_TAG\_thrown\_type}.
1156 Each such entry is a child of the entry
1157 representing the subroutine that may throw this type. Each
1158 thrown type entry contains
1159 \addtoindexx{type attribute}
1160 a \livelink{chap:DWATtype}{DW\_AT\_type} attribute, whose
1161 value is a reference to an entry describing the type of the
1162 exception that may be thrown.
1164 \subsection{Function Template Instantiations}
1165 \label{chap:functiontemplateinstantiations}
1167 \textit{In \addtoindex{C++}, a function template is a generic definition of
1168 a function that is instantiated differently for calls with
1169 values of different types. DWARF does not represent the generic
1170 template definition, but does represent each instantiation.}
1172 A \addtoindex{template instantiation} is represented by a debugging
1173 information entry with the
1174 \addtoindexx{subprogram entry!use for template instantiation}
1175 tag \livelink{chap:DWTAGsubprogram}{DW\_TAG\_subprogram}.
1177 exceptions, such an entry will contain the same attributes and
1178 will have the same types of child entries as would an entry
1179 for a subroutine defined explicitly using the instantiation
1180 types. The exceptions are:
1182 \begin{enumerate}[1. ]
1183 \item Each formal parameterized type declaration appearing in the
1184 template definition is represented by a debugging information
1186 \addtoindexx{template type parameter entry}
1187 tag \livetarg{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter}.
1189 such entry has a \livelink{chap:DWATname}{DW\_AT\_name} attribute,
1190 \addtoindexx{name attribute}
1192 null\dash terminated string containing the name of the formal
1193 type parameter as it appears in the source program. The
1194 \addtoindexx{formal type parameter|see{template type parameter entry}}
1195 template type parameter entry also has
1196 \addtoindexx{type attribute}
1197 a \livelink{chap:DWATtype}{DW\_AT\_type} attribute
1198 describing the actual type by which the formal is replaced
1199 for this instantiation.
1201 \item The subprogram entry and each of its child entries reference
1202 a template type parameter entry in any circumstance where
1203 the template definition referenced a formal parameterized type.
1205 \item If the compiler has generated a special compilation unit
1206 to hold the template instantiation and that compilation unit
1207 has a different name from the compilation unit containing
1208 the template definition, the name attribute for the debugging
1209 information entry representing that compilation unit is empty
1212 \item If the subprogram entry representing the template
1213 instantiation or any of its child entries contain declaration
1214 coordinate attributes, those attributes refer to the source
1215 for the template definition, not to any source generated
1216 artificially by the compiler for this instantiation.
1221 \subsection{Inlinable and Inlined Subroutines}
1222 A declaration or a definition of an inlinable subroutine
1223 is represented by a debugging information entry with the
1225 \livelink{chap:DWTAGsubprogram}{DW\_TAG\_subprogram}.
1227 \addtoindexx{subprogram entry!use in inlined subprogram}
1229 \hypertarget{chap:DWATinlineinlinedsubroutine}
1230 explicitly declared to be available for inline expansion or
1231 that was expanded inline implicitly by the compiler has
1232 \addtoindexx{inline attribute}
1234 \livelink{chap:DWATinline}{DW\_AT\_inline} attribute whose value is an integer constant. The
1235 set of values for the \livelink{chap:DWATinline}{DW\_AT\_inline} attribute is given in
1236 Table \refersec{tab:inlinecodes}.
1240 \caption{Inline codes}
1241 \label{tab:inlinecodes}
1242 \begin{tabular}{l|p{8cm}}
1244 Name&Meaning\\ \hline
1245 \livetarg{chap:DWINLnotinlined}{DW\_INL\_not\_inlined} & Not declared inline nor inlined by the
1246 \mbox{compiler} (equivalent to the absence of the
1247 containing \livelink{chap:DWATinline}{DW\_AT\_inline} attribute) \\
1248 \livetarg{chap:DWINLinlined}{DW\_INL\_inlined} & Not declared inline but inlined by the \mbox{compiler} \\
1249 \livetarg{chap:DWINLdeclarednotinlined}{DW\_INL\_declared\_not\_inlined} & Declared inline but
1250 not inlined by the \mbox{compiler} \\
1251 \livetarg{chap:DWINLdeclaredinlined}{DW\_INL\_declared\_inlined} & Declared inline and inlined by the
1257 \textit{In \addtoindex{C++}, a function or a constructor declared with
1258 constexpr is implicitly declared inline. The abstract inline
1259 instance (see below) is represented by a debugging information
1260 entry with the tag \livelink{chap:DWTAGsubprogram}{DW\_TAG\_subprogram}. Such an entry has a
1261 \livelink{chap:DWATinline}{DW\_AT\_inline} attribute whose value is \livelink{chap:DWINLinlined}{DW\_INL\_inlined}.}
1264 \subsubsection{Abstract Instances}
1265 \label{chap:abstractinstances}
1266 Any debugging information entry that is owned (either
1267 \hypertarget{chap:DWATinlineabstracttinstance}
1268 directly or indirectly) by a debugging information entry
1270 \livelink{chap:DWATinline}{DW\_AT\_inline} attribute is referred to
1271 \addtoindexx{abstract instance!entry}
1272 as an ``abstract instance entry.''
1273 Any subroutine entry
1275 \addtoindexx{inline attribute}
1276 a \livelink{chap:DWATinline}{DW\_AT\_inline} attribute whose value is other
1277 than \livelink{chap:DWINLnotinlined}{DW\_INL\_not\_inlined}
1279 \addtoindexx{abstract instance!root}
1280 an ``abstract instance root.''
1281 Any set of abstract instance entries that are all
1282 children (either directly or indirectly) of some abstract
1283 instance root, together with the root itself, is known as
1284 \addtoindexx{abstract instance!tree}
1285 an ``abstract instance tree.'' However, in the case where
1286 an abstract instance tree is nested within another abstract
1287 instance tree, the entries in the
1288 \addtoindex{nested abstract instance}
1289 tree are not considered to be entries in the outer abstract
1292 Each abstract instance root is either part of a larger
1293 \addtoindexx{abstract instance!root}
1294 tree (which gives a context for the root) or
1295 \addtoindexx{specification attribute}
1297 \livelink{chap:DWATspecification}{DW\_AT\_specification}
1298 to refer to the declaration in context.
1300 \textit{For example, in \addtoindex{C++} the context might be a namespace
1301 declaration or a class declaration.}
1303 \textit{Abstract instance trees are defined so that no entry is part
1304 of more than one abstract instance tree. This simplifies the
1305 following descriptions.}
1307 A debugging information entry that is a member of an abstract
1308 instance tree should not contain any attributes which describe
1309 aspects of the subroutine which vary between distinct inlined
1310 expansions or distinct out\dash of\dash line expansions. For example,
1311 \addtoindexx{entry pc attribute!and abstract instance}
1312 the \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc},
1313 \livelink{chap:DWAThighpc}{DW\_AT\_high\_pc},
1314 \livelink{chap:DWATranges}{DW\_AT\_ranges},
1315 \livelink{chap:DWATentrypc}{DW\_AT\_entry\_pc},
1316 \livelink{chap:DWATlocation}{DW\_AT\_location},
1317 \livelink{chap:DWATreturnaddr}{DW\_AT\_return\_addr},
1318 \livelink{chap:DWATstartscope}{DW\_AT\_start\_scope},
1320 \livelink{chap:DWATsegment}{DW\_AT\_segment}
1322 \addtoindexx{location attribute!and abstract instance}
1324 \addtoindexx{ranges attribute!and abstract instance}
1326 \addtoindexx{high PC attribute!and abstract instance}
1328 \addtoindexx{low PC attribute!and abstract instance}
1330 \addtoindexx{segment attribute!and abstract instance}
1332 \addtoindexx{return address attribute!and abstract instance}
1334 \addtoindexx{segment attribute!and abstract instance}
1336 \addtoindexx{start scope attribute!and abstract instance}
1340 \textit{It would not make sense normally to put these attributes into
1341 abstract instance entries since such entries do not represent
1342 actual (concrete) instances and thus do not actually exist at
1343 run\dash time. However,
1344 see Appendix \refersec{app:inlineouteronenormalinner}
1345 for a contrary example.}
1347 The rules for the relative location of entries belonging to
1348 abstract instance trees are exactly the same as for other
1349 similar types of entries that are not abstract. Specifically,
1350 the rule that requires that an entry representing a declaration
1351 be a direct child of the entry representing the scope of the
1352 declaration applies equally to both abstract and non\dash abstract
1353 entries. Also, the ordering rules for formal parameter entries,
1354 member entries, and so on, all apply regardless of whether
1355 or not a given entry is abstract.
1357 \subsubsection{Concrete Inlined Instances}
1358 \label{chap:concreteinlinedinstances}
1360 Each inline expansion of a subroutine is represented
1361 by a debugging information entry with the
1362 tag \livetarg{chap:DWTAGinlinedsubroutine}{DW\_TAG\_inlined\_subroutine}.
1363 Each such entry should be a direct
1364 child of the entry that represents the scope within which
1365 the inlining occurs.
1367 Each inlined subroutine entry may have either a
1368 \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc}
1369 and \livelink{chap:DWAThighpc}{DW\_AT\_high\_pc} pair
1371 \addtoindexx{high PC attribute}
1373 \addtoindexx{low PC attribute}
1375 \addtoindexx{ranges attribute}
1377 \livelink{chap:DWATranges}{DW\_AT\_ranges}
1378 attribute whose values encode the contiguous or non\dash contiguous
1379 address ranges, respectively, of the machine instructions
1380 generated for the inlined subroutine (see
1381 Section \refersec{chap:codeaddressesandranges}).
1383 \hypertarget{chap:DWATentrypcentryaddressofinlinedsubprogram}
1384 inlined subroutine entry may
1385 \addtoindexx{inlined subprogram entry!in concrete instance}
1387 \addtoindexx{inlined subprogram entry}
1389 \addtoindexx{entry pc attribute!for inlined subprogram}
1391 \livelink{chap:DWATentrypc}{DW\_AT\_entry\_pc}
1392 attribute, representing the first executable instruction of
1393 the inline expansion (see
1394 Section \refersec{chap:entryaddress}).
1396 % Positions of the 3 targets here is a bit arbitrary.
1398 \hypertarget{chap:DWATcalllinelinenumberofinlinedsubroutinecall}
1400 \hypertarget{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}
1402 \hypertarget{chap:DWATcallfilefilecontaininginlinedsubroutinecall}
1403 may also have \livelink{chap:DWATcallfile}{DW\_AT\_call\_file},
1404 \livelink{chap:DWATcallline}{DW\_AT\_call\_line} and \livelink{chap:DWATcallcolumn}{DW\_AT\_call\_column} attributes,
1406 value is an integer constant. These attributes represent the
1407 source file, source line number, and source column number,
1408 respectively, of the first character of the statement or
1409 expression that caused the inline expansion. The call file,
1410 call line, and call column attributes are interpreted in
1411 the same way as the declaration file, declaration line, and
1412 declaration column attributes, respectively (see
1413 Section \refersec{chap:declarationcoordinates}).
1415 \textit{The call file, call line and call column coordinates do not
1416 describe the coordinates of the subroutine declaration that
1417 was inlined, rather they describe the coordinates of the call.
1420 An inlined subroutine entry
1421 \hypertarget{chap:DWATconstexprcompiletimeconstantfunction}
1423 \livelink{chap:DWATconstexpr}{DW\_AT\_const\_expr}
1424 attribute, which is a \livelink{chap:flag}{flag}
1425 whose presence indicates that the
1426 subroutine has been evaluated as a compile\dash time constant. Such
1427 an entry may also have a \livelink{chap:DWATconstvalue}{DW\_AT\_const\_value} attribute,
1428 whose value may be of any form that is appropriate for the
1429 representation of the subroutine's return value. The value of
1430 this attribute is the actual return value of the subroutine,
1431 represented as it would be on the target architecture.
1433 \textit{In \addtoindex{C++}, if a function or a constructor declared with constexpr
1434 is called with constant expressions, then the corresponding
1435 concrete inlined instance has a
1436 \livelink{chap:DWATconstexpr}{DW\_AT\_const\_expr} attribute,
1437 as well as a \livelink{chap:DWATconstvalue}{DW\_AT\_const\_value} attribute whose value represents
1438 the actual return value of the concrete inlined instance.}
1440 Any debugging information entry that is owned (either
1441 directly or indirectly) by a debugging information entry
1442 with the tag \livelink{chap:DWTAGinlinedsubroutine}{DW\_TAG\_inlined\_subroutine} is referred to as a
1443 ``concrete inlined instance entry.'' Any entry that has
1445 \livelink{chap:DWTAGinlinedsubroutine}{DW\_TAG\_inlined\_subroutine}
1446 is known as a ``concrete inlined instance root.''
1447 Any set of concrete inlined instance
1448 entries that are all children (either directly or indirectly)
1449 of some concrete inlined instance root, together with the root
1450 itself, is known as a ``concrete inlined instance tree.''
1451 However, in the case where a concrete inlined instance tree
1452 is nested within another concrete instance tree, the entries
1453 in the \addtoindex{nested concrete inline instance} tree
1454 are not considered to
1455 be entries in the outer concrete instance tree.
1457 \textit{Concrete inlined instance trees are defined so that no entry
1458 is part of more than one concrete inlined instance tree. This
1459 simplifies later descriptions.}
1461 Each concrete inlined instance tree is uniquely associated
1462 with one (and only one) abstract instance tree.
1464 \textit{Note, however, that the reverse is not true. Any given abstract
1465 instance tree may be associated with several different concrete
1466 inlined instance trees, or may even be associated with zero
1467 concrete inlined instance trees.}
1469 Concrete inlined instance entries may omit attributes that
1470 are not specific to the concrete instance (but present in
1471 the abstract instance) and need include only attributes that
1472 are specific to the concrete instance (but omitted in the
1473 abstract instance). In place of these omitted attributes, each
1474 \hypertarget{chap:DWATabstractorigininlineinstance}
1475 concrete inlined instance entry
1476 \addtoindexx{abstract origin attribute}
1478 \livelink{chap:DWATabstractorigin}{DW\_AT\_abstract\_origin}
1479 attribute that may be used to obtain the missing information
1480 (indirectly) from the associated abstract instance entry. The
1481 value of the abstract origin attribute is a reference to the
1482 associated abstract instance entry.
1484 If an entry within a concrete inlined instance tree contains
1485 attributes describing the
1486 \addtoindexx{declaration coordinates!in concrete instance}
1487 declaration coordinates
1489 entry, then those attributes should refer to the file, line
1490 and column of the original declaration of the subroutine,
1491 not to the point at which it was inlined. As a consequence,
1492 they may usually be omitted from any entry that has an abstract
1495 For each pair of entries that are associated via a
1496 \addtoindexx{abstract origin attribute}
1497 \livelink{chap:DWATabstractorigin}{DW\_AT\_abstract\_origin} attribute, both members of the pair
1498 have the same tag. So, for example, an entry with the tag
1499 \livelink{chap:DWTAGvariable}{DW\_TAG\_variable} can only be associated with another entry
1500 that also has the tag \livelink{chap:DWTAGvariable}{DW\_TAG\_variable}. The only exception
1501 to this rule is that the root of a concrete instance tree
1502 (which must always have the tag \livelink{chap:DWTAGinlinedsubroutine}{DW\_TAG\_inlined\_subroutine})
1503 can only be associated with the root of its associated abstract
1504 instance tree (which must have the tag \livelink{chap:DWTAGsubprogram}{DW\_TAG\_subprogram}).
1506 In general, the structure and content of any given concrete
1507 inlined instance tree will be closely analogous to the
1508 structure and content of its associated abstract instance
1509 tree. There are a few exceptions:
1511 \begin{enumerate}[1. ]
1512 \item An entry in the concrete instance tree may be omitted if
1514 \addtoindexx{abstract origin attribute}
1515 \livelink{chap:DWATabstractorigin}{DW\_AT\_abstract\_origin} attribute and either
1516 has no children, or its children are omitted. Such entries
1517 would provide no useful information. In C\dash like languages,
1518 such entries frequently include types, including structure,
1519 union, class, and interface types; and members of types. If any
1520 entry within a concrete inlined instance tree needs to refer
1521 to an entity declared within the scope of the relevant inlined
1522 subroutine and for which no concrete instance entry exists,
1523 the reference should refer to the abstract instance entry.
1525 \item Entries in the concrete instance tree which are associated
1526 with entries in the abstract instance tree such that neither
1527 has a \livelink{chap:DWATname}{DW\_AT\_name} attribute,
1528 \addtoindexx{name attribute}
1529 and neither is referenced by
1530 any other debugging information entry, may be omitted. This
1531 may happen for debugging information entries in the abstract
1532 instance trees that became unnecessary in the concrete instance
1533 tree because of additional information available there. For
1534 example, an anonymous variable might have been created and
1535 described in the abstract instance tree, but because of
1536 the actual parameters for a particular inlined expansion,
1537 it could be described as a constant value without the need
1538 for that separate debugging information entry.
1540 \item A concrete instance tree may contain entries which do
1541 not correspond to entries in the abstract instance tree
1542 to describe new entities that are specific to a particular
1543 inlined expansion. In that case, they will not have associated
1544 entries in the abstract instance tree, should not contain
1545 \addtoindexx{abstract origin attribute}
1546 \livelink{chap:DWATabstractorigin}{DW\_AT\_abstract\_origin} attributes, and must contain all their
1547 own attributes directly. This allows an abstract instance tree
1548 to omit debugging information entries for anonymous entities
1549 that are unlikely to be needed in most inlined expansions. In
1550 any expansion which deviates from that expectation, the
1551 entries can be described in its concrete inlined instance tree.
1555 \subsubsection{Out-of-Line Instances of Inlined Subroutines}
1556 \label{chap:outoflineinstancesofinlinedsubroutines}
1557 Under some conditions, compilers may need to generate concrete
1558 executable instances of inlined subroutines other than at
1559 points where those subroutines are actually called. Such
1560 concrete instances of inlined subroutines are referred to as
1561 ``concrete out\dash of\dash line instances.''
1563 \textit{In \addtoindex{C++}, for example,
1564 taking the address of a function declared
1565 to be inline can necessitate the generation of a concrete
1566 out\dash of\dash line instance of the given function.}
1568 The DWARF representation of a concrete out\dash of\dash line instance
1569 of an inlined subroutine is essentially the same as for a
1570 concrete inlined instance of that subroutine (as described in
1571 the preceding section). The representation of such a concrete
1572 % It is critical that the hypertarget and livelink be
1573 % separated to avoid problems with latex.
1574 out\dash of\dash line
1575 \addtoindexx{abstract origin attribute}
1577 \hypertarget{chap:DWATabstractoriginoutoflineinstance}
1579 \livelink{chap:DWATabstractorigin}{DW\_AT\_abstract\_origin}
1580 attributes in exactly the same way as they are used for
1581 a concrete inlined instance (that is, as references to
1582 corresponding entries within the associated abstract instance
1585 The differences between the DWARF representation of a
1586 concrete out\dash of\dash line instance of a given subroutine and the
1587 representation of a concrete inlined instance of that same
1588 subroutine are as follows:
1590 \begin{enumerate}[1. ]
1591 \item The root entry for a concrete out\dash of\dash line instance
1592 of a given inlined subroutine has the same tag as does its
1593 associated (abstract) inlined subroutine entry (that is, tag
1594 \livelink{chap:DWTAGsubprogram}{DW\_TAG\_subprogram} rather than \livelink{chap:DWTAGinlinedsubroutine}{DW\_TAG\_inlined\_subroutine}).
1596 \item The root entry for a concrete out\dash of\dash line instance tree
1597 is normally owned by the same parent entry that also owns
1598 the root entry of the associated abstract instance. However,
1599 it is not required that the abstract and out\dash of\dash line instance
1600 trees be owned by the same parent entry.
1604 \subsubsection{Nested Inlined Subroutines}
1605 \label{nestedinlinedsubroutines}
1606 Some languages and compilers may permit the logical nesting of
1607 a subroutine within another subroutine, and may permit either
1608 the outer or the nested subroutine, or both, to be inlined.
1610 For a non\dash inlined subroutine nested within an inlined
1611 subroutine, the nested subroutine is described normally in
1612 both the abstract and concrete inlined instance trees for
1613 the outer subroutine. All rules pertaining to the abstract
1614 and concrete instance trees for the outer subroutine apply
1615 also to the abstract and concrete instance entries for the
1618 For an inlined subroutine nested within another inlined
1619 subroutine, the following rules apply to their abstract and
1620 \addtoindexx{abstract instance!nested}
1621 \addtoindexx{concrete instance!nested}
1622 concrete instance trees:
1624 \begin{enumerate}[1. ]
1625 \item The abstract instance tree for the nested subroutine is
1626 described within the abstract instance tree for the outer
1627 subroutine according to the rules in
1628 Section \refersec{chap:abstractinstances}, and
1629 without regard to the fact that it is within an outer abstract
1632 \item Any abstract instance tree for a nested subroutine is
1633 always omitted within the concrete instance tree for an
1636 \item A concrete instance tree for a nested subroutine is
1637 always omitted within the abstract instance tree for an
1640 \item The concrete instance tree for any inlined or
1641 \addtoindexx{out-of-line instance}
1643 \addtoindexx{out-of-line-instance|see{concrete out-of-line-instance}}
1644 expansion of the nested subroutine is described within a
1645 concrete instance tree for the outer subroutine according
1647 Sections \refersec{chap:concreteinlinedinstances} or
1648 \refersec{chap:outoflineinstancesofinlinedsubroutines}
1650 and without regard to the fact that it is within an outer
1651 concrete instance tree.
1654 See Appendix \refersec{app:inliningexamples}
1655 for discussion and examples.
1657 \subsection{Trampolines}
1658 \label{chap:trampolines}
1660 \textit{A trampoline is a compiler\dash generated subroutine that serves as
1661 \hypertarget{chap:DWATtrampolinetargetsubroutine}
1662 an intermediary in making a call to another subroutine. It may
1663 adjust parameters and/or the result (if any) as appropriate
1664 to the combined calling and called execution contexts.}
1666 A trampoline is represented by a debugging information entry
1667 \addtoindexx{trampoline (subprogam) entry}
1668 with the tag \livelink{chap:DWTAGsubprogram}{DW\_TAG\_subprogram} or \livelink{chap:DWTAGinlinedsubroutine}{DW\_TAG\_inlined\_subroutine}
1670 \addtoindexx{trampoline attribute}
1671 a \livelink{chap:DWATtrampoline}{DW\_AT\_trampoline} attribute.
1673 attribute indicates the target subroutine of the trampoline,
1674 that is, the subroutine to which the trampoline passes
1675 control. (A trampoline entry may but need not also have a
1676 \livelink{chap:DWATartificial}{DW\_AT\_artificial} attribute.)
1679 The value of the trampoline attribute may be represented
1680 using any of the following forms, which are listed in order
1684 \item If the value is of class reference, then the value
1685 specifies the debugging information entry of the target
1688 \item If the value is of class address, then the value is
1689 the relocated address of the target subprogram.
1691 \item If the value is of class string, then the value is the
1692 (possibly mangled) \addtoindexx{mangled names}
1693 name of the target subprogram.
1695 \item If the value is of class \livelink{chap:flag}{flag}, then the value true
1696 indicates that the containing subroutine is a trampoline but
1697 that the target subroutine is not known.
1701 The target subprogram may itself be a trampoline. (A sequence
1702 of trampolines necessarily ends with a non\dash trampoline
1705 \textit{In \addtoindex{C++}, trampolines may be used
1706 to implement derived virtual
1707 member functions; such trampolines typically adjust the
1708 \addtoindexx{this parameter}
1709 implicit this pointer parameter in the course of passing
1711 Other languages and environments may use trampolines
1712 in a manner sometimes known as transfer functions or transfer
1715 \textit{Trampolines may sometimes pass control to the target
1716 subprogram using a branch or jump instruction instead of a
1717 call instruction, thereby leaving no trace of their existence
1718 in the subsequent execution context. }
1720 \textit{This attribute helps make it feasible for a debugger to arrange
1721 that stepping into a trampoline or setting a breakpoint in
1722 a trampoline will result in stepping into or setting the
1723 breakpoint in the target subroutine instead. This helps to
1724 hide the compiler generated subprogram from the user. }
1726 \textit{If the target subroutine is not known, a debugger may choose
1727 to repeatedly step until control arrives in a new subroutine
1728 which can be assumed to be the target subroutine. }
1732 \section{Lexical Block Entries}
1733 \label{chap:lexicalblockentries}
1736 lexical \livetargi{chap:lexicalblock}{block}{lexical block}
1738 \addtoindexx{lexical block}
1739 a bracketed sequence of source statements
1740 that may contain any number of declarations. In some languages
1741 (including \addtoindex{C} and \addtoindex{C++}),
1742 \nolink{blocks} can be nested within other
1743 \nolink{blocks} to any depth.}
1745 % We do not need to link to the preceding paragraph.
1746 A lexical \nolink{block} is represented by a debugging information
1748 tag \livetarg{chap:DWTAGlexicalblock}{DW\_TAG\_lexical\_block}.
1750 The lexical \livetargi{chap:lexicalblockentry}{block}{lexical block entry}
1752 either a \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} and
1753 \livelink{chap:DWAThighpc}{DW\_AT\_high\_pc} pair of
1755 \addtoindexx{high PC attribute}
1757 \addtoindexx{low PC attribute}
1759 \livelink{chap:DWATranges}{DW\_AT\_ranges} attribute
1760 \addtoindexx{ranges attribute}
1761 whose values encode the contiguous or non-contiguous address
1762 ranges, respectively, of the machine instructions generated
1763 for the lexical \nolink{block}
1764 (see Section \refersec{chap:codeaddressesandranges}).
1766 If a name has been given to the
1767 lexical \nolink{block}
1769 program, then the corresponding
1770 lexical \nolink{block} entry has a
1771 \livelink{chap:DWATname}{DW\_AT\_name} attribute whose
1772 \addtoindexx{name attribute}
1773 value is a null\dash terminated string
1774 containing the name of the lexical \nolink{block}
1778 \textit{This is not the same as a \addtoindex{C} or
1779 \addtoindex{C++} label (see below).}
1781 The lexical \nolink{block} entry owns
1782 debugging information entries that
1783 describe the declarations within that lexical \nolink{block}.
1785 one such debugging information entry for each local declaration
1786 of an identifier or inner lexical \nolink{block}.
1788 \section{Label Entries}
1789 \label{chap:labelentries}
1790 \textit{A label is a way of identifying a source statement. A labeled
1791 statement is usually the target of one or more ``go to''
1795 A label is represented by a debugging information entry with
1796 \addtoindexx{label entry}
1798 tag \livetarg{chap:DWTAGlabel}{DW\_TAG\_label}.
1799 The entry for a label should be owned by
1800 the debugging information entry representing the scope within
1801 which the name of the label could be legally referenced within
1804 The label entry has a \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} attribute whose value
1805 is the relocated address of the first machine instruction
1806 generated for the statement identified by the label in
1807 the source program. The label entry also has a
1808 \livelink{chap:DWATname}{DW\_AT\_name} attribute
1809 \addtoindexx{name attribute}
1810 whose value is a null-terminated string containing
1811 the name of the label as it appears in the source program.
1814 \section{With Statement Entries}
1815 \label{chap:withstatemententries}
1817 \textit{Both \addtoindex{Pascal} and
1818 \addtoindexx{Modula-2}
1819 Modula\dash 2 support the concept of a ``with''
1820 statement. The with statement specifies a sequence of
1821 executable statements within which the fields of a record
1822 variable may be referenced, unqualified by the name of the
1825 A with statement is represented by a
1826 \addtoindexi{debugging information entry}{with statement entry}
1827 with the tag \livetarg{chap:DWTAGwithstmt}{DW\_TAG\_with\_stmt}.
1829 A with statement entry may have either a
1830 \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} and
1831 \livelink{chap:DWAThighpc}{DW\_AT\_high\_pc} pair of attributes
1832 \addtoindexx{high PC attribute}
1834 \addtoindexx{low PC attribute}
1835 a \livelink{chap:DWATranges}{DW\_AT\_ranges} attribute
1836 \addtoindexx{ranges attribute}
1837 whose values encode the contiguous or non\dash contiguous address
1838 ranges, respectively, of the machine instructions generated
1839 for the with statement
1840 (see Section \refersec{chap:codeaddressesandranges}).
1842 The with statement entry has
1843 \addtoindexx{type attribute}
1844 a \livelink{chap:DWATtype}{DW\_AT\_type} attribute, denoting
1845 the type of record whose fields may be referenced without full
1846 qualification within the body of the statement. It also has
1847 \addtoindexx{location attribute}
1848 a \livelink{chap:DWATlocation}{DW\_AT\_location} attribute, describing how to find the base
1849 address of the record object referenced within the body of
1852 \section{Try and Catch Block Entries}
1853 \label{chap:tryandcatchblockentries}
1855 \textit{In \addtoindex{C++} a lexical \livelink{chap:lexicalblock}{block} may be
1856 designated as a ``catch \nolink{block}.''
1857 A catch \livetargi{chap:catchblock}{block}{catch block} is an
1858 exception handler that handles
1859 exceptions thrown by an immediately
1860 preceding ``try \livelink{chap:tryblock}{block}.''
1861 A catch \livelink{chap:catchblock}{block}
1862 designates the type of the exception that it
1865 A try \livetargi{chap:tryblock}{block}{try block} is represented
1866 by a debugging information entry
1867 \addtoindexx{try block entry}
1868 with the tag \livetarg{chap:DWTAGtryblock}{DW\_TAG\_try\_block}.
1869 A catch \livelink{chap:catchblock}{block} is represented by
1870 a debugging information entry with
1871 \addtoindexx{catch block entry}
1872 the tag \livetarg{chap:DWTAGcatchblock}{DW\_TAG\_catch\_block}.
1874 % nolink as we have links just above and do not have a combo link for both
1875 Both try and catch \nolink{block} entries may have either a
1876 \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} and
1877 \livelink{chap:DWAThighpc}{DW\_AT\_high\_pc} pair of attributes
1878 \addtoindexx{high PC attribute}
1880 \addtoindexx{low PC attribute}
1882 \livelink{chap:DWATranges}{DW\_AT\_ranges} attribute
1883 \addtoindexx{ranges attribute}
1884 whose values encode the contiguous
1885 or non\dash contiguous address ranges, respectively, of the
1886 machine instructions generated for the \livelink{chap:lexicalblock}{block}
1888 \refersec{chap:codeaddressesandranges}).
1890 Catch \livelink{chap:catchblock}{block} entries have at
1891 least one child entry, an
1892 entry representing the type of exception accepted by
1893 that catch \livelink{chap:catchblock}{block}.
1894 This child entry has one of
1895 \addtoindexx{formal parameter entry!in catch block}
1897 \addtoindexx{unspecified parameters entry!in catch block}
1899 \livelink{chap:DWTAGformalparameter}{DW\_TAG\_formal\_parameter} or
1900 \livelink{chap:DWTAGunspecifiedparameters}{DW\_TAG\_unspecified\_parameters},
1901 and will have the same form as other parameter entries.
1903 The siblings immediately following
1904 a try \livelink{chap:tryblock}{block} entry are its
1905 corresponding catch \livelink{chap:catchblock}{block} entries.