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:DWLANGGo}{DW\_LANG\_Go} \dag & \addtoindex{Go}\\
155 \livetarg{chap:DWLANGHaskell}{DW\_LANG\_Haskell} \dag & \addtoindex{Haskell}\\
156 \livetarg{chap:DWLANGJava}{DW\_LANG\_Java} & \addtoindex{Java}\\
157 \livetarg{chap:DWLANGModula2}{DW\_LANG\_Modula2} & ISO Modula\dash 2:1996 \addtoindexx{Modula-2}\\
158 \livetarg{chap:DWLANGModula3}{DW\_LANG\_Modula3} & \addtoindex{Modula-3}\\
159 \livetarg{chap:DWLANGObjC}{DW\_LANG\_ObjC} & \addtoindex{Objective C}\\
160 \livetarg{chap:DWLANGObjCplusplus}{DW\_LANG\_ObjC\_plus\_plus} & \addtoindex{Objective C++}\\
161 \livetarg{chap:DWLANGOpenCL}{DW\_LANG\_OpenCL} \dag & \addtoindex{OpenCL}\\
162 \livetarg{chap:DWLANGPascal83}{DW\_LANG\_Pascal83} & ISO \addtoindex{Pascal}:1983\\
163 \livetarg{chap:DWLANGPLI}{DW\_LANG\_PLI} \dag & ANSI \addtoindex{PL/I}:1976\\
164 \livetarg{chap:DWLANGPython}{DW\_LANG\_Python} \dag & \addtoindex{Python}\\
165 \livetarg{chap:DWLANGUPC}{DW\_LANG\_UPC} &\addtoindex{Unified Parallel C}\addtoindexx{UPC}\\ \hline
166 \dag \ \ \textit{Support for these languages is limited.}& \\
170 \item A \livelink{chap:DWATstmtlist}{DW\_AT\_stmt\_list}
171 attribute whose value is
172 \addtoindexx{statement list attribute}
174 \addtoindexx{section offset!in statement list attribute}
176 \hypertarget{chap:DWATstmtlistlinenumberinformationforunit}
177 offset to the line number information for this compilation
180 This information is placed in a separate object file
181 section from the debugging information entries themselves. The
182 value of the statement list attribute is the offset in the
183 \dotdebugline{} section of the first byte of the line number
184 information for this compilation unit
185 (see Section \refersec{chap:linenumberinformation}).
188 \item A \livelink{chap:DWATmacroinfo}{DW\_AT\_macro\_info} attribute
189 \addtoindexx{macro information attribute}
191 \addtoindexx{section offset!in macro information attribute}
193 \hypertarget{chap:DWATmacroinfomacroinformation}
194 offset to the macro information for this compilation unit.
196 This information is placed in a separate object file section
197 from the debugging information entries themselves. The
198 value of the macro information attribute is the offset in
199 the \dotdebugmacinfo{} section of the first byte of the macro
200 information for this compilation unit
201 (see Section \refersec{chap:macroinformation}).
205 \livelink{chap:DWATcompdir}{DW\_AT\_comp\_dir}
207 \hypertarget{chap:DWATcompdircompilationdirectory}
209 null\dash terminated string containing the current working directory
210 of the compilation command that produced this compilation
211 unit in whatever form makes sense for the host system.
213 \item A \livelink{chap:DWATproducer}{DW\_AT\_producer} attribute
214 \addtoindexx{producer attribute}
215 whose value is a null\dash
216 terminated string containing information about the compiler
217 \hypertarget{chap:DWATproducercompileridentification}
218 that produced the compilation unit. The actual contents of
219 the string will be specific to each producer, but should
220 begin with the name of the compiler vendor or some other
221 identifying character sequence that should avoid confusion
222 with other producer values.
225 \item A \livelink{chap:DWATidentifiercase}{DW\_AT\_identifier\_case}
227 \addtoindexx{identifier case attribute}
229 \hypertarget{chap:DWATidentifiercaseidentifiercaserule}
230 constant value is a code describing the treatment
231 of identifiers within this compilation unit. The
232 set of identifier case codes is given in
233 Table \refersec{tab:identifiercasecodes}.
235 \begin{simplenametable}{Identifier case codes}{tab:identifiercasecodes}
236 \livelink{chap:DWIDcasesensitive}{DW\_ID\_case\_sensitive} \\
237 \livelink{chap:DWIDupcase}{DW\_ID\_up\_case} \\
238 \livelink{chap:DWIDdowncase}{DW\_ID\_down\_case} \\
239 \livelink{chap:DWIDcaseinsensitive}{DW\_ID\_case\_insensitive} \\
240 \end{simplenametable}
242 \livetarg{chap:DWIDcasesensitive}{DW\_ID\_case\_sensitive} is the default for all compilation units
243 that do not have this attribute. It indicates that names given
244 as the values of \livelink{chap:DWATname}{DW\_AT\_name} attributes
245 \addtoindexx{name attribute}
246 in debugging information
247 entries for the compilation unit reflect the names as they
248 appear in the source program. The debugger should be sensitive
249 to the case of identifier names when doing identifier lookups.
251 \livetarg{chap:DWIDupcase}{DW\_ID\_up\_case} means that the
252 producer of the debugging
253 information for this compilation unit converted all source
254 names to upper case. The values of the name attributes may not
255 reflect the names as they appear in the source program. The
256 debugger should convert all names to upper case when doing
259 \livetarg{chap:DWIDdowncase}{DW\_ID\_down\_case} means that
260 the producer of the debugging
261 information for this compilation unit converted all source
262 names to lower case. The values of the name attributes may not
263 reflect the names as they appear in the source program. The
264 debugger should convert all names to lower case when doing
268 \livetarg{chap:DWIDcaseinsensitive}{DW\_ID\_case\_insensitive} means that the values of the name
269 attributes reflect the names as they appear in the source
270 program but that a case insensitive lookup should be used to
274 \item A \livelink{chap:DWATbasetypes}{DW\_AT\_base\_types} attribute whose value is a
275 \livelink{chap:classreference}{reference}.
278 \hypertarget{chap:DWATbasetypesprimitivedatatypesofcompilationunit}
280 \addtoindexx{base types attribute}
281 points to a debugging information entry
282 representing another compilation unit. It may be used
283 to specify the compilation unit containing the base type
284 entries used by entries in the current compilation unit
285 (see Section \refersec{chap:basetypeentries}).
288 This attribute provides a consumer a way to find the definition
289 of base types for a compilation unit that does not itself
290 contain such definitions. This allows a consumer, for example,
291 to interpret a type conversion to a base type
292 % getting this link target at the right spot is tricky.
293 \hypertarget{chap:DWATuseUTF8compilationunitusesutf8strings}
296 \item A \livelink{chap:DWATuseUTF8}{DW\_AT\_use\_UTF8} attribute,
297 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
298 which is a \livelink{chap:classflag}{flag} whose
299 presence indicates that all strings (such as the names of
300 declared entities in the source program) are represented
301 using the UTF\dash 8 representation
302 (see Section \refersec{datarep:attributeencodings}).
305 \item A \livelink{chap:DWATmainsubprogram}{DW\_AT\_main\_subprogram} attribute, which is a \livelink{chap:classflag}{flag}
306 \addtoindexx{main subprogram attribute}
307 whose presence indicates
308 \hypertarget{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}
309 that the compilation unit contains a
310 subprogram that has been identified as the starting function
311 of the program. If more than one compilation unit contains
312 this \nolink{flag}, any one of them may contain the starting function.
314 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
316 to specify and provide a user\dash specified name for the main
317 subroutine of a program.
318 \addtoindex{C} uses the name \doublequote{main} to identify
319 the main subprogram of a program. Some other languages provide
320 similar or other means to identify the main subprogram of
325 The base address of a compilation unit is defined as the
326 value of the \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} attribute, if present; otherwise,
327 it is undefined. If the base address is undefined, then any
328 DWARF entry or structure defined in terms of the base address
329 of that compilation unit is not valid.
332 \subsection{Imported Unit Entries}
333 \label{chap:importedunitentries}
335 \hypertarget{chap:DWATimportimportedunit}
336 place where a normal or partial unit is imported is
337 represented by a debugging information entry with the
338 \addtoindexx{imported unit entry}
339 tag \livetarg{chap:DWTAGimportedunit}{DW\_TAG\_imported\_unit}.
340 An imported unit entry contains
341 \addtoindexx{import attribute}
343 \livelink{chap:DWATimport}{DW\_AT\_import} attribute
344 whose value is a \livelink{chap:classreference}{reference} to the
345 normal or partial compilation unit whose declarations logically
346 belong at the place of the imported unit entry.
348 \textit{An imported unit entry does not necessarily correspond to
349 any entity or construct in the source program. It is merely
350 \doublequote{glue} used to relate a partial unit, or a compilation
351 unit used as a partial unit, to a place in some other
354 \subsection{Separate Type Unit Entries}
355 \label{chap:separatetypeunitentries}
356 An object file may contain any number of separate type
357 unit entries, each representing a single complete type
359 Each \addtoindex{type unit} must be uniquely identified by
360 a 64\dash bit signature, stored as part of the type unit, which
361 can be used to reference the type definition from debugging
362 information entries in other compilation units and type units.
364 A type unit is represented by a debugging information entry
365 with the tag \livetarg{chap:DWTAGtypeunit}{DW\_TAG\_type\_unit}.
366 A \addtoindex{type unit entry} owns debugging
367 information entries that represent the definition of a single
368 type, plus additional debugging information entries that may
369 be necessary to include as part of the definition of the type.
371 A type unit entry may have a
372 \livelink{chap:DWATlanguage}{DW\_AT\_language} attribute,
374 \addtoindexx{language attribute}
375 constant value is an integer code indicating the source
376 language used to define the type. The set of language names
377 and their meanings are given in Table \refersec{tab:languagenames}.
379 A \addtoindex{type unit} entry for a given type T owns a debugging
380 information entry that represents a defining declaration
381 of type T. If the type is nested within enclosing types or
382 namespaces, the debugging information entry for T is nested
383 within debugging information entries describing its containers;
384 otherwise, T is a direct child of the type unit entry.
386 A type unit entry may also own additional debugging information
387 entries that represent declarations of additional types that
388 are referenced by type T and have not themselves been placed in
389 separate type units. Like T, if an additional type U is nested
390 within enclosing types or namespaces, the debugging information
391 entry for U is nested within entries describing its containers;
392 otherwise, U is a direct child of the type unit entry.
394 The containing entries for types T and U are declarations,
395 and the outermost containing entry for any given type T or
396 U is a direct child of the type unit entry. The containing
397 entries may be shared among the additional types and between
398 T and the additional types.
400 \textit{Types are not required to be placed in type units. In general,
401 only large types such as structure, class, enumeration, and
402 union types included from header files should be considered
403 for separate type units. Base types and other small types
404 are not usually worth the overhead of placement in separate
405 type units. Types that are unlikely to be replicated, such
406 as those defined in the main source file, are also better
407 left in the main compilation unit.}
409 \section{Module, Namespace and Importing Entries}
410 \textit{Modules and namespaces provide a means to collect related
411 entities into a single entity and to manage the names of
414 \subsection{Module Entries}
415 \label{chap:moduleentries}
416 \textit{Several languages have the concept of a \doublequote{module.}
417 \addtoindexx{Modula-2}
418 A Modula\dash 2 definition module
419 \addtoindexx{Modula-2!definition module}
420 may be represented by a module
422 \addtoindex{declaration attribute}
423 (\livelink{chap:DWATdeclaration}{DW\_AT\_declaration}). A
424 \addtoindex{Fortran 90} module
425 \addtoindexx{Fortran!module (Fortran 90)}
426 may also be represented by a module entry
427 (but no declaration attribute is warranted because \addtoindex{Fortran}
428 has no concept of a corresponding module body).}
430 A module is represented by a debugging information entry
432 tag \livetarg{chap:DWTAGmodule}{DW\_TAG\_module}.
433 Module entries may own other
434 debugging information entries describing program entities
435 whose declaration scopes end at the end of the module itself.
437 If the module has a name, the module entry has a
438 \livelink{chap:DWATname}{DW\_AT\_name} attribute
439 \addtoindexx{name attribute}
440 whose value is a null\dash terminated string containing
441 the module name as it appears in the source program.
443 The \addtoindex{module entry} may have either a
444 \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} and
445 \livelink{chap:DWAThighpc}{DW\_AT\_high\_pc}
447 \addtoindexx{high PC attribute}
449 \addtoindexx{low PC attribute}
451 \livelink{chap:DWATranges}{DW\_AT\_ranges} attribute
452 \addtoindexx{ranges attribute}
453 whose values encode the contiguous or non\dash contiguous address
454 ranges, respectively, of the machine instructions generated for
455 the module initialization code
456 (see Section \refersec{chap:codeaddressesandranges}).
457 \hypertarget{chap:DWATentrypcentryaddressofmoduleinitialization}
459 \addtoindexx{entry pc attribute!for module initialization}
461 \livelink{chap:DWATentrypc}{DW\_AT\_entry\_pc} attribute whose value is the address of
462 the first executable instruction of that initialization code
463 (see Section \refersec{chap:entryaddress}).
466 \hypertarget{chap:DWATprioritymodulepriority}
467 the module has been assigned a priority, it may have
468 \addtoindexx{priority attribute}
470 \livelink{chap:DWATpriority}{DW\_AT\_priority} attribute.
471 The value of this attribute is a
472 reference to another debugging information entry describing
473 a variable with a constant value. The value of this variable
474 is the actual constant value of the module\textquoteright s priority,
475 represented as it would be on the target architecture.
477 \subsection{Namespace Entries}
478 \label{chap:namespaceentries}
479 \textit{\addtoindex{C++} has the notion of a namespace, which provides a way to
480 \addtoindexx{namespace (C++)}
481 implement name hiding, so that names of unrelated things
482 do not accidentally clash in the
483 \addtoindex{global namespace} when an
484 application is linked together.}
486 A namespace is represented by a debugging information entry
488 tag \livetarg{chap:DWTAGnamespace}{DW\_TAG\_namespace}.
489 A namespace extension is
490 \hypertarget{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}
492 \livelink{chap:DWTAGnamespace}{DW\_TAG\_namespace} entry
494 \addtoindexx{extension attribute}
496 \livelink{chap:DWATextension}{DW\_AT\_extension}
497 attribute referring to the previous extension, or if there
498 is no previous extension, to the original
499 \livelink{chap:DWTAGnamespace}{DW\_TAG\_namespace}
500 entry. A namespace extension entry does not need to duplicate
501 information in a previous extension entry of the namespace
502 nor need it duplicate information in the original namespace
503 entry. (Thus, for a namespace with a name,
504 a \livelink{chap:DWATname}{DW\_AT\_name} attribute
505 \addtoindexx{name attribute}
506 need only be attached directly to the original
507 \livelink{chap:DWTAGnamespace}{DW\_TAG\_namespace} entry.)
510 Namespace and namespace extension entries may own
511 \addtoindexx{namespace extension entry}
513 \addtoindexx{namespace declaration entry}
514 debugging information entries describing program entities
515 whose declarations occur in the namespace.
517 \textit{For \addtoindex{C++}, such
518 owned program entities may be declarations,
519 including certain declarations that are also object or
520 function definitions.}
522 If a type, variable, or function declared in a namespace is
523 defined outside of the body of the namespace declaration,
524 that type, variable, or function definition entry has a
525 \livelink{chap:DWATspecification}{DW\_AT\_specification} attribute
526 \addtoindexx{specification attribute}
527 whose value is a \livelink{chap:classreference}{reference} to the
528 debugging information entry representing the declaration of
529 the type, variable or function. Type, variable, or function
531 \livelink{chap:DWATspecification}{DW\_AT\_specification} attribute
532 \addtoindexx{specification attribute}
534 to duplicate information provided by the declaration entry
535 referenced by the specification attribute.
537 \textit{The \addtoindex{C++} \addtoindex{global namespace}
539 \addtoindexx{global namespace|see{namespace (C++), global}}
541 \addtoindexx{namespace (C++)!global}
543 \texttt{::f}, for example) is not explicitly represented in
544 DWARF with a namespace entry (thus mirroring the situation
545 in \addtoindex{C++} source).
546 Global items may be simply declared with no
547 reference to a namespace.}
549 \textit{The \addtoindex{C++}
550 compilation unit specific \doublequote{unnamed namespace} may
551 \addtoindexx{namespace (C++)!unnamed}
552 \addtoindexx{unnamed namespace|see {namespace (C++), unnamed}}
553 be represented by a namespace entry with no name attribute in
554 the original namespace declaration entry (and therefore no name
555 attribute in any namespace extension entry of this namespace).
558 \textit{A compiler emitting namespace information may choose to
559 explicitly represent namespace extensions, or to represent the
560 final namespace declaration of a compilation unit; this is a
561 quality\dash of\dash implementation issue and no specific requirements
562 are given here. If only the final namespace is represented,
563 \addtoindexx{namespace (C++)!using declaration}
564 it is impossible for a debugger to interpret using declaration
565 references in exactly the manner defined by the
566 \addtoindex{C++} language.
569 \textit{Emitting all namespace declaration information in all
570 compilation units can result in a significant increase in the
571 size of the debug information and significant duplication of
572 information across compilation units.
573 The \addtoindex{C++} namespace std,
575 \addtoindexx{namespace (C++)!std}
576 is large and will probably be referenced in
577 every \addtoindex{C++} compilation unit.
580 \textit{For a \addtoindex{C++} namespace example,
581 see Appendix \refersec{app:namespaceexample}.
586 \subsection{Imported (or Renamed) Declaration Entries}
587 \label{chap:importedorrenameddeclarationentries}
588 \textit{Some languages support the concept of importing into or making
589 accessible in a given unit declarations made in a different
590 module or scope. An imported declaration may sometimes be
595 imported declaration is represented by one or
596 \addtoindexx{imported declaration entry}
597 more debugging information entries with the
598 tag \livetarg{chap:DWTAGimporteddeclaration}{DW\_TAG\_imported\_declaration}.
600 \hypertarget{chap:DWATimportimporteddeclaration}
602 is imported, there is one imported declaration entry for
604 \addtoindexx{import attribute}
605 Each imported declaration entry has a
606 \livelink{chap:DWATimport}{DW\_AT\_import} attribute,
607 whose value is a \livelink{chap:classreference}{reference} to the
608 debugging information entry representing the declaration that
611 An imported declaration may also have a
612 \livelink{chap:DWATname}{DW\_AT\_name}
614 \addtoindexx{name attribute}
615 whose value is a null\dash terminated string containing the
616 name, as it appears in the source program, by which the
617 imported entity is to be known in the context of the imported
618 declaration entry (which may be different than the name of
619 the entity being imported). If no name is present, then the
620 name by which the entity is to be known is the same as the
621 name of the entity being imported.
623 An imported declaration entry with a name attribute may be
624 used as a general means to rename or provide an alias for
625 \addtoindexx{alias declaration|see{imported declaration entry}}
626 an entity, regardless of the context in which the importing
627 declaration or the imported entity occurs.
629 \textit{A \addtoindex{C++} namespace alias may be represented by an imported
630 \hypertarget{chap:DWATimportnamespacealias}
632 \addtoindexx{namespace (C++)!alias}
633 with a name attribute whose value is
634 a null\dash terminated string containing the alias name as it
635 appears in the source program and an import attribute whose
636 value is a \livelink{chap:classreference}{reference} to the applicable original namespace or
637 namespace extension entry.
640 \textit{A \addtoindex{C++} using declaration may be represented by one or more
641 \hypertarget{chap:DWATimportnamespaceusingdeclaration}
643 \addtoindexx{namespace (C++)!using declaration}
644 declaration entries. When the using declaration
645 refers to an overloaded function, there is one imported
646 declaration entry corresponding to each overloading. Each
647 imported declaration entry has no name attribute but it does
648 have an import attribute that refers to the entry for the
649 entity being imported. (\addtoindex{C++}
650 provides no means to \doublequote{rename}
651 an imported entity, other than a namespace).
654 \textit{A \addtoindex{Fortran} use statement
655 \addtoindexx{Fortran!use statement}
656 \addtoindexx{use statement|see {Fortran, use statement}}
657 with an \doublequote{only list} may be
658 represented by a series of imported declaration entries,
659 one (or more) for each entity that is imported. An entity
660 \addtoindexx{renamed declaration|see{imported declaration entry}}
661 that is renamed in the importing context may be represented
662 by an imported declaration entry with a name attribute that
663 specifies the new local name.
666 \subsection{Imported Module Entries}
667 \label{chap:importedmoduleentries}
669 \textit{Some languages support the concept of importing into or making
670 accessible in a given unit all of the declarations contained
671 within a separate module or namespace.
674 An imported module declaration is represented by a debugging
675 information entry with
676 \addtoindexx{imported module attribute}
678 \addtoindexx{imported module entry}
679 tag \livetarg{chap:DWTAGimportedmodule}{DW\_TAG\_imported\_module}.
681 imported module entry contains a
682 \livelink{chap:DWATimport}{DW\_AT\_import} attribute
683 \addtoindexx{import attribute}
684 whose value is a \livelink{chap:classreference}{reference}
685 to the module or namespace entry
686 containing the definition and/or declaration entries for
687 the entities that are to be imported into the context of the
688 imported module entry.
690 An imported module declaration may own a set of imported
691 declaration entries, each of which refers to an entry in the
692 module whose corresponding entity is to be known in the context
693 of the imported module declaration by a name other than its
694 name in that module. Any entity in the module that is not
695 renamed in this way is known in the context of the imported
696 module entry by the same name as it is declared in the module.
698 \textit{A \addtoindex{C++} using directive
699 \addtoindexx{namespace (C++)!using directive}
700 \addtoindexx{using directive|see {namespace (C++), using directive}}
701 may be represented by an imported module
702 \hypertarget{chap:DWATimportnamespaceusingdirective}
703 entry, with an import attribute referring to the namespace
704 entry of the appropriate extension of the namespace (which
705 might be the original namespace entry) and no owned entries.
708 \textit{A \addtoindex{Fortran} use statement
709 \addtoindexx{Fortran!use statement}
710 with a \doublequote{rename list} may be
711 represented by an imported module entry with an import
712 attribute referring to the module and owned entries
713 corresponding to those entities that are renamed as part of
717 \textit{A \addtoindex{Fortran} use statement
718 \addtoindexx{Fortran!use statement}
719 with neither a \doublequote{rename list} nor
720 an \doublequote{only list} may be represented by an imported module
721 entry with an import attribute referring to the module and
722 no owned child entries.
725 \textit{A use statement with an \doublequote{only list} is represented by a
726 series of individual imported declaration entries as described
727 in Section \refersec{chap:importedorrenameddeclarationentries}.
730 \textit{A \addtoindex{Fortran} use statement for an entity in a module that is
731 \addtoindexx{Fortran!use statement}
732 itself imported by a use statement without an explicit mention
733 may be represented by an imported declaration entry that refers
734 to the original debugging information entry. For example, given
751 \textit{the imported declaration entry for Q within module C refers
752 directly to the variable declaration entry for X in module A
753 because there is no explicit representation for X in module B.
756 \textit{A similar situation arises for a \addtoindex{C++} using declaration
757 \addtoindexx{namespace (C++)!using declaration}
758 \addtoindexx{using declaration|see {namespace (C++), using declaration}}
759 that imports an entity in terms of a namespace alias. See
760 Appendix \refersec{app:namespaceexample}
764 \section{Subroutine and Entry Point Entries}
765 \label{chap:subroutineandentrypointentries}
767 The following tags exist to describe
768 debugging information entries
769 \addtoindexx{function entry|see{subroutine entry}}
771 \addtoindexx{subroutine entry}
773 \addtoindexx{subprogram entry}
775 % FIXME: is entry point entry the right index 'entry'?
776 \addtoindexx{entry point entry}
779 \begin{tabular}{lp{9.0cm}}
780 \livetarg{chap:DWTAGsubprogram}{DW\_TAG\_subprogram} & A subroutine or function \\
781 \livelink{chap:DWTAGinlinedsubroutine}{DW\_TAG\_inlined\_subroutine} & A particular inlined
782 \addtoindexx{inlined subprogram entry}
783 instance of a subroutine or function \\
784 \livetarg{chap:DWTAGentrypoint}{DW\_TAG\_entry\_point} & An alternate entry point \\
787 \subsection{General Subroutine and Entry Point Information}
788 \label{chap:generalsubroutineandentrypointinformation}
789 The subroutine or entry point entry has a \livelink{chap:DWATname}{DW\_AT\_name}
790 attribute whose value is a null-terminated string containing the
791 subroutine or entry point name as it appears in the source program.
792 It may also have a \livelink{chap:DWATlinkagename}{DW\_AT\_linkage\_name} attribute as
793 described in Section \refersec{chap:linkagenames}.
795 If the name of the subroutine described by an entry with the
796 \addtoindexx{subprogram entry}
797 tag \livelink{chap:DWTAGsubprogram}{DW\_TAG\_subprogram}
798 is visible outside of its containing
799 \hypertarget{chap:DWATexternalexternalsubroutine}
800 compilation unit, that entry has
801 \addtoindexx{external attribute}
803 \livelink{chap:DWATexternal}{DW\_AT\_external} attribute,
804 which is a \livelink{chap:classflag}{flag}.
806 \textit{Additional attributes for functions that are members of a
807 class or structure are described in
808 Section \refersec{chap:memberfunctionentries}.
812 \hypertarget{chap:DWATmainsubprogrammainorstartingsubprogram}
815 \livelink{chap:DWATmainsubprogram}{DW\_AT\_main\_subprogram}
817 \addtoindexx{main subprogram attribute}
819 a \livelink{chap:classflag}{flag} whose presence indicates that the
820 subroutine has been identified as the starting function of
821 the program. If more than one subprogram contains this
823 any one of them may be the starting subroutine of the program.
825 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
826 which is used to specify
827 and provide a user\dash supplied name for the main subroutine of
831 \textit{A common debugger feature is to allow the debugger user to call
832 a subroutine within the subject program. In certain cases,
833 however, the generated code for a subroutine will not obey
834 the standard calling conventions for the target architecture
835 and will therefore not be safe to call from within a debugger.
838 A subroutine entry may
839 \hypertarget{chap:DWATcallingconventionsubprogramcallingconvention}
841 \livelink{chap:DWATcallingconvention}{DW\_AT\_calling\_convention}
842 attribute, whose value is an
843 \livelink{chap:classconstant}{integer constant}. The set of
844 calling convention codes is given in
845 Table \refersec{tab:callingconventioncodes}.
847 \begin{simplenametable}[1.4in]{Calling convention codes}{tab:callingconventioncodes}
848 \addtoindex{DW\_CC\_normal} \\
849 \addtoindex{DW\_CC\_program} \\
850 \addtoindex{DW\_CC\_nocall} \\
851 \end{simplenametable}
853 If this attribute is not present, or its value is the constant
854 \livetarg{chap:DWCCnormal}{DW\_CC\_normal}, then the subroutine may be safely called by
855 obeying the \doublequote{standard} calling conventions of the target
856 architecture. If the value of the calling convention attribute
857 is the constant \livetarg{chap:DWCCnocall}{DW\_CC\_nocall}, the subroutine does not obey
858 standard calling conventions, and it may not be safe for the
859 debugger to call this subroutine.
861 If the semantics of the language of the compilation unit
862 containing the subroutine entry distinguishes between ordinary
863 subroutines and subroutines that can serve as the \doublequote{main
864 program,} that is, subroutines that cannot be called
865 directly according to the ordinary calling conventions,
866 then the debugging information entry for such a subroutine
867 may have a calling convention attribute whose value is the
868 constant \livetarg{chap:DWCCprogram}{DW\_CC\_program}.
870 \textit{The \livelink{chap:DWCCprogram}{DW\_CC\_program}
871 value is intended to support \addtoindex{Fortran} main
872 \addtoindexx{Fortran!main program}
873 programs which in some implementations may not be callable
874 or which must be invoked in a special way. It is not intended
875 as a way of finding the entry address for the program.
878 \textit{In \addtoindex{C}
879 there is a difference between the types of functions
880 declared using function prototype style declarations and
881 those declared using non\dash prototype declarations.
884 A subroutine entry declared with a function prototype style
886 \addtoindexx{prototyped attribute}
888 \livelink{chap:DWATprototyped}{DW\_AT\_prototyped} attribute, which is
889 a \livelink{chap:classflag}{flag}.
891 \textit{The \addtoindex{Fortran}
892 language allows the keywords \texttt{elemental}, \texttt{pure}
893 and \texttt{recursive} to be included as part of the declaration of
894 a subroutine; these attributes reflect that usage. These
895 attributes are not relevant for languages that do not support
896 similar keywords or syntax. In particular, the \livelink{chap:DWATrecursive}{DW\_AT\_recursive}
897 attribute is neither needed nor appropriate in languages such
899 where functions support recursion by default.
903 \hypertarget{chap:DWATelementalelementalpropertyofasubroutine}
905 \addtoindexx{elemental attribute}
907 \livelink{chap:DWATelemental}{DW\_AT\_elemental} attribute, which
908 is a \livelink{chap:classflag}{flag}.
909 The attribute indicates whether the subroutine
910 or entry point was declared with the \doublequote{elemental} keyword
914 \hypertarget{chap:DWATpurepurepropertyofasubroutine}
915 subprogram entry may have
916 \addtoindexx{pure attribute}
918 \livelink{chap:DWATpure}{DW\_AT\_pure} attribute, which is
919 a \livelink{chap:classflag}{flag}.
920 The attribute indicates whether the subroutine was
921 declared with the \doublequote{pure} keyword or property.
924 \hypertarget{chap:DWATrecursiverecursivepropertyofasubroutine}
925 subprogram entry may have a
926 \livelink{chap:DWATrecursive}{DW\_AT\_recursive} attribute, which
927 is a \livelink{chap:classflag}{flag}.
928 The attribute indicates whether the subroutine
929 or entry point was declared with the \doublequote{recursive} keyword
934 \subsection{Subroutine and Entry Point Return Types}
935 \label{chap:subroutineandentrypointreturntypes}
938 \hypertarget{chap:DWATtypetypeofsubroutinereturn}
939 the subroutine or entry point
940 \addtoindexx{return type of subroutine}
941 is a function that returns a
942 value, then its debugging information entry has
943 \addtoindexx{type attribute}
944 a \livelink{chap:DWATtype}{DW\_AT\_type} attribute
945 to denote the type returned by that function.
947 \textit{Debugging information entries for
948 \addtoindex{C} void functions should
949 not have an attribute for the return type. }
952 \subsection{Subroutine and Entry Point Locations}
953 \label{chap:subroutineandentrypointlocations}
955 A subroutine entry may have either a \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} and
956 \livelink{chap:DWAThighpc}{DW\_AT\_high\_pc} pair of attributes or a \livelink{chap:DWATranges}{DW\_AT\_ranges} attribute
957 \addtoindexx{ranges attribute}
959 \addtoindexx{high PC attribute}
961 \addtoindexx{low PC attribute}
962 encode the contiguous or non\dash contiguous address
963 ranges, respectively, of the machine instructions generated
964 for the subroutine (see
965 Section \refersec{chap:codeaddressesandranges}).
968 \hypertarget{chap:DWATentrypcentryaddressofsubprogram}
969 subroutine entry may also have
970 \addtoindexx{entry pc attribute!for subroutine}
972 \livelink{chap:DWATentrypc}{DW\_AT\_entry\_pc} attribute
973 whose value is the address of the first executable instruction
974 of the subroutine (see
975 Section \refersec{chap:entryaddress}).
977 An entry point has a \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} attribute whose value is the
978 relocated address of the first machine instruction generated
982 \livelink{chap:DWATentrypc}{DW\_AT\_entry\_pc} attribute
983 \addtoindexx{entry pc attribute!for subroutine}
985 also seem appropriate
986 for this purpose, historically the
987 \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} attribute
989 \livelink{chap:DWATentrypc}{DW\_AT\_entry\_pc} was introduced (in
990 \addtoindex{DWARF Version 3}).
991 There is insufficient reason to change this.}
997 \addtoindexx{address class!attribute}
999 \hypertarget{chap:DWATaddressclasssubroutineorsubroutinetype}
1001 \livelink{chap:DWATsegment}{DW\_AT\_segment}
1003 \livelink{chap:DWATaddressclass}{DW\_AT\_address\_class} attributes,
1004 as appropriate, to specify
1005 which segments the code for the subroutine resides in and
1006 the addressing mode to be used in calling that subroutine.
1008 A subroutine entry representing a subroutine declaration
1009 that is not also a definition does not have code address or
1013 \subsection{Declarations Owned by Subroutines and Entry Points}
1014 \label{chap:declarationsownedbysubroutinesandentrypoints}
1016 The declarations enclosed by a subroutine or entry point are
1017 represented by debugging information entries that are owned
1018 by the subroutine or entry point entry. Entries representing
1019 \addtoindexx{formal parameter}
1020 the formal parameters of the subroutine or entry point appear
1021 in the same order as the corresponding declarations in the
1025 \textit{There is no ordering requirement for entries for declarations
1026 that are children of subroutine or entry point entries but
1027 that do not represent formal parameters. The formal parameter
1028 entries may be interspersed with other entries used by formal
1029 parameter entries, such as type entries.}
1031 The unspecified parameters of a variable parameter list are
1032 represented by a debugging information entry\addtoindexx{unspecified parameters entry}
1034 \livetarg{chap:DWTAGunspecifiedparameters}{DW\_TAG\_unspecified\_parameters}.
1036 The entry for a subroutine that includes a
1037 \addtoindex{Fortran}
1038 \addtoindexx{Fortran!common block}
1039 \livelink{chap:fortrancommonblock}{common}
1040 \livelink{chap:commonblockentry}{block}
1041 \addtoindexx{common block|see{Fortran common block}}
1042 has a child entry with the
1043 tag \livetarg{chap:DWTAGcommoninclusion}{DW\_TAG\_common\_inclusion}.
1045 \hypertarget{chap:commonreferencecommonblockusage}
1046 common inclusion entry has a
1047 \livelink{chap:DWATcommonreference}{DW\_AT\_common\_reference} attribute
1048 whose value is a \livelink{chap:classreference}{reference}
1049 to the debugging information entry
1050 for the common \nolink{block} being included
1051 (see Section \refersec{chap:commonblockentries}).
1053 \subsection{Low-Level Information}
1054 \label{chap:lowlevelinformation}
1057 \hypertarget{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}
1058 subroutine or entry point entry may have
1059 \addtoindexx{return address attribute}
1061 \livelink{chap:DWATreturnaddr}{DW\_AT\_return\_addr}
1062 attribute, whose value is a location description. The location
1063 calculated is the place where the return address for the
1064 subroutine or entry point is stored.
1067 \hypertarget{chap:DWATframebasesubroutineframebaseaddress}
1068 subroutine or entry point entry may also have
1069 \addtoindexx{frame base attribute}
1071 \livelink{chap:DWATframebase}{DW\_AT\_frame\_base} attribute, whose value is a location
1072 description that computes the \doublequote{frame base} for the
1073 subroutine or entry point. If the location description is
1074 a simple register location description, the given register
1075 contains the frame base address. If the location description is
1076 a DWARF expression, the result of evaluating that expression
1077 is the frame base address. Finally, for a
1078 \addtoindex{location list},
1079 this interpretation applies to each location description
1080 contained in the list of \addtoindex{location list} entries.
1082 \textit{The use of one of the \livelink{chap:DWOPreg}{DW\_OP\_reg}~\textless~n~\textgreater
1084 context is equivalent to using
1085 \livelink{chap:DWOPbreg}{DW\_OP\_breg}~\textless~n~\textgreater(0)
1087 compact. However, these are not equivalent in general.}
1090 \textit{The frame base for a procedure is typically an address fixed
1091 relative to the first unit of storage allocated for the
1092 procedure\textquoteright s stack frame. The \livelink{chap:DWATframebase}{DW\_AT\_frame\_base} attribute
1093 can be used in several ways:}
1094 \begin{enumerate}[1. ]
1095 \item \textit{In procedures that need
1096 \addtoindexx{location list}
1097 location lists to locate local
1098 variables, the \livelink{chap:DWATframebase}{DW\_AT\_frame\_base} can hold the needed location
1099 list, while all variables\textquoteright\ location descriptions can be
1100 simpler ones involving the frame base.}
1102 \item \textit{It can be used in resolving \doublequote{up\dash level} addressing
1103 within nested routines.
1104 (See also \livelink{chap:DWATstaticlink}{DW\_AT\_static\_link}, below)}
1105 %The -See also- here is ok, the DW\_AT should be
1106 %a hyperref to the def itself, which is earlier in this document.
1110 \textit{Some languages support nested subroutines. In such languages,
1111 it is possible to reference the local variables of an
1112 outer subroutine from within an inner subroutine. The
1113 \livelink{chap:DWATstaticlink}{DW\_AT\_static\_link} and \livelink{chap:DWATframebase}{DW\_AT\_frame\_base} attributes allow
1114 debuggers to support this same kind of referencing.}
1117 \hypertarget{chap:DWATstaticlinklocationofuplevelframe}
1119 \addtoindexx{address!uplevel|see {static link attribute}}
1120 \addtoindexx{uplevel address|see {static link attribute}}
1121 subroutine or entry point is nested, it may have a
1122 \livelink{chap:DWATstaticlink}{DW\_AT\_static\_link}
1123 attribute, whose value is a location
1124 description that computes the frame base of the relevant
1125 instance of the subroutine that immediately encloses the
1126 subroutine or entry point.
1128 In the context of supporting nested subroutines, the
1129 \livelink{chap:DWATframebase}{DW\_AT\_frame\_base} attribute value should obey the following
1132 \begin{enumerate}[1. ]
1133 \item It should compute a value that does not change during the
1134 life of the procedure, and
1136 \item The computed value should be unique among instances of
1137 the same subroutine. (For typical \livelink{chap:DWATframebase}{DW\_AT\_frame\_base} use, this
1138 means that a recursive subroutine\textquoteright s stack frame must have
1139 non\dash zero size.)
1142 \textit{If a debugger is attempting to resolve an up\dash level reference
1143 to a variable, it uses the nesting structure of DWARF to
1144 determine which subroutine is the lexical parent and the
1145 \livelink{chap:DWATstaticlink}{DW\_AT\_static\_link} value to identify the appropriate active
1146 frame of the parent. It can then attempt to find the reference
1147 within the context of the parent.}
1151 \subsection{Types Thrown by Exceptions}
1152 \label{chap:typesthrownbyexceptions}
1154 \textit{In \addtoindex{C++} a subroutine may declare a set of types which
1155 it may validly throw.}
1157 If a subroutine explicitly declares that it may throw
1158 \addtoindexx{exception thrown|see{thrown type entry}}
1160 \addtoindexx{thrown exception|see{thrown type entry}}
1161 exception of one or more types, each such type is
1162 represented by a debugging information entry with
1163 \addtoindexx{thrown type entry}
1165 \livetarg{chap:DWTAGthrowntype}{DW\_TAG\_thrown\_type}.
1166 Each such entry is a child of the entry
1167 representing the subroutine that may throw this type. Each
1168 thrown type entry contains
1169 \addtoindexx{type attribute}
1170 a \livelink{chap:DWATtype}{DW\_AT\_type} attribute, whose
1171 value is a \livelink{chap:classreference}{reference}
1172 to an entry describing the type of the
1173 exception that may be thrown.
1175 \subsection{Function Template Instantiations}
1176 \label{chap:functiontemplateinstantiations}
1178 \textit{In \addtoindex{C++}, a function template is a generic definition of
1179 a function that is instantiated differently for calls with
1180 values of different types. DWARF does not represent the generic
1181 template definition, but does represent each instantiation.}
1183 A \addtoindex{template instantiation} is represented by a debugging
1184 information entry with the
1185 \addtoindexx{subprogram entry!use for template instantiation}
1186 tag \livelink{chap:DWTAGsubprogram}{DW\_TAG\_subprogram}.
1188 exceptions, such an entry will contain the same attributes and
1189 will have the same types of child entries as would an entry
1190 for a subroutine defined explicitly using the instantiation
1191 types. The exceptions are:
1193 \begin{enumerate}[1. ]
1194 \item Each formal parameterized type declaration appearing in the
1195 template definition is represented by a debugging information
1197 \addtoindexx{template type parameter entry}
1198 tag \livetarg{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter}.
1200 such entry has a \livelink{chap:DWATname}{DW\_AT\_name} attribute,
1201 \addtoindexx{name attribute}
1203 null\dash terminated string containing the name of the formal
1204 type parameter as it appears in the source program. The
1205 \addtoindexx{formal type parameter|see{template type parameter entry}}
1206 template type parameter entry also has
1207 \addtoindexx{type attribute}
1208 a \livelink{chap:DWATtype}{DW\_AT\_type} attribute
1209 describing the actual type by which the formal is replaced
1210 for this instantiation.
1212 \item The subprogram entry and each of its child entries reference
1213 a template type parameter entry in any circumstance where
1214 the template definition referenced a formal parameterized type.
1216 \item If the compiler has generated a special compilation unit
1217 to hold the template instantiation and that compilation unit
1218 has a different name from the compilation unit containing
1219 the template definition, the name attribute for the debugging
1220 information entry representing that compilation unit is empty
1223 \item If the subprogram entry representing the template
1224 instantiation or any of its child entries contain declaration
1225 coordinate attributes, those attributes refer to the source
1226 for the template definition, not to any source generated
1227 artificially by the compiler for this instantiation.
1232 \subsection{Inlinable and Inlined Subroutines}
1233 A declaration or a definition of an inlinable subroutine
1234 is represented by a debugging information entry with the
1236 \livelink{chap:DWTAGsubprogram}{DW\_TAG\_subprogram}.
1238 \addtoindexx{subprogram entry!use in inlined subprogram}
1240 \hypertarget{chap:DWATinlineinlinedsubroutine}
1241 explicitly declared to be available for inline expansion or
1242 that was expanded inline implicitly by the compiler has
1243 \addtoindexx{inline attribute}
1245 \livelink{chap:DWATinline}{DW\_AT\_inline} attribute whose value is an
1246 \livelink{chap:classconstant}{integer constant}. The
1247 set of values for the \livelink{chap:DWATinline}{DW\_AT\_inline} attribute is given in
1248 Table \refersec{tab:inlinecodes}.
1252 \caption{Inline codes}
1253 \label{tab:inlinecodes}
1254 \begin{tabular}{l|p{8cm}}
1256 Name&Meaning\\ \hline
1257 \livetarg{chap:DWINLnotinlined}{DW\_INL\_not\_inlined} & Not declared inline nor inlined by the
1258 \mbox{compiler} (equivalent to the absence of the
1259 containing \livelink{chap:DWATinline}{DW\_AT\_inline} attribute) \\
1260 \livetarg{chap:DWINLinlined}{DW\_INL\_inlined} & Not declared inline but inlined by the \mbox{compiler} \\
1261 \livetarg{chap:DWINLdeclarednotinlined}{DW\_INL\_declared\_not\_inlined} & Declared inline but
1262 not inlined by the \mbox{compiler} \\
1263 \livetarg{chap:DWINLdeclaredinlined}{DW\_INL\_declared\_inlined} & Declared inline and inlined by the
1269 \textit{In \addtoindex{C++}, a function or a constructor declared with
1270 \addttindex{constexpr} is implicitly declared inline. The abstract inline
1271 instance (see below) is represented by a debugging information
1272 entry with the tag \livelink{chap:DWTAGsubprogram}{DW\_TAG\_subprogram}. Such an entry has a
1273 \livelink{chap:DWATinline}{DW\_AT\_inline} attribute whose value is \livelink{chap:DWINLinlined}{DW\_INL\_inlined}.}
1276 \subsubsection{Abstract Instances}
1277 \label{chap:abstractinstances}
1278 Any debugging information entry that is owned (either
1279 \hypertarget{chap:DWATinlineabstracttinstance}
1280 directly or indirectly) by a debugging information entry
1282 \livelink{chap:DWATinline}{DW\_AT\_inline} attribute is referred to
1283 \addtoindexx{abstract instance!entry}
1284 as an \doublequote{abstract instance entry.}
1285 Any subroutine entry
1287 \addtoindexx{inline attribute}
1288 a \livelink{chap:DWATinline}{DW\_AT\_inline} attribute whose value is other
1289 than \livelink{chap:DWINLnotinlined}{DW\_INL\_not\_inlined}
1291 \addtoindexx{abstract instance!root}
1292 an \doublequote{abstract instance root.}
1293 Any set of abstract instance entries that are all
1294 children (either directly or indirectly) of some abstract
1295 instance root, together with the root itself, is known as
1296 \addtoindexx{abstract instance!tree}
1297 an \doublequote{abstract instance tree.} However, in the case where
1298 an abstract instance tree is nested within another abstract
1299 instance tree, the entries in the
1300 \addtoindex{nested abstract instance}
1301 tree are not considered to be entries in the outer abstract
1304 Each abstract instance root is either part of a larger
1305 \addtoindexx{abstract instance!root}
1306 tree (which gives a context for the root) or
1307 \addtoindexx{specification attribute}
1309 \livelink{chap:DWATspecification}{DW\_AT\_specification}
1310 to refer to the declaration in context.
1312 \textit{For example, in \addtoindex{C++} the context might be a namespace
1313 declaration or a class declaration.}
1315 \textit{Abstract instance trees are defined so that no entry is part
1316 of more than one abstract instance tree. This simplifies the
1317 following descriptions.}
1319 A debugging information entry that is a member of an abstract
1320 instance tree should not contain any attributes which describe
1321 aspects of the subroutine which vary between distinct inlined
1322 expansions or distinct out\dash of\dash line expansions. For example,
1323 \addtoindexx{entry pc attribute!and abstract instance}
1324 the \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc},
1325 \livelink{chap:DWAThighpc}{DW\_AT\_high\_pc},
1326 \livelink{chap:DWATranges}{DW\_AT\_ranges},
1327 \livelink{chap:DWATentrypc}{DW\_AT\_entry\_pc},
1328 \livelink{chap:DWATlocation}{DW\_AT\_location},
1329 \livelink{chap:DWATreturnaddr}{DW\_AT\_return\_addr},
1330 \livelink{chap:DWATstartscope}{DW\_AT\_start\_scope},
1332 \livelink{chap:DWATsegment}{DW\_AT\_segment}
1334 \addtoindexx{location attribute!and abstract instance}
1336 \addtoindexx{ranges attribute!and abstract instance}
1338 \addtoindexx{high PC attribute!and abstract instance}
1340 \addtoindexx{low PC attribute!and abstract instance}
1342 \addtoindexx{segment attribute!and abstract instance}
1344 \addtoindexx{return address attribute!and abstract instance}
1346 \addtoindexx{segment attribute!and abstract instance}
1348 \addtoindexx{start scope attribute!and abstract instance}
1352 \textit{It would not make sense normally to put these attributes into
1353 abstract instance entries since such entries do not represent
1354 actual (concrete) instances and thus do not actually exist at
1355 run\dash time. However,
1356 see Appendix \refersec{app:inlineouteronenormalinner}
1357 for a contrary example.}
1359 The rules for the relative location of entries belonging to
1360 abstract instance trees are exactly the same as for other
1361 similar types of entries that are not abstract. Specifically,
1362 the rule that requires that an entry representing a declaration
1363 be a direct child of the entry representing the scope of the
1364 declaration applies equally to both abstract and non\dash abstract
1365 entries. Also, the ordering rules for formal parameter entries,
1366 member entries, and so on, all apply regardless of whether
1367 or not a given entry is abstract.
1369 \subsubsection{Concrete Inlined Instances}
1370 \label{chap:concreteinlinedinstances}
1372 Each inline expansion of a subroutine is represented
1373 by a debugging information entry with the
1374 tag \livetarg{chap:DWTAGinlinedsubroutine}{DW\_TAG\_inlined\_subroutine}.
1375 Each such entry should be a direct
1376 child of the entry that represents the scope within which
1377 the inlining occurs.
1379 Each inlined subroutine entry may have either a
1380 \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc}
1381 and \livelink{chap:DWAThighpc}{DW\_AT\_high\_pc} pair
1383 \addtoindexx{high PC attribute}
1385 \addtoindexx{low PC attribute}
1387 \addtoindexx{ranges attribute}
1389 \livelink{chap:DWATranges}{DW\_AT\_ranges}
1390 attribute whose values encode the contiguous or non\dash contiguous
1391 address ranges, respectively, of the machine instructions
1392 generated for the inlined subroutine (see
1393 Section \refersec{chap:codeaddressesandranges}).
1395 \hypertarget{chap:DWATentrypcentryaddressofinlinedsubprogram}
1396 inlined subroutine entry may
1397 \addtoindexx{inlined subprogram entry!in concrete instance}
1399 \addtoindexx{inlined subprogram entry}
1401 \addtoindexx{entry pc attribute!for inlined subprogram}
1403 \livelink{chap:DWATentrypc}{DW\_AT\_entry\_pc}
1404 attribute, representing the first executable instruction of
1405 the inline expansion (see
1406 Section \refersec{chap:entryaddress}).
1408 % Positions of the 3 targets here is a bit arbitrary.
1410 \hypertarget{chap:DWATcalllinelinenumberofinlinedsubroutinecall}
1412 \hypertarget{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}
1414 \hypertarget{chap:DWATcallfilefilecontaininginlinedsubroutinecall}
1415 may also have \livelink{chap:DWATcallfile}{DW\_AT\_call\_file},
1416 \livelink{chap:DWATcallline}{DW\_AT\_call\_line} and \livelink{chap:DWATcallcolumn}{DW\_AT\_call\_column} attributes,
1418 value is an \livelink{chap:classconstant}{integer constant}.
1419 These attributes represent the
1420 source file, source line number, and source column number,
1421 respectively, of the first character of the statement or
1422 expression that caused the inline expansion. The call file,
1423 call line, and call column attributes are interpreted in
1424 the same way as the declaration file, declaration line, and
1425 declaration column attributes, respectively (see
1426 Section \refersec{chap:declarationcoordinates}).
1428 \textit{The call file, call line and call column coordinates do not
1429 describe the coordinates of the subroutine declaration that
1430 was inlined, rather they describe the coordinates of the call.
1433 An inlined subroutine entry
1434 \hypertarget{chap:DWATconstexprcompiletimeconstantfunction}
1436 \livelink{chap:DWATconstexpr}{DW\_AT\_const\_expr}
1437 attribute, which is a \livelink{chap:classflag}{flag}
1438 whose presence indicates that the
1439 subroutine has been evaluated as a compile\dash time constant. Such
1440 an entry may also have a \livelink{chap:DWATconstvalue}{DW\_AT\_const\_value} attribute,
1441 whose value may be of any form that is appropriate for the
1442 representation of the subroutine's return value. The value of
1443 this attribute is the actual return value of the subroutine,
1444 represented as it would be on the target architecture.
1446 \textit{In \addtoindex{C++}, if a function or a constructor declared with
1447 \addttindex{constexpr}
1448 is called with constant expressions, then the corresponding
1449 concrete inlined instance has a
1450 \livelink{chap:DWATconstexpr}{DW\_AT\_const\_expr} attribute,
1451 as well as a \livelink{chap:DWATconstvalue}{DW\_AT\_const\_value} attribute whose value represents
1452 the actual return value of the concrete inlined instance.}
1454 Any debugging information entry that is owned (either
1455 directly or indirectly) by a debugging information entry
1456 with the tag \livelink{chap:DWTAGinlinedsubroutine}{DW\_TAG\_inlined\_subroutine} is referred to as a
1457 \doublequote{concrete inlined instance entry.} Any entry that has
1459 \livelink{chap:DWTAGinlinedsubroutine}{DW\_TAG\_inlined\_subroutine}
1460 is known as a \doublequote{concrete inlined instance root.}
1461 Any set of concrete inlined instance
1462 entries that are all children (either directly or indirectly)
1463 of some concrete inlined instance root, together with the root
1464 itself, is known as a \doublequote{concrete inlined instance tree.}
1465 However, in the case where a concrete inlined instance tree
1466 is nested within another concrete instance tree, the entries
1467 in the \addtoindex{nested concrete inline instance} tree
1468 are not considered to
1469 be entries in the outer concrete instance tree.
1471 \textit{Concrete inlined instance trees are defined so that no entry
1472 is part of more than one concrete inlined instance tree. This
1473 simplifies later descriptions.}
1475 Each concrete inlined instance tree is uniquely associated
1476 with one (and only one) abstract instance tree.
1478 \textit{Note, however, that the reverse is not true. Any given abstract
1479 instance tree may be associated with several different concrete
1480 inlined instance trees, or may even be associated with zero
1481 concrete inlined instance trees.}
1483 Concrete inlined instance entries may omit attributes that
1484 are not specific to the concrete instance (but present in
1485 the abstract instance) and need include only attributes that
1486 are specific to the concrete instance (but omitted in the
1487 abstract instance). In place of these omitted attributes, each
1488 \hypertarget{chap:DWATabstractorigininlineinstance}
1489 concrete inlined instance entry
1490 \addtoindexx{abstract origin attribute}
1492 \livelink{chap:DWATabstractorigin}{DW\_AT\_abstract\_origin}
1493 attribute that may be used to obtain the missing information
1494 (indirectly) from the associated abstract instance entry. The
1495 value of the abstract origin attribute is a reference to the
1496 associated abstract instance entry.
1498 If an entry within a concrete inlined instance tree contains
1499 attributes describing the
1500 \addtoindexx{declaration coordinates!in concrete instance}
1501 \livelink{chap:declarationcoordinates}{declaration coordinates}
1502 of that entry, then those attributes should refer to the file, line
1503 and column of the original declaration of the subroutine,
1504 not to the point at which it was inlined. As a consequence,
1505 they may usually be omitted from any entry that has an abstract
1509 For each pair of entries that are associated via a
1510 \addtoindexx{abstract origin attribute}
1511 \livelink{chap:DWATabstractorigin}{DW\_AT\_abstract\_origin} attribute, both members of the pair
1512 have the same tag. So, for example, an entry with the tag
1513 \livelink{chap:DWTAGvariable}{DW\_TAG\_variable} can only be associated with another entry
1514 that also has the tag \livelink{chap:DWTAGvariable}{DW\_TAG\_variable}. The only exception
1515 to this rule is that the root of a concrete instance tree
1516 (which must always have the tag \livelink{chap:DWTAGinlinedsubroutine}{DW\_TAG\_inlined\_subroutine})
1517 can only be associated with the root of its associated abstract
1518 instance tree (which must have the tag \livelink{chap:DWTAGsubprogram}{DW\_TAG\_subprogram}).
1520 In general, the structure and content of any given concrete
1521 inlined instance tree will be closely analogous to the
1522 structure and content of its associated abstract instance
1523 tree. There are a few exceptions:
1525 \begin{enumerate}[1. ]
1526 \item An entry in the concrete instance tree may be omitted if
1528 \addtoindexx{abstract origin attribute}
1529 \livelink{chap:DWATabstractorigin}{DW\_AT\_abstract\_origin} attribute and either
1530 has no children, or its children are omitted. Such entries
1531 would provide no useful information. In C\dash like languages,
1532 such entries frequently include types, including structure,
1533 union, class, and interface types; and members of types. If any
1534 entry within a concrete inlined instance tree needs to refer
1535 to an entity declared within the scope of the relevant inlined
1536 subroutine and for which no concrete instance entry exists,
1537 the reference should refer to the abstract instance entry.
1539 \item Entries in the concrete instance tree which are associated
1540 with entries in the abstract instance tree such that neither
1541 has a \livelink{chap:DWATname}{DW\_AT\_name} attribute,
1542 \addtoindexx{name attribute}
1543 and neither is referenced by
1544 any other debugging information entry, may be omitted. This
1545 may happen for debugging information entries in the abstract
1546 instance trees that became unnecessary in the concrete instance
1547 tree because of additional information available there. For
1548 example, an anonymous variable might have been created and
1549 described in the abstract instance tree, but because of
1550 the actual parameters for a particular inlined expansion,
1551 it could be described as a constant value without the need
1552 for that separate debugging information entry.
1554 \item A concrete instance tree may contain entries which do
1555 not correspond to entries in the abstract instance tree
1556 to describe new entities that are specific to a particular
1557 inlined expansion. In that case, they will not have associated
1558 entries in the abstract instance tree, should not contain
1559 \addtoindexx{abstract origin attribute}
1560 \livelink{chap:DWATabstractorigin}{DW\_AT\_abstract\_origin} attributes, and must contain all their
1561 own attributes directly. This allows an abstract instance tree
1562 to omit debugging information entries for anonymous entities
1563 that are unlikely to be needed in most inlined expansions. In
1564 any expansion which deviates from that expectation, the
1565 entries can be described in its concrete inlined instance tree.
1569 \subsubsection{Out-of-Line Instances of Inlined Subroutines}
1570 \label{chap:outoflineinstancesofinlinedsubroutines}
1571 Under some conditions, compilers may need to generate concrete
1572 executable instances of inlined subroutines other than at
1573 points where those subroutines are actually called. Such
1574 concrete instances of inlined subroutines are referred to as
1575 \doublequote{concrete out\dash of\dash line instances.}
1577 \textit{In \addtoindex{C++}, for example,
1578 taking the address of a function declared
1579 to be inline can necessitate the generation of a concrete
1580 out\dash of\dash line instance of the given function.}
1582 The DWARF representation of a concrete out\dash of\dash line instance
1583 of an inlined subroutine is essentially the same as for a
1584 concrete inlined instance of that subroutine (as described in
1585 the preceding section). The representation of such a concrete
1586 % It is critical that the hypertarget and livelink be
1587 % separated to avoid problems with latex.
1588 out\dash of\dash line
1589 \addtoindexx{abstract origin attribute}
1591 \hypertarget{chap:DWATabstractoriginoutoflineinstance}
1593 \livelink{chap:DWATabstractorigin}{DW\_AT\_abstract\_origin}
1594 attributes in exactly the same way as they are used for
1595 a concrete inlined instance (that is, as references to
1596 corresponding entries within the associated abstract instance
1599 The differences between the DWARF representation of a
1600 concrete out\dash of\dash line instance of a given subroutine and the
1601 representation of a concrete inlined instance of that same
1602 subroutine are as follows:
1604 \begin{enumerate}[1. ]
1605 \item The root entry for a concrete out\dash of\dash line instance
1606 of a given inlined subroutine has the same tag as does its
1607 associated (abstract) inlined subroutine entry (that is, tag
1608 \livelink{chap:DWTAGsubprogram}{DW\_TAG\_subprogram} rather than \livelink{chap:DWTAGinlinedsubroutine}{DW\_TAG\_inlined\_subroutine}).
1610 \item The root entry for a concrete out\dash of\dash line instance tree
1611 is normally owned by the same parent entry that also owns
1612 the root entry of the associated abstract instance. However,
1613 it is not required that the abstract and out\dash of\dash line instance
1614 trees be owned by the same parent entry.
1618 \subsubsection{Nested Inlined Subroutines}
1619 \label{nestedinlinedsubroutines}
1620 Some languages and compilers may permit the logical nesting of
1621 a subroutine within another subroutine, and may permit either
1622 the outer or the nested subroutine, or both, to be inlined.
1624 For a non\dash inlined subroutine nested within an inlined
1625 subroutine, the nested subroutine is described normally in
1626 both the abstract and concrete inlined instance trees for
1627 the outer subroutine. All rules pertaining to the abstract
1628 and concrete instance trees for the outer subroutine apply
1629 also to the abstract and concrete instance entries for the
1633 For an inlined subroutine nested within another inlined
1634 subroutine, the following rules apply to their abstract and
1635 \addtoindexx{abstract instance!nested}
1636 \addtoindexx{concrete instance!nested}
1637 concrete instance trees:
1639 \begin{enumerate}[1. ]
1640 \item The abstract instance tree for the nested subroutine is
1641 described within the abstract instance tree for the outer
1642 subroutine according to the rules in
1643 Section \refersec{chap:abstractinstances}, and
1644 without regard to the fact that it is within an outer abstract
1647 \item Any abstract instance tree for a nested subroutine is
1648 always omitted within the concrete instance tree for an
1651 \item A concrete instance tree for a nested subroutine is
1652 always omitted within the abstract instance tree for an
1655 \item The concrete instance tree for any inlined or
1656 \addtoindexx{out-of-line instance}
1658 \addtoindexx{out-of-line-instance|see{concrete out-of-line-instance}}
1659 expansion of the nested subroutine is described within a
1660 concrete instance tree for the outer subroutine according
1662 Sections \refersec{chap:concreteinlinedinstances} or
1663 \refersec{chap:outoflineinstancesofinlinedsubroutines}
1665 and without regard to the fact that it is within an outer
1666 concrete instance tree.
1669 See Appendix \refersec{app:inliningexamples}
1670 for discussion and examples.
1672 \subsection{Trampolines}
1673 \label{chap:trampolines}
1675 \textit{A trampoline is a compiler\dash generated subroutine that serves as
1676 \hypertarget{chap:DWATtrampolinetargetsubroutine}
1677 an intermediary in making a call to another subroutine. It may
1678 adjust parameters and/or the result (if any) as appropriate
1679 to the combined calling and called execution contexts.}
1681 A trampoline is represented by a debugging information entry
1682 \addtoindexx{trampoline (subprogam) entry}
1683 with the tag \livelink{chap:DWTAGsubprogram}{DW\_TAG\_subprogram} or \livelink{chap:DWTAGinlinedsubroutine}{DW\_TAG\_inlined\_subroutine}
1685 \addtoindexx{trampoline attribute}
1686 a \livelink{chap:DWATtrampoline}{DW\_AT\_trampoline} attribute.
1688 attribute indicates the target subroutine of the trampoline,
1689 that is, the subroutine to which the trampoline passes
1690 control. (A trampoline entry may but need not also have a
1691 \livelink{chap:DWATartificial}{DW\_AT\_artificial} attribute.)
1694 The value of the trampoline attribute may be represented
1695 using any of the following forms, which are listed in order
1699 \item If the value is of class reference, then the value
1700 specifies the debugging information entry of the target
1703 \item If the value is of class address, then the value is
1704 the relocated address of the target subprogram.
1706 \item If the value is of class string, then the value is the
1707 (possibly mangled) \addtoindexx{mangled names}
1708 name of the target subprogram.
1710 \item If the value is of class \livelink{chap:classflag}{flag}, then the value true
1711 indicates that the containing subroutine is a trampoline but
1712 that the target subroutine is not known.
1716 The target subprogram may itself be a trampoline. (A sequence
1717 of trampolines necessarily ends with a non\dash trampoline
1720 \textit{In \addtoindex{C++}, trampolines may be used
1721 to implement derived virtual
1722 member functions; such trampolines typically adjust the
1723 \addtoindexx{this parameter}
1724 implicit this pointer parameter in the course of passing
1726 Other languages and environments may use trampolines
1727 in a manner sometimes known as transfer functions or transfer
1730 \textit{Trampolines may sometimes pass control to the target
1731 subprogram using a branch or jump instruction instead of a
1732 call instruction, thereby leaving no trace of their existence
1733 in the subsequent execution context. }
1735 \textit{This attribute helps make it feasible for a debugger to arrange
1736 that stepping into a trampoline or setting a breakpoint in
1737 a trampoline will result in stepping into or setting the
1738 breakpoint in the target subroutine instead. This helps to
1739 hide the compiler generated subprogram from the user. }
1741 \textit{If the target subroutine is not known, a debugger may choose
1742 to repeatedly step until control arrives in a new subroutine
1743 which can be assumed to be the target subroutine. }
1747 \section{Lexical Block Entries}
1748 \label{chap:lexicalblockentries}
1751 lexical \livetargi{chap:lexicalblock}{block}{lexical block}
1753 \addtoindexx{lexical block}
1754 a bracketed sequence of source statements
1755 that may contain any number of declarations. In some languages
1756 (including \addtoindex{C} and \addtoindex{C++}),
1757 \nolink{blocks} can be nested within other
1758 \nolink{blocks} to any depth.}
1760 % We do not need to link to the preceding paragraph.
1761 A lexical \nolink{block} is represented by a debugging information
1763 tag \livetarg{chap:DWTAGlexicalblock}{DW\_TAG\_lexical\_block}.
1765 The lexical \livetargi{chap:lexicalblockentry}{block}{lexical block entry}
1767 either a \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} and
1768 \livelink{chap:DWAThighpc}{DW\_AT\_high\_pc} pair of
1770 \addtoindexx{high PC attribute}
1772 \addtoindexx{low PC attribute}
1774 \livelink{chap:DWATranges}{DW\_AT\_ranges} attribute
1775 \addtoindexx{ranges attribute}
1776 whose values encode the contiguous or non-contiguous address
1777 ranges, respectively, of the machine instructions generated
1778 for the lexical \nolink{block}
1779 (see Section \refersec{chap:codeaddressesandranges}).
1781 If a name has been given to the
1782 lexical \nolink{block}
1784 program, then the corresponding
1785 lexical \nolink{block} entry has a
1786 \livelink{chap:DWATname}{DW\_AT\_name} attribute whose
1787 \addtoindexx{name attribute}
1788 value is a null\dash terminated string
1789 containing the name of the lexical \nolink{block}
1793 \textit{This is not the same as a \addtoindex{C} or
1794 \addtoindex{C++} label (see below).}
1796 The lexical \nolink{block} entry owns
1797 debugging information entries that
1798 describe the declarations within that lexical \nolink{block}.
1800 one such debugging information entry for each local declaration
1801 of an identifier or inner lexical \nolink{block}.
1803 \section{Label Entries}
1804 \label{chap:labelentries}
1805 \textit{A label is a way of identifying a source statement. A labeled
1806 statement is usually the target of one or more \doublequote{go to}
1810 A label is represented by a debugging information entry with
1811 \addtoindexx{label entry}
1813 tag \livetarg{chap:DWTAGlabel}{DW\_TAG\_label}.
1814 The entry for a label should be owned by
1815 the debugging information entry representing the scope within
1816 which the name of the label could be legally referenced within
1819 The label entry has a \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} attribute whose value
1820 is the relocated address of the first machine instruction
1821 generated for the statement identified by the label in
1822 the source program. The label entry also has a
1823 \livelink{chap:DWATname}{DW\_AT\_name} attribute
1824 \addtoindexx{name attribute}
1825 whose value is a null-terminated string containing
1826 the name of the label as it appears in the source program.
1829 \section{With Statement Entries}
1830 \label{chap:withstatemententries}
1832 \textit{Both \addtoindex{Pascal} and
1833 \addtoindexx{Modula-2}
1834 Modula\dash 2 support the concept of a \doublequote{with}
1835 statement. The with statement specifies a sequence of
1836 executable statements within which the fields of a record
1837 variable may be referenced, unqualified by the name of the
1840 A with statement is represented by a
1841 \addtoindexi{debugging information entry}{with statement entry}
1842 with the tag \livetarg{chap:DWTAGwithstmt}{DW\_TAG\_with\_stmt}.
1844 A with statement entry may have either a
1845 \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} and
1846 \livelink{chap:DWAThighpc}{DW\_AT\_high\_pc} pair of attributes
1847 \addtoindexx{high PC attribute}
1849 \addtoindexx{low PC attribute}
1850 a \livelink{chap:DWATranges}{DW\_AT\_ranges} attribute
1851 \addtoindexx{ranges attribute}
1852 whose values encode the contiguous or non\dash contiguous address
1853 ranges, respectively, of the machine instructions generated
1854 for the with statement
1855 (see Section \refersec{chap:codeaddressesandranges}).
1857 The with statement entry has
1858 \addtoindexx{type attribute}
1859 a \livelink{chap:DWATtype}{DW\_AT\_type} attribute, denoting
1860 the type of record whose fields may be referenced without full
1861 qualification within the body of the statement. It also has
1862 \addtoindexx{location attribute}
1863 a \livelink{chap:DWATlocation}{DW\_AT\_location} attribute, describing how to find the base
1864 address of the record object referenced within the body of
1867 \section{Try and Catch Block Entries}
1868 \label{chap:tryandcatchblockentries}
1870 \textit{In \addtoindex{C++} a lexical \livelink{chap:lexicalblock}{block} may be
1871 designated as a \doublequote{catch \nolink{block}.}
1872 A catch \livetargi{chap:catchblock}{block}{catch block} is an
1873 exception handler that handles
1874 exceptions thrown by an immediately
1875 preceding \doublequote{try \livelink{chap:tryblock}{block}.}
1876 A catch \livelink{chap:catchblock}{block}
1877 designates the type of the exception that it
1880 A try \livetargi{chap:tryblock}{block}{try block} is represented
1881 by a debugging information entry
1882 \addtoindexx{try block entry}
1883 with the tag \livetarg{chap:DWTAGtryblock}{DW\_TAG\_try\_block}.
1884 A catch \livelink{chap:catchblock}{block} is represented by
1885 a debugging information entry with
1886 \addtoindexx{catch block entry}
1887 the tag \livetarg{chap:DWTAGcatchblock}{DW\_TAG\_catch\_block}.
1889 % nolink as we have links just above and do not have a combo link for both
1890 Both try and catch \nolink{block} entries may have either a
1891 \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc} and
1892 \livelink{chap:DWAThighpc}{DW\_AT\_high\_pc} pair of attributes
1893 \addtoindexx{high PC attribute}
1895 \addtoindexx{low PC attribute}
1897 \livelink{chap:DWATranges}{DW\_AT\_ranges} attribute
1898 \addtoindexx{ranges attribute}
1899 whose values encode the contiguous
1900 or non\dash contiguous address ranges, respectively, of the
1901 machine instructions generated for the \livelink{chap:lexicalblock}{block}
1903 \refersec{chap:codeaddressesandranges}).
1905 Catch \livelink{chap:catchblock}{block} entries have at
1906 least one child entry, an
1907 entry representing the type of exception accepted by
1908 that catch \livelink{chap:catchblock}{block}.
1909 This child entry has one of
1910 \addtoindexx{formal parameter entry!in catch block}
1912 \addtoindexx{unspecified parameters entry!in catch block}
1914 \livelink{chap:DWTAGformalparameter}{DW\_TAG\_formal\_parameter} or
1915 \livelink{chap:DWTAGunspecifiedparameters}{DW\_TAG\_unspecified\_parameters},
1916 and will have the same form as other parameter entries.
1918 The siblings immediately following
1919 a try \livelink{chap:tryblock}{block} entry are its
1920 corresponding catch \livelink{chap:catchblock}{block} entries.