1 \chapter{Program Scope Entries}
2 \label{chap:programscopeentries}
3 This section describes debugging information entries that
4 relate to different levels of program scope: compilation,
5 module, subprogram, and so on. Except for separate type
6 entries (see Section \refersec{chap:separatetypeunitentries}),
7 these entries may be thought of
8 as bounded by ranges of text addresses within the program.
10 \section{Unit Entries}
11 An object file may contain one or more compilation units,
13 \addtoindexx{unit|see {compilation unit, partial unit \textit{or} type unit}}
14 \addtoindexx{compilation unit}
16 \addtoindexx{normal compilation unit}
17 \addtoindexx{normal compilation unit|see {compilation unit}}
18 normal compilation units,
19 partial compilation units and
20 \addtoindexx{type unit}
22 \addtoindex{partial compilation unit}
23 is related to one or more other compilation units that
25 \addtoindex{type unit} represents
26 a single complete type in a
27 separate unit. Either a normal compilation unit or a
28 \addtoindex{partial compilation unit}
29 may be logically incorporated into another
30 compilation unit using an
31 \addtoindex{imported unit entry}.
33 \subsection[Normal and Partial CU Entries]{Normal and Partial Compilation Unit Entries}
34 \label{chap:normalandpartialcompilationunitentries}
36 A \addtoindex{normal compilation unit} is represented by a debugging
37 information entry with the
38 tag \livetarg{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit}.
39 A \addtoindex{partial compilation unit} is represented by a debugging information
41 tag \livetarg{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit}.
43 In a simple normal compilation, a single compilation unit with
45 \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit} represents a complete object file
47 \livelink{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit} is not used.
49 employing the DWARF space compression and duplicate elimination
51 Appendix \refersec{app:usingcompilationunits},
52 multiple compilation units using
54 \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit} and/or
55 \livelink{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit} are
56 used to represent portions of an object file.
58 \textit{A normal compilation unit typically represents the text and
59 data contributed to an executable by a single relocatable
60 object file. It may be derived from several source files,
61 including pre\dash processed ``include files.''
62 A \addtoindex{partial compilation unit} typically represents a part of the text
63 and data of a relocatable object file, in a manner that can
64 potentially be shared with the results of other compilations
65 to save space. It may be derived from an ``include file'',
66 template instantiation, or other implementation\dash dependent
67 portion of a compilation. A normal compilation unit can also
68 function in a manner similar to a partial compilation unit
71 A compilation unit entry owns debugging information
72 entries that represent all or part of the declarations
73 made in the corresponding compilation. In the case of a
74 partial compilation unit, the containing scope of its owned
75 declarations is indicated by imported unit entries in one
76 or more other compilation unit entries that refer to that
77 partial compilation unit (see
78 Section \refersec{chap:importedunitentries}).
81 Compilation unit entries may have the following
85 \item Either a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
86 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of
87 \addtoindexx{high PC attribute}
89 \addtoindexx{low PC attribute}
91 \addtoindexx{ranges attribute}
93 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
94 \addtoindexx{ranges attribute}
96 \addtoindexx{discontiguous address ranges|see{non-contiguous address ranges}}
99 non\dash contiguous address ranges, respectively,
100 of the machine instructions generated for the compilation
101 unit (see Section {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
134 Figure \refersec{fig:languagenames}.
138 \caption{Language names}
139 \label{fig: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 \ \ Support for these languages is limited.& \\
166 \item A \livelink{chap:DWATstmtlist}{DW\-\_AT\-\_stmt\-\_list} attribute whose value is
167 \addtoindexx{statement list attribute}
169 \addtoindexx{section offset!in statement list attribute}
171 \hypertarget{chap:DWATstmtlistlinenumberinformationforunit}
173 to the line number information for this compilation
174 unit. This information is placed in a separate object file
175 section from the debugging information entries themselves. The
176 value of the statement list attribute is the offset in the
177 \addtoindex{.debug\_line} section of the first byte of the line number
178 information for this compilation unit
179 (see Section \refersec{chap:linenumberinformation}).
181 \item A \livelink{chap:DWATmacroinfo}{DW\-\_AT\-\_macro\-\_info} attribute
182 \addtoindex{macro information attribute}
184 \addtoindexx{section offset!in macro information attribute}
186 \hypertarget{chap:DWATmacroinfomacroinformation}
187 offset to the macro information for this compilation unit.
188 This information is placed in a separate object file section
189 from the debugging information entries themselves. The
190 value of the macro information attribute is the offset in
191 the \addtoindex{.debug\_macinfo} section of the first byte of the macro
192 information for this compilation unit
193 (see Section \refersec{chap:macroinformation}).
196 \livelink{chap:DWATcompdir}{DW\-\_AT\-\_comp\-\_dir}
198 \hypertarget{chap:DWATcompdircompilationdirectory}
200 null\dash terminated string containing the current working directory
201 of the compilation command that produced this compilation
202 unit in whatever form makes sense for the host system.
204 \item A \livelink{chap:DWATproducer}{DW\-\_AT\-\_producer} attribute
205 \addtoindexx{producer attribute}
206 whose value is a null\dash
207 terminated string containing information about the compiler
208 \hypertarget{chap:DWATproducercompileridentification}
209 that produced the compilation unit. The actual contents of
210 the string will be specific to each producer, but should
211 begin with the name of the compiler vendor or some other
212 identifying character sequence that should avoid confusion
213 with other producer values.
216 \item A \livelink{chap:DWATidentifiercase}{DW\-\_AT\-\_identifier\-\_case}
218 \addtoindexx{identifier case attribute}
220 \hypertarget{chap:DWATidentifiercaseidentifiercaserule}
221 constant value is a code describing the treatment
222 of identifiers within this compilation unit. The
223 set of identifier case codes
225 \refersec{fig:identifiercasecodes}.
228 \autorows[0pt]{c}{1}{l}{
229 \livelink{chap:DWIDcasesensitive}{DW\-\_ID\-\_case\-\_sensitive},
230 \livelink{chap:DWIDupcase}{DW\-\_ID\-\_up\-\_case},
231 \livelink{chap:DWIDdowncase}{DW\-\_ID\-\_down\-\_case},
232 \livelink{chap:DWIDcaseinsensitive}{DW\-\_ID\-\_case\-\_insensitive}
234 \caption{Identifier case codes}\label{fig:identifiercasecodes}
237 \livetarg{chap:DWIDcasesensitive}{DW\-\_ID\-\_case\-\_sensitive} is the default for all compilation units
238 that do not have this attribute. It indicates that names given
239 as the values of \livelink{chap:DWATname}{DW\-\_AT\-\_name} attributes
240 \addtoindexx{name attribute}
241 in debugging information
242 entries for the compilation unit reflect the names as they
243 appear in the source program. The debugger should be sensitive
244 to the case of identifier names when doing identifier lookups.
246 \livetarg{chap:DWIDupcase}{DW\-\_ID\-\_up\-\_case} means that the
247 producer of the debugging
248 information for this compilation unit converted all source
249 names to upper case. The values of the name attributes may not
250 reflect the names as they appear in the source program. The
251 debugger should convert all names to upper case when doing
254 \livetarg{chap:DWIDdowncase}{DW\-\_ID\-\_down\-\_case} means that
255 the producer of the debugging
256 information for this compilation unit converted all source
257 names to lower case. The values of the name attributes may not
258 reflect the names as they appear in the source program. The
259 debugger should convert all names to lower case when doing
262 \livetarg{chap:DWIDcaseinsensitive}{DW\-\_ID\-\_case\-\_insensitive} means that the values of the name
263 attributes reflect the names as they appear in the source
264 program but that a case insensitive lookup should be used to
267 \item A \livelink{chap:DWATbasetypes}{DW\-\_AT\-\_base\-\_types} attribute whose value is a reference.
271 \hypertarget{chap:DWATbasetypesprimitivedatatypesofcompilationunit}
273 \addtoindexx{base types attribute}
274 points to a debugging information entry
275 representing another compilation unit. It may be used
276 to specify the compilation unit containing the base type
277 entries used by entries in the current compilation unit
278 (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 “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 An imported unit entry does not necessarily correspond to
341 any entity or construct in the source program. It is merely
342 “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 Figure \refersec{fig: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 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’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.)
501 Namespace and namespace extension entries may own
502 \addtoindexx{namespace extension entry}
504 \addtoindexx{namespace declaration entry}
505 debugging information entries describing program entities
506 whose declarations occur in the namespace.
508 \textit{For \addtoindex{C++}, such
509 owned program entities may be declarations,
510 including certain declarations that are also object or
511 function definitions.}
513 If a type, variable, or function declared in a namespace is
514 defined outside of the body of the namespace declaration,
515 that type, variable, or function definition entry has a
516 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
517 \addtoindexx{specification attribute}
518 whose value is a reference to the
519 debugging information entry representing the declaration of
520 the type, variable or function. Type, variable, or function
522 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
523 \addtoindexx{specification attribute}
525 to duplicate information provided by the declaration entry
526 referenced by the specification attribute.
528 \textit{The \addtoindex{C++} \addtoindex{global namespace}
530 \addtoindexx{global namespace|see{namespace (C++), global}}
532 \addtoindexx{namespace (C++)!global}
534 ``::f'', for example) is not explicitly represented in
535 DWARF with a namespace entry (thus mirroring the situation
536 in \addtoindex{C++} source).
537 Global items may be simply declared with no
538 reference to a namespace.}
540 \textit{The \addtoindex{C++}
541 compilation unit specific ``unnamed namespace'' may
542 \addtoindexx{namespace (C++)!unnamed}
543 \addtoindexx{unnamed namespace|see {namespace (C++), unnamed}}
544 be represented by a namespace entry with no name attribute in
545 the original namespace declaration entry (and therefore no name
546 attribute in any namespace extension entry of this namespace).
549 \textit{A compiler emitting namespace information may choose to
550 explicitly represent namespace extensions, or to represent the
551 final namespace declaration of a compilation unit; this is a
552 quality\dash of\dash implementation issue and no specific requirements
553 are given here. If only the final namespace is represented,
554 \addtoindexx{namespace (C++)!using declaration}
555 it is impossible for a debugger to interpret using declaration
556 references in exactly the manner defined by the
557 \addtoindex{C++} language.
560 \textit{Emitting all namespace declaration information in all
561 compilation units can result in a significant increase in the
562 size of the debug information and significant duplication of
563 information across compilation units.
564 The \addtoindex{C++} namespace std,
566 \addtoindexx{namespace (C++)!std}
567 is large and will probably be referenced in
568 every \addtoindex{C++} compilation unit.
571 \textit{For a \addtoindex{C++} namespace example,
572 see Appendix \refersec{app:namespaceexample}.
577 \subsection{Imported (or Renamed) Declaration Entries}
578 \label{chap:importedorrenameddeclarationentries}
579 \textit{Some languages support the concept of importing into or making
580 accessible in a given unit declarations made in a different
581 module or scope. An imported declaration may sometimes be
586 imported declaration is represented by one or
587 \addtoindex{imported declaration entry}
588 more debugging information entries with the
589 tag \livetarg{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration}.
591 \hypertarget{chap:DWATimportimporteddeclaration}
593 is imported, there is one imported declaration entry for
595 \addtoindexx{import attribute}
596 Each imported declaration entry has a
597 \livelink{chap:DWATimport}{DW\-\_AT\-\_import} attribute,
598 whose value is a reference to the
599 debugging information entry representing the declaration that
602 An imported declaration may also have a
603 \livelink{chap:DWATname}{DW\-\_AT\-\_name}
605 \addtoindexx{name attribute}
606 whose value is a null\dash terminated string containing the
607 name, as it appears in the source program, by which the
608 imported entity is to be known in the context of the imported
609 declaration entry (which may be different than the name of
610 the entity being imported). If no name is present, then the
611 name by which the entity is to be known is the same as the
612 name of the entity being imported.
614 An imported declaration entry with a name attribute may be
615 used as a general means to rename or provide an alias for
616 \addtoindexx{alias declaration|see{imported declaration entry}}
617 an entity, regardless of the context in which the importing
618 declaration or the imported entity occurs.
620 \textit{A \addtoindex{C++} namespace alias may be represented by an imported
621 \hypertarget{chap:DWATimportnamespacealias}
623 \addtoindexx{namespace (C++)!alias}
624 with a name attribute whose value is
625 a null\dash terminated string containing the alias name as it
626 appears in the source program and an import attribute whose
627 value is a reference to the applicable original namespace or
628 namespace extension entry.
631 \textit{A \addtoindex{C++} using declaration may be represented by one or more
632 \hypertarget{chap:DWATimportnamespaceusingdeclaration}
634 \addtoindexx{namespace (C++)!using declaration}
635 declaration entries. When the using declaration
636 refers to an overloaded function, there is one imported
637 declaration entry corresponding to each overloading. Each
638 imported declaration entry has no name attribute but it does
639 have an import attribute that refers to the entry for the
640 entity being imported. (\addtoindex{C++}
641 provides no means to ``rename''
642 an imported entity, other than a namespace).
645 \textit{A \addtoindex{Fortran} use statement
646 \addtoindexx{Fortran!use statement}
647 \addtoindexx{use statement|see {Fortran, use statement}}
648 with an ``only list'' may be
649 represented by a series of imported declaration entries,
650 one (or more) for each entity that is imported. An entity
651 \addtoindexx{renamed declaration|see{imported declaration entry}}
652 that is renamed in the importing context may be represented
653 by an imported declaration entry with a name attribute that
654 specifies the new local name.
657 \subsection{Imported Module Entries}
658 \label{chap:importedmoduleentries}
660 \textit{Some languages support the concept of importing into or making
661 accessible in a given unit all of the declarations contained
662 within a separate module or namespace.
665 An imported module declaration is represented by a debugging
666 information entry with
667 \addtoindexx{imported module attribute}
669 \addtoindexx{imported module entry}
670 tag \livetarg{chap:DWTAGimportedmodule}{DW\-\_TAG\-\_imported\-\_module}.
672 imported module entry contains a
673 \livelink{chap:DWATimport}{DW\-\_AT\-\_import} attribute
674 \addtoindexx{import attribute}
675 whose value is a reference to the module or namespace entry
676 containing the definition and/or declaration entries for
677 the entities that are to be imported into the context of the
678 imported module entry.
680 An imported module declaration may own a set of imported
681 declaration entries, each of which refers to an entry in the
682 module whose corresponding entity is to be known in the context
683 of the imported module declaration by a name other than its
684 name in that module. Any entity in the module that is not
685 renamed in this way is known in the context of the imported
686 module entry by the same name as it is declared in the module.
688 \textit{A \addtoindex{C++} using directive
689 \addtoindexx{namespace (C++)!using directive}
690 \addtoindexx{using directive|see {namespace (C++), using directive}}
691 may be represented by an imported module
692 \hypertarget{chap:DWATimportnamespaceusingdirective}
693 entry, with an import attribute referring to the namespace
694 entry of the appropriate extension of the namespace (which
695 might be the original namespace entry) and no owned entries.
698 \textit{A \addtoindex{Fortran} use statement
699 \addtoindexx{Fortran!use statement}
700 with a “rename list” may be
701 represented by an imported module entry with an import
702 attribute referring to the module and owned entries
703 corresponding to those entities that are renamed as part of
707 \textit{A \addtoindex{Fortran} use statement
708 \addtoindexx{Fortran!use statement}
709 with neither a “rename list” nor
710 an “only list” may be represented by an imported module
711 entry with an import attribute referring to the module and
712 no owned child entries.
715 \textit{A use statement with an “only list” is represented by a
716 series of individual imported declaration entries as described
717 in Section \refersec{chap:importedorrenameddeclarationentries}.
720 \textit{A \addtoindex{Fortran} use statement for an entity in a module that is
721 \addtoindexx{Fortran!use statement}
722 itself imported by a use statement without an explicit mention
723 may be represented by an imported declaration entry that refers
724 to the original debugging information entry. For example, given
740 the imported declaration entry for Q within module C refers
741 directly to the variable declaration entry for A in module A
742 because there is no explicit representation for X in module B.
744 A similar situation arises for a \addtoindex{C++} using declaration
745 \addtoindexx{namespace (C++)!using declaration}
746 \addtoindexx{using declaration|see {namespace (C++), using declaration}}
747 that imports an entity in terms of a namespace alias. See
748 Appendix \refersec{app:namespaceexample}
752 \section{Subroutine and Entry Point Entries}
753 \label{chap:subroutineandentrypointentries}
755 The following tags exist to describe
756 debugging information entries
757 \addtoindexx{function entry|see{subroutine entry}}
759 \addtoindexx{subroutine entry}
761 \addtoindexx{subprogram entry}
763 % FIXME: is entry point entry the right index 'entry'?
764 \addtoindexx{entry point entry}
767 \begin{tabular}{lp{9.0cm}}
768 \livetarg{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram} & A subroutine or function. \\
769 \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine} & A particular inlined
770 \addtoindexx{inlined subprogram entry}
771 instance of a subroutine or function. \\
772 \livetarg{chap:DWTAGentrypoint}{DW\-\_TAG\-\_entry\-\_point} & An alternate entry point. \\
775 \subsection{General Subroutine and Entry Point Information}
776 \label{chap:generalsubroutineandentrypointinformation}
778 It may also have a \livelink{chap:DWATlinkagename}{DW\-\_AT\-\_linkage\-\_name} attribute as
779 described in Section \refersec{chap:linkagenames}.
781 If the name of the subroutine described by an entry with the
782 \addtoindex{subprogram entry}
783 tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}
784 is visible outside of its containing
785 \hypertarget{chap:DWATexternalexternalsubroutine}
786 compilation unit, that entry has
787 \addtoindexx{external attribute}
789 \livelink{chap:DWATexternal}{DW\-\_AT\-\_external} attribute,
790 which is a \livelink{chap:flag}{flag}.
792 \textit{Additional attributes for functions that are members of a
793 class or structure are described in
794 Section \refersec{chap:memberfunctionentries}.
798 \hypertarget{chap:DWATmainsubprogrammainorstartingsubprogram}
801 \livelink{chap:DWATmainsubprogram}{DW\-\_AT\-\_main\-\_subprogram}
803 \addtoindexx{main subprogram attribute}
805 a \livelink{chap:flag}{flag} whose presence indicates that the
806 subroutine has been identified as the starting function of
807 the program. If more than one subprogram contains this
809 any one of them may be the starting subroutine of the program.
811 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
812 which is used to specify
813 and provide a user\dash supplied name for the main subroutine of
817 \textit{A common debugger feature is to allow the debugger user to call
818 a subroutine within the subject program. In certain cases,
819 however, the generated code for a subroutine will not obey
820 the standard calling conventions for the target architecture
821 and will therefore not be safe to call from within a debugger.
824 A subroutine entry may
825 \hypertarget{chap:DWATcallingconventionsubprogramcallingconvention}
827 \livelink{chap:DWATcallingconvention}{DW\-\_AT\-\_calling\-\_convention}
828 attribute, whose value is an integer constant. The set of
829 calling convention codes is given in
830 Figure \refersec{fig:callingconventioncodes}.
833 \autorows[0pt]{c}{1}{l}{
834 \addtoindex{DW\-\_CC\-\_normal},
835 \addtoindex{DW\-\_CC\-\_program},
836 \addtoindex{DW\-\_CC\-\_nocall},
838 \caption{Calling convention codes}\label{fig:callingconventioncodes}
841 If this attribute is not present, or its value is the constant
842 \livetarg{chap:DWCCnormal}{DW\-\_CC\-\_normal}, then the subroutine may be safely called by
843 obeying the ``standard'' calling conventions of the target
844 architecture. If the value of the calling convention attribute
845 is the constant \livetarg{chap:DWCCnocall}{DW\-\_CC\-\_nocall}, the subroutine does not obey
846 standard calling conventions, and it may not be safe for the
847 debugger to call this subroutine.
849 If the semantics of the language of the compilation unit
850 containing the subroutine entry distinguishes between ordinary
851 subroutines and subroutines that can serve as the ``main
852 program,'' that is, subroutines that cannot be called
853 directly according to the ordinary calling conventions,
854 then the debugging information entry for such a subroutine
855 may have a calling convention attribute whose value is the
856 constant \livetarg{chap:DWCCprogram}{DW\-\_CC\-\_program}.
858 \textit{The \livelink{chap:DWCCprogram}{DW\-\_CC\-\_program}
859 value is intended to support \addtoindex{Fortran} main
860 \addtoindexx{Fortran!main program}
861 programs which in some implementations may not be callable
862 or which must be invoked in a special way. It is not intended
863 as a way of finding the entry address for the program.
866 \textit{In \addtoindex{C}
867 there is a difference between the types of functions
868 declared using function prototype style declarations and
869 those declared using non\dash prototype declarations.
872 A subroutine entry declared with a function prototype style
874 \addtoindexx{prototyped attribute}
876 \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped} attribute, which is
877 a \livelink{chap:flag}{flag}.
879 \textit{The \addtoindex{Fortran}
880 language allows the keywords elemental, pure
881 and recursive to be included as part of the declaration of
882 a subroutine; these attributes reflect that usage. These
883 attributes are not relevant for languages that do not support
884 similar keywords or syntax. In particular, the \livelink{chap:DWATrecursive}{DW\-\_AT\-\_recursive}
885 attribute is neither needed nor appropriate in languages such
887 where functions support recursion by default.
891 \hypertarget{chap:DWATelementalelementalpropertyofasubroutine}
893 \addtoindexx{elemental attribute}
895 \livelink{chap:DWATelemental}{DW\-\_AT\-\_elemental} attribute, which
896 is a \livelink{chap:flag}{flag}.
897 The attribute indicates whether the subroutine
898 or entry point was declared with the ``elemental'' keyword
902 \hypertarget{chap:DWATpurepurepropertyofasubroutine}
903 subprogram entry may have
904 \addtoindexx{pure attribute}
906 \livelink{chap:DWATpure}{DW\-\_AT\-\_pure} attribute, which is
907 a \livelink{chap:flag}{flag}.
908 The attribute indicates whether the subroutine was
909 declared with the ``pure'' keyword or property.
912 \hypertarget{chap:DWATrecursiverecursivepropertyofasubroutine}
913 subprogram entry may have a
914 \livelink{chap:DWATrecursive}{DW\-\_AT\-\_recursive} attribute, which
915 is a \livelink{chap:flag}{flag}.
916 The attribute indicates whether the subroutine
917 or entry point was declared with the ``recursive'' keyword
922 \subsection{Subroutine and Entry Point Return Types}
923 \label{chap:subroutineandentrypointreturntypes}
926 \hypertarget{chap:DWATtypetypeofsubroutinereturn}
927 the subroutine or entry point
928 \addtoindexx{return type of subroutine}
929 is a function that returns a
930 value, then its debugging information entry has
931 \addtoindexx{type attribute}
932 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
933 to denote the type returned by that function.
935 \textit{Debugging information entries for
936 \addtoindex{C} void functions should
937 not have an attribute for the return type. }
940 \subsection{Subroutine and Entry Point Locations}
941 \label{chap:subroutineandentrypointlocations}
943 A subroutine entry may have either a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
944 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of attributes or a \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
945 \addtoindexx{ranges attribute}
947 \addtoindexx{high PC attribute}
949 \addtoindexx{low PC attribute}
950 encode the contiguous or non\dash contiguous address
951 ranges, respectively, of the machine instructions generated
952 for the subroutine (see
953 Section \refersec{chap:codeaddressesandranges}).
956 \hypertarget{chap:DWATentrypcentryaddressofsubprogram}
957 subroutine entry may also have
958 \addtoindexx{entry pc attribute!for subroutine}
960 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} attribute
961 whose value is the address of the first executable instruction
962 of the subroutine (see
963 Section \refersec{chap:entryaddress}).
965 An entry point has a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute whose value is the
966 relocated address of the first machine instruction generated
970 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} attribute
971 \addtoindexx{entry pc attribute!for subroutine}
973 also seem appropriate
974 for this purpose, historically the
975 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute
977 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc} was introduced (in
978 \addtoindex{DWARF Version 3}).
979 There is insufficient reason to change this.}
985 \addtoindexx{address class!attribute}
987 \hypertarget{chap:DWATaddressclasssubroutineorsubroutinetype}
989 \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment}
991 \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class} attributes,
992 as appropriate, to specify
993 which segments the code for the subroutine resides in and
994 the addressing mode to be used in calling that subroutine.
996 A subroutine entry representing a subroutine declaration
997 that is not also a definition does not have code address or
1001 \subsection{Declarations Owned by Subroutines and Entry Points}
1002 \label{chap:declarationsownedbysubroutinesandentrypoints}
1004 The declarations enclosed by a subroutine or entry point are
1005 represented by debugging information entries that are owned
1006 by the subroutine or entry point entry. Entries representing
1007 \addtoindexx{formal parameter}
1008 the formal parameters of the subroutine or entry point appear
1009 in the same order as the corresponding declarations in the
1012 \textit{There is no ordering requirement for entries for declarations
1013 that are children of subroutine or entry point entries but
1014 that do not represent formal parameters. The formal parameter
1015 entries may be interspersed with other entries used by formal
1016 parameter entries, such as type entries.}
1018 The unspecified parameters of a variable parameter list are
1019 represented by a debugging information entry\addtoindexx{unspecified parameters entry}
1021 \livetarg{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}.
1023 The entry for a subroutine that includes
1024 \addtoindexx{Fortran!common block}
1026 \addtoindex{Fortran} common block
1027 \livelink{chap:fortrancommonblock}{common}
1028 \livelink{chap:commonblockentry}{block}
1029 \addtoindexx{common block|see{Fortran common block}}
1030 has a child entry with the
1031 tag \livetarg{chap:DWTAGcommoninclusion}{DW\-\_TAG\-\_common\-\_inclusion}.
1033 \hypertarget{chap:commonreferencecommonblockusage}
1034 common inclusion entry has a
1035 \livelink{chap:DWATcommonreference}{DW\-\_AT\-\_common\-\_reference} attribute
1036 whose value is a reference to the debugging information entry
1037 for the common \nolink{block} being included
1038 (see Section \refersec{chap:commonblockentries}).
1040 \subsection{Low-Level Information}
1041 \label{chap:lowlevelinformation}
1044 \hypertarget{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}
1045 subroutine or entry point entry may have
1046 \addtoindexx{return address attribute}
1048 \livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr}
1049 attribute, whose value is a location description. The location
1050 calculated is the place where the return address for the
1051 subroutine or entry point is stored.
1054 \hypertarget{chap:DWATframebasesubroutineframebaseaddress}
1055 subroutine or entry point entry may also have
1056 \addtoindexx{frame base attribute}
1058 \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attribute, whose value is a location
1059 description that computes the “frame base” for the
1060 subroutine or entry point. If the location description is
1061 a simple register location description, the given register
1062 contains the frame base address. If the location description is
1063 a DWARF expression, the result of evaluating that expression
1064 is the frame base address. Finally, for a
1065 \addtoindex{location list},
1066 this interpretation applies to each location description
1067 contained in the list of \addtoindex{location list} entries.
1069 \textit{The use of one of the \livelink{chap:DWOPreg}{DW\-\_OP\-\_reg}~\textless~n~\textgreater
1071 context is equivalent to using
1072 \livelink{chap:DWOPbreg}{DW\-\_OP\-\_breg}~\textless~n~\textgreater(0)
1074 compact. However, these are not equivalent in general.}
1076 \textit{The frame base for a procedure is typically an address fixed
1077 relative to the first unit of storage allocated for the
1078 procedure’s stack frame. The \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attribute
1079 can be used in several ways:}
1081 \begin{enumerate}[1.]
1082 \item \textit{In procedures that need
1083 \addtoindexx{location list}
1084 location lists to locate local
1085 variables, the \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} can hold the needed location
1086 list, while all variables’ location descriptions can be
1087 simpler ones involving the frame base.}
1089 \item \textit{It can be used in resolving ``up\dash level'' addressing
1090 within nested routines.
1091 (See also \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link}, below)}
1092 %The -See also- here is ok, the DW\-\_AT should be
1093 %a hyperref to the def itself, which is earlier in this document.
1096 \textit{Some languages support nested subroutines. In such languages,
1097 it is possible to reference the local variables of an
1098 outer subroutine from within an inner subroutine. The
1099 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link} and \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attributes allow
1100 debuggers to support this same kind of referencing.}
1103 \hypertarget{chap:DWATstaticlinklocationofuplevelframe}
1105 \addtoindexx{address!uplevel|see {static link attribute}}
1106 \addtoindexx{uplevel address|see {static link attribute}}
1107 subroutine or entry point is nested, it may have a
1108 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link}
1109 attribute, whose value is a location
1110 description that computes the frame base of the relevant
1111 instance of the subroutine that immediately encloses the
1112 subroutine or entry point.
1114 In the context of supporting nested subroutines, the
1115 \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} attribute value should obey the following
1118 \begin{enumerate}[1.]
1119 \item It should compute a value that does not change during the
1120 life of the procedure, and
1122 \item The computed value should be unique among instances of
1123 the same subroutine. (For typical \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base} use, this
1124 means that a recursive subroutine’s stack frame must have
1125 non\dash zero size.)
1128 \textit{If a debugger is attempting to resolve an up\dash level reference
1129 to a variable, it uses the nesting structure of DWARF to
1130 determine which subroutine is the lexical parent and the
1131 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link} value to identify the appropriate active
1132 frame of the parent. It can then attempt to find the reference
1133 within the context of the parent.}
1137 \subsection{Types Thrown by Exceptions}
1138 \label{chap:typesthrownbyexceptions}
1140 \textit{In \addtoindex{C++} a subroutine may declare a set of types which
1141 it may validly throw.}
1143 If a subroutine explicitly declares that it may throw
1144 \addtoindexx{exception thrown|see{thrown type entry}}
1146 \addtoindexx{thrown exception|see{thrown type entry}}
1147 exception for one or more types, each such type is
1149 represented by a debugging information entry with
1150 \addtoindexx{thrown type entry}
1152 \livetarg{chap:DWTAGthrowntype}{DW\-\_TAG\-\_thrown\-\_type}.
1153 Each such entry is a child of the entry
1154 representing the subroutine that may throw this type. Each
1155 thrown type entry contains
1156 \addtoindexx{type attribute}
1157 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, whose
1158 value is a reference to an entry describing the type of the
1159 exception that may be thrown.
1161 \subsection{Function Template Instantiations}
1162 \label{chap:functiontemplateinstantiations}
1164 \textit{In \addtoindex{C++}, a function template is a generic definition of
1165 a function that is instantiated differently when called with
1166 values of different types. DWARF does not represent the generic
1167 template definition, but does represent each instantiation.}
1169 A \addtoindex{template instantiation} is represented by a debugging
1170 information entry with the
1171 \addtoindexx{subprogram entry!use for template instantiation}
1172 tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}.
1174 exceptions, such an entry will contain the same attributes and
1175 will have the same types of child entries as would an entry
1176 for a subroutine defined explicitly using the instantiation
1177 types. The exceptions are:
1179 \begin{enumerate}[1.]
1180 \item Each formal parameterized type declaration appearing in the
1181 template definition is represented by a debugging information
1183 \addtoindexx{template type parameter entry}
1184 tag \livetarg{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}.
1186 such entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
1187 \addtoindexx{name attribute}
1189 null\dash terminated string containing the name of the formal
1190 type parameter as it appears in the source program. The
1191 \addtoindexx{formal type parameter|see{template type parameter entry}}
1192 template type parameter entry also has
1193 \addtoindexx{type attribute}
1194 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1195 describing the actual type by which the formal is replaced
1196 for this instantiation.
1198 \item The subprogram entry and each of its child entries reference
1199 a template type parameter entry in any circumstance where
1200 the template definition referenced a formal parameterized type.
1202 \item If the compiler has generated a special compilation unit
1203 to hold the template instantiation and that compilation unit
1204 has a different name from the compilation unit containing
1205 the template definition, the name attribute for the debugging
1206 information entry representing that compilation unit is empty
1209 \item If the subprogram entry representing the template
1210 instantiation or any of its child entries contain declaration
1211 coordinate attributes, those attributes refer to the source
1212 for the template definition, not to any source generated
1213 artificially by the compiler for this instantiation.
1218 \subsection{Inlinable and Inlined Subroutines}
1219 A declaration or a definition of an inlinable subroutine
1220 is represented by a debugging information entry with the
1222 \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}.
1224 \addtoindexx{subprogram entry!use in inlined subprogram}
1226 \hypertarget{chap:DWATinlineinlinedsubroutine}
1227 explicitly declared to be available for inline expansion or
1228 that was expanded inline implicitly by the compiler has
1229 \addtoindexx{inline attribute}
1231 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute whose value is an integer constant. The
1232 set of values for the \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute is given in
1233 Figure \refersec{fig:inlinecodes}.
1235 \begin{figure}[here]
1237 \caption{Inline codes}
1238 \label{fig:inlinecodes}
1239 \begin{tabular}{lp{9cm}}
1240 Name&Meaning\\ \hline
1241 \livetarg{chap:DWINLnotinlined}{DW\-\_INL\-\_not\-\_inlined} & Not declared inline nor inlined by the
1242 compiler(equivalent to the absence of the containing
1243 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute) \\
1244 \livetarg{chap:DWINLinlined}{DW\-\_INL\-\_inlined} & Not declared inline but inlined by the compiler \\
1245 \livetarg{chap:DWINLdeclarednotinlined}{DW\-\_INL\-\_declared\-\_not\-\_inlined} & Declared inline but
1246 not inlined by the compiler \\
1247 \livetarg{chap:DWINLdeclaredinlined}{DW\-\_INL\-\_declared\-\_inlined} & Declared inline and inlined by the compiler \\
1251 \textit{In \addtoindex{C++}, a function or a constructor declared with
1252 constexpr is implicitly declared inline. The abstract inline
1253 instance (see below) is represented by a debugging information
1254 entry with the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}. Such an entry has a
1255 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute whose value is \livelink{chap:DWINLinlined}{DW\-\_INL\-\_inlined}.}
1258 \paragraph{Abstract Instances}
1259 \label{chap:abstractinstances}
1260 Any debugging information entry that is owned (either
1261 \hypertarget{chap:DWATinlineabstracttinstance}
1262 directly or indirectly) by a debugging information entry
1264 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute is referred to
1265 \addtoindexx{abstract instance!entry}
1266 as an ``abstract instance entry.''
1267 Any subroutine entry
1269 \addtoindexx{inline attribute}
1270 a \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute whose value is other
1271 than \livelink{chap:DWINLnotinlined}{DW\-\_INL\-\_not\-\_inlined}
1273 \addtoindexx{abstract instance!root}
1274 an ``abstract instance root.''
1275 Any set of abstract instance entries that are all
1276 children (either directly or indirectly) of some abstract
1277 instance root, together with the root itself, is known as
1278 \addtoindexx{abstract instance!tree}
1279 an ``abstract instance tree.'' However, in the case where
1280 an abstract instance tree is nested within another abstract
1281 instance tree, the entries in the
1282 \addtoindex{nested abstract instance}
1283 tree are not considered to be entries in the outer abstract
1286 Each abstract instance root is either part of a larger
1287 \addtoindexx{abstract instance!root}
1288 tree (which gives a context for the root) or
1289 \addtoindexx{specification attribute}
1291 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
1292 to refer to the declaration in context.
1294 \textit{For example, in \addtoindex{C++} the context might be a namespace
1295 declaration or a class declaration.}
1297 \textit{Abstract instance trees are defined so that no entry is part
1298 of more than one abstract instance tree. This simplifies the
1299 following descriptions.}
1301 A debugging information entry that is a member of an abstract
1302 instance tree should not contain any attributes which describe
1303 aspects of the subroutine which vary between distinct inlined
1304 expansions or distinct out\dash of\dash line expansions. For example,
1305 \addtoindexx{entry pc attribute!and abstract instance}
1306 the \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc},
1307 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc},
1308 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges},
1309 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc},
1310 \livelink{chap:DWATlocation}{DW\-\_AT\-\_location},
1311 \livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr}, \livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope},
1313 \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment!and abstract instance}
1315 \addtoindexx{location attribute!and abstract instance}
1317 \addtoindexx{ranges attribute!and abstract instance}
1319 \addtoindexx{high PC attribute!and abstract instance}
1321 \addtoindexx{low PC attribute!and abstract instance}
1323 \addtoindex{segment attribute!and abstract instance}
1325 \addtoindexx{return address attribute!and abstract instance}
1327 \addtoindexx{segment attribute!and abstract instance}
1329 \addtoindexx{start scope attribute!and abstract instance}
1332 \textit{It would not make sense normally to put these attributes into
1333 abstract instance entries since such entries do not represent
1334 actual (concrete) instances and thus do not actually exist at
1335 run\dash time. However,
1336 see Appendix \refersec{app:inlineouteronenormalinner}
1337 for a contrary example.}
1339 The rules for the relative location of entries belonging to
1340 abstract instance trees are exactly the same as for other
1341 similar types of entries that are not abstract. Specifically,
1342 the rule that requires that an entry representing a declaration
1343 be a direct child of the entry representing the scope of the
1344 declaration applies equally to both abstract and non\dash abstract
1345 entries. Also, the ordering rules for formal parameter entries,
1346 member entries, and so on, all apply regardless of whether
1347 or not a given entry is abstract.
1349 \paragraph{Concrete Inlined Instances}
1350 \label{chap:concreteinlinedinstances}
1352 Each inline expansion of a subroutine is represented
1353 by a debugging information entry with the
1354 tag \livetarg{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}.
1355 Each such entry should be a direct
1356 child of the entry that represents the scope within which
1357 the inlining occurs.
1359 Each inlined subroutine entry may have either a
1360 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc}
1361 and \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair
1363 \addtoindexx{high PC attribute}
1365 \addtoindexx{low PC attribute}
1367 \addtoindexx{ranges attribute}
1369 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges}
1370 attribute whose values encode the contiguous or non\dash contiguous
1371 address ranges, respectively, of the machine instructions
1372 generated for the inlined subroutine (see
1373 Section \refersec{chap:codeaddressesandranges}).
1375 \hypertarget{chap:DWATentrypcentryaddressofinlinedsubprogram}
1376 inlined subroutine entry may
1377 \addtoindexx{inlined subprogram entry!in concrete instance}
1379 \addtoindexx{inlined subprogram entry}
1381 \addtoindexx{entry pc attribute!for inlined subprogram}
1383 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc}
1384 attribute, representing the first executable instruction of
1385 the inline expansion (see
1386 Section \refersec{chap:entryaddress}).
1388 % Positions of the 3 targets here is a bit arbitrary.
1390 \hypertarget{chap:DWATcalllinelinenumberofinlinedsubroutinecall}
1392 \hypertarget{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}
1394 \hypertarget{chap:DWATcallfilefilecontaininginlinedsubroutinecall}
1395 may also have \livelink{chap:DWATcallfile}{DW\-\_AT\-\_call\-\_file},
1396 \livelink{chap:DWATcallline}{DW\-\_AT\-\_call\-\_line} and \livelink{chap:DWATcallcolumn}{DW\-\_AT\-\_call\-\_column} attributes,
1398 value is an integer constant. These attributes represent the
1399 source file, source line number, and source column number,
1400 respectively, of the first character of the statement or
1401 expression that caused the inline expansion. The call file,
1402 call line, and call column attributes are interpreted in
1403 the same way as the declaration file, declaration line, and
1404 declaration column attributes, respectively (see
1405 Section \refersec{chap:declarationcoordinates}).
1407 The call file, call line and call column coordinates do not
1408 describe the coordinates of the subroutine declaration that
1409 was inlined, rather they describe the coordinates of the call.
1411 An inlined subroutine entry
1412 \hypertarget{chap:DWATconstexprcompiletimeconstantfunction}
1414 \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr}
1415 attribute, which is a \livelink{chap:flag}{flag}
1416 whose presence indicates that the
1417 subroutine has been evaluated as a compile\dash time constant. Such
1418 an entry may also have a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute,
1419 whose value may be of any form that is appropriate for the
1420 representation of the subroutine's return value. The value of
1421 this attribute is the actual return value of the subroutine,
1422 represented as it would be on the target architecture.
1424 \textit{In \addtoindex{C++}, if a function or a constructor declared with constexpr
1425 is called with constant expressions, then the corresponding
1426 concrete inlined instance has a
1427 \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr} attribute,
1428 as well as a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute whose value represents
1429 the actual return value of the concrete inlined instance.}
1431 Any debugging information entry that is owned (either
1432 directly or indirectly) by a debugging information entry
1433 with the tag \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine} is referred to as a
1434 ``concrete inlined instance entry.'' Any entry that has
1436 \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}
1437 is known as a ``concrete inlined instance root.''
1438 Any set of concrete inlined instance
1439 entries that are all children (either directly or indirectly)
1440 of some concrete inlined instance root, together with the root
1441 itself, is known as a ``concrete inlined instance tree.''
1442 However, in the case where a concrete inlined instance tree
1443 is nested within another concrete instance tree, the entries
1444 in the \addtoindex{nested concrete inline instance} tree
1445 are not considered to
1446 be entries in the outer concrete instance tree.
1448 \textit{Concrete inlined instance trees are defined so that no entry
1449 is part of more than one concrete inlined instance tree. This
1450 simplifies later descriptions.}
1452 Each concrete inlined instance tree is uniquely associated
1453 with one (and only one) abstract instance tree.
1455 \textit{Note, however, that the reverse is not true. Any given abstract
1456 instance tree may be associated with several different concrete
1457 inlined instance trees, or may even be associated with zero
1458 concrete inlined instance trees.}
1460 Concrete inlined instance entries may omit attributes that
1461 are not specific to the concrete instance (but present in
1462 the abstract instance) and need include only attributes that
1463 are specific to the concrete instance (but omitted in the
1464 abstract instance). In place of these omitted attributes, each
1465 \hypertarget{chap:DWATabstractorigininlineinstance}
1466 concrete inlined instance entry
1467 \addtoindexx{abstract origin attribute}
1469 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin}
1470 attribute that may be used to obtain the missing information
1471 (indirectly) from the associated abstract instance entry. The
1472 value of the abstract origin attribute is a reference to the
1473 associated abstract instance entry.
1475 If an entry within a concrete inlined instance tree contains
1476 attributes describing the
1477 \addtoindexx{declaration coordinates!in concrete instance}
1478 declaration coordinates
1480 entry, then those attributes should refer to the file, line
1481 and column of the original declaration of the subroutine,
1482 not to the point at which it was inlined. As a consequence,
1483 they may usually be omitted from any entry that has an abstract
1486 For each pair of entries that are associated via a
1487 \addtoindexx{abstract origin attribute}
1488 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin} attribute, both members of the pair
1489 have the same tag. So, for example, an entry with the tag
1490 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable} can only be associated with another entry
1491 that also has the tag \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}. The only exception
1492 to this rule is that the root of a concrete instance tree
1493 (which must always have the tag \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine})
1494 can only be associated with the root of its associated abstract
1495 instance tree (which must have the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}).
1497 In general, the structure and content of any given concrete
1498 inlined instance tree will be closely analogous to the
1499 structure and content of its associated abstract instance
1500 tree. There are a few exceptions:
1502 \begin{enumerate}[1.]
1503 \item An entry in the concrete instance tree may be omitted if
1505 \addtoindexx{abstract origin attribute}
1506 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin} attribute and either
1507 has no children, or its children are omitted. Such entries
1508 would provide no useful information. In C\dash like languages,
1509 such entries frequently include types, including structure,
1510 union, class, and interface types; and members of types. If any
1511 entry within a concrete inlined instance tree needs to refer
1512 to an entity declared within the scope of the relevant inlined
1513 subroutine and for which no concrete instance entry exists,
1514 the reference should refer to the abstract instance entry.
1516 \item Entries in the concrete instance tree which are associated
1517 with entries in the abstract instance tree such that neither
1518 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
1519 \addtoindexx{name attribute}
1520 and neither is referenced by
1521 any other debugging information entry, may be omitted. This
1522 may happen for debugging information entries in the abstract
1523 instance trees that became unnecessary in the concrete instance
1524 tree because of additional information available there. For
1525 example, an anonymous variable might have been created and
1526 described in the abstract instance tree, but because of
1527 the actual parameters for a particular inlined expansion,
1528 it could be described as a constant value without the need
1529 for that separate debugging information entry.
1531 \item A concrete instance tree may contain entries which do
1532 not correspond to entries in the abstract instance tree
1533 to describe new entities that are specific to a particular
1534 inlined expansion. In that case, they will not have associated
1535 entries in the abstract instance tree, should not contain
1536 \addtoindexx{abstract origin attribute}
1537 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin} attributes, and must contain all their
1538 own attributes directly. This allows an abstract instance tree
1539 to omit debugging information entries for anonymous entities
1540 that are unlikely to be needed in most inlined expansions. In
1541 any expansion which deviates from that expectation, the
1542 entries can be described in its concrete inlined instance tree.
1546 \paragraph{Out-of-Line Instances of Inlined Subroutines}
1547 \label{chap:outoflineinstancesofinlinedsubroutines}
1548 Under some conditions, compilers may need to generate concrete
1549 executable instances of inlined subroutines other than at
1550 points where those subroutines are actually called. Such
1551 concrete instances of inlined subroutines are referred to as
1552 ``concrete out\dash of\dash line instances.''
1554 \textit{In \addtoindex{C++}, for example,
1555 taking the address of a function declared
1556 to be inline can necessitate the generation of a concrete
1557 out\dash of\dash line instance of the given function.}
1559 The DWARF representation of a concrete out\dash of\dash line instance
1560 of an inlined subroutine is essentially the same as for a
1561 concrete inlined instance of that subroutine (as described in
1562 the preceding section). The representation of such a concrete
1563 % It is critical that the hypertarget and livelink be
1564 % separated to avoid problems with latex.
1565 out\dash of\dash line
1566 \addtoindexx{abstract origin attribute}
1568 \hypertarget{chap:DWATabstractoriginoutoflineinstance}
1570 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin}
1571 attributes in exactly the same way as they are used for
1572 a concrete inlined instance (that is, as references to
1573 corresponding entries within the associated abstract instance
1576 The differences between the DWARF representation of a
1577 concrete out\dash of\dash line instance of a given subroutine and the
1578 representation of a concrete inlined instance of that same
1579 subroutine are as follows:
1581 \begin{enumerate}[1.]
1582 \item The root entry for a concrete out\dash of\dash line instance
1583 of a given inlined subroutine has the same tag as does its
1584 associated (abstract) inlined subroutine entry (that is, tag
1585 \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram} rather than \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}).
1587 \item The root entry for a concrete out\dash of\dash line instance tree
1588 is normally owned by the same parent entry that also owns
1589 the root entry of the associated abstract instance. However,
1590 it is not required that the abstract and out\dash of\dash line instance
1591 trees be owned by the same parent entry.
1595 \paragraph{Nested Inlined Subroutines}
1596 \label{nestedinlinedsubroutines}
1597 Some languages and compilers may permit the logical nesting of
1598 a subroutine within another subroutine, and may permit either
1599 the outer or the nested subroutine, or both, to be inlined.
1601 For a non\dash inlined subroutine nested within an inlined
1602 subroutine, the nested subroutine is described normally in
1603 both the abstract and concrete inlined instance trees for
1604 the outer subroutine. All rules pertaining to the abstract
1605 and concrete instance trees for the outer subroutine apply
1606 also to the abstract and concrete instance entries for the
1609 For an inlined subroutine nested within another inlined
1610 subroutine, the following rules apply to their abstract and
1611 \addtoindexx{abstract instance!nested}
1612 \addtoindexx{concrete instance!nested}
1613 concrete instance trees:
1615 \begin{enumerate}[1.]
1616 \item The abstract instance tree for the nested subroutine is
1617 described within the abstract instance tree for the outer
1618 subroutine according to the rules in
1619 Section \refersec{chap:abstractinstances}, and
1620 without regard to the fact that it is within an outer abstract
1623 \item Any abstract instance tree for a nested subroutine is
1624 always omitted within the concrete instance tree for an
1627 \item A concrete instance tree for a nested subroutine is
1628 always omitted within the abstract instance tree for an
1631 \item The concrete instance tree for any inlined or
1632 \addtoindexx{out-of-line instance}
1634 \addtoindexx{out-of-line-instance|see{concrete out-of-line-instance}}
1635 expansion of the nested subroutine is described within a
1636 concrete instance tree for the outer subroutine according
1638 Sections \refersec{chap:concreteinlinedinstances} or
1639 \refersec{chap:outoflineinstancesofinlinedsubroutines}
1641 and without regard to the fact that it is within an outer
1642 concrete instance tree.
1645 See Appendix \refersec{app:inliningexamples}
1646 for discussion and examples.
1648 \subsection{Trampolines}
1649 \label{chap:trampolines}
1651 \textit{A trampoline is a compiler\dash generated subroutine that serves as
1652 \hypertarget{chap:DWATtrampolinetargetsubroutine}
1653 an intermediary in making a call to another subroutine. It may
1654 adjust parameters and/or the result (if any) as appropriate
1655 to the combined calling and called execution contexts.}
1657 A trampoline is represented by a debugging information entry
1658 \addtoindexx{trampoline (subprogam) entry}
1659 with the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram} or \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}
1661 \addtoindexx{trampoline attribute}
1662 a \livelink{chap:DWATtrampoline}{DW\-\_AT\-\_trampoline} attribute.
1664 attribute indicates the target subroutine of the trampoline,
1665 that is, the subroutine to which the trampoline passes
1666 control. (A trampoline entry may but need not also have a
1667 \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial} attribute.)
1669 The value of the trampoline attribute may be represented
1670 using any of the following forms, which are listed in order
1674 \item If the value is of class reference, then the value
1675 specifies the debugging information entry of the target
1678 \item If the value is of class address, then the value is
1679 the relocated address of the target subprogram.
1681 \item If the value is of class string, then the value is the
1682 (possibly mangled) \addtoindexx{mangled names}
1683 name of the target subprogram.
1685 \item If the value is of class \livelink{chap:flag}{flag}, then the value true
1686 indicates that the containing subroutine is a trampoline but
1687 that the target subroutine is not known.
1691 The target subprogram may itself be a trampoline. (A sequence
1692 of trampolines necessarily ends with a non\dash trampoline
1695 \textit{In \addtoindex{C++}, trampolines may be used
1696 to implement derived virtual
1697 member functions; such trampolines typically adjust the
1698 \addtoindexx{this parameter}
1699 implicit this pointer parameter in the course of passing
1701 Other languages and environments may use trampolines
1702 in a manner sometimes known as transfer functions or transfer
1705 \textit{Trampolines may sometimes pass control to the target
1706 subprogram using a branch or jump instruction instead of a
1707 call instruction, thereby leaving no trace of their existence
1708 in the subsequent execution context. }
1710 \textit{This attribute helps make it feasible for a debugger to arrange
1711 that stepping into a trampoline or setting a breakpoint in
1712 a trampoline will result in stepping into or setting the
1713 breakpoint in the target subroutine instead. This helps to
1714 hide the compiler generated subprogram from the user. }
1716 \textit{If the target subroutine is not known, a debugger may choose
1717 to repeatedly step until control arrives in a new subroutine
1718 which can be assumed to be the target subroutine. }
1722 \section{Lexical Block Entries}
1723 \label{chap:lexicalblockentries}
1726 lexical \livetargi{chap:lexicalblock}{block}{lexical block}
1728 \addtoindexx{lexical block}
1729 a bracketed sequence of source statements
1730 that may contain any number of declarations. In some languages
1731 (including \addtoindex{C} and \addtoindex{C++}),
1732 \nolink{blocks} can be nested within other
1733 \nolink{blocks} to any depth.}
1735 % We do not need to link to the preceding paragraph.
1736 A lexical \nolink{block} is represented by a debugging information
1738 tag \livetarg{chap:DWTAGlexicalblock}{DW\-\_TAG\-\_lexical\-\_block}.
1740 The lexical \livetargi{chap:lexicalblockentry}{block}{lexical block entry}
1743 either a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
1744 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of
1746 \addtoindexx{high PC attribute}
1748 \addtoindexx{low PC attribute}
1750 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
1751 \addtoindexx{ranges attribute}
1752 whose values encode the contiguous or non-contiguous address
1753 ranges, respectively, of the machine instructions generated
1754 for the lexical \livelink{chap:lexicalblock}{block}
1755 (see Section \refersec{chap:codeaddressesandranges}).
1757 If a name has been given to the
1758 lexical \livelink{chap:lexicalblock}{block}
1760 program, then the corresponding
1761 lexical \livelink{chap:lexicalblockentry}{block} entry has a
1762 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose
1763 \addtoindexx{name attribute}
1764 value is a null\dash terminated string
1765 containing the name of the lexical \livelink{chap:lexicalblock}{block}
1769 \textit{This is not the same as a \addtoindex{C} or
1770 \addtoindex{C++} label (see below).}
1772 The lexical \livelink{chap:lexicalblockentry}{block} entry owns
1773 debugging information entries that
1774 describe the declarations within that lexical \livelink{chap:lexicalblock}{block}.
1776 one such debugging information entry for each local declaration
1777 of an identifier or inner lexical \livelink{chap:lexicalblock}{block}.
1779 \section{Label Entries}
1780 \label{chap:labelentries}
1782 A label is a way of identifying a source statement. A labeled
1783 statement is usually the target of one or more ``go to''
1786 A label is represented by a debugging information entry with
1787 \addtoindexx{label entry}
1789 tag \livetarg{chap:DWTAGlabel}{DW\-\_TAG\-\_label}.
1790 The entry for a label should be owned by
1791 the debugging information entry representing the scope within
1792 which the name of the label could be legally referenced within
1795 The label entry has a \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute whose value
1796 is the relocated address of the first machine instruction
1797 generated for the statement identified by the label in
1798 the source program. The label entry also has a
1799 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1800 \addtoindexx{name attribute}
1801 whose value is a null-terminated string containing
1802 the name of the label as it appears in the source program.
1805 \section{With Statement Entries}
1806 \label{chap:withstatemententries}
1808 \textit{Both \addtoindex{Pascal} and
1809 \addtoindexx{Modula-2}
1810 Modula\dash 2 support the concept of a ``with''
1811 statement. The with statement specifies a sequence of
1812 executable statements within which the fields of a record
1813 variable may be referenced, unqualified by the name of the
1816 A with statement is represented by a
1817 \addtoindexi{debugging information entry}{with statement entry}
1818 with the tag \livetarg{chap:DWTAGwithstmt}{DW\-\_TAG\-\_with\-\_stmt}.
1820 A with statement entry may have either a
1821 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
1822 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of attributes
1823 \addtoindexx{high PC attribute}
1825 \addtoindexx{low PC attribute}
1826 a \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
1827 \addtoindexx{ranges attribute}
1828 whose values encode the contiguous or non\dash contiguous address
1829 ranges, respectively, of the machine instructions generated
1830 for the with statement
1831 (see Section \refersec{chap:codeaddressesandranges}).
1833 The with statement entry has
1834 \addtoindexx{type attribute}
1835 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, denoting
1836 the type of record whose fields may be referenced without full
1837 qualification within the body of the statement. It also has
1838 \addtoindexx{location attribute}
1839 a \livelink{chap:DWATlocation}{DW\-\_AT\-\_location} attribute, describing how to find the base
1840 address of the record object referenced within the body of
1843 \section{Try and Catch Block Entries}
1844 \label{chap:tryandcatchblockentries}
1846 \textit{In \addtoindex{C++} a lexical \livelink{chap:lexicalblock}{block} may be
1847 designated as a ``catch \nolink{block}.''
1848 A catch \livetargi{chap:catchblock}{block}{catch block} is an
1849 exception handler that handles
1850 exceptions thrown by an immediately
1851 preceding ``try \livelink{chap:tryblock}{block}.''
1852 A catch \livelink{chap:catchblock}{block}
1853 designates the type of the exception that it
1856 A try \livetargi{chap:tryblock}{block}{try block} is represented
1857 by a debugging information entry
1858 \addtoindexx{try block entry}
1859 with the tag \livetarg{chap:DWTAGtryblock}{DW\-\_TAG\-\_try\-\_block}.
1860 A catch \livelink{chap:catchblock}{block} is represented by
1861 a debugging information entry with
1862 \addtoindexx{catch block entry}
1863 the tag \livetarg{chap:DWTAGcatchblock}{DW\-\_TAG\-\_catch\-\_block}.
1865 % nolink as we have links just above and do not have a combo link for both
1866 Both try and catch \nolink{block} entries may have either a
1867 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
1868 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of attributes
1869 \addtoindexx{high PC attribute}
1871 \addtoindexx{low PC attribute}
1873 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} attribute
1874 \addtoindexx{ranges attribute}
1875 whose values encode the contiguous
1876 or non\dash contiguous address ranges, respectively, of the
1877 machine instructions generated for the \livelink{chap:lexicalblock}{block}
1879 \refersec{chap:codeaddressesandranges}).
1881 Catch \livelink{chap:catchblock}{block} entries have at
1882 least one child entry, an
1883 entry representing the type of exception accepted by
1884 that catch \livelink{chap:catchblock}{block}.
1886 This child entry has one of
1887 \addtoindexx{formal parameter entry!in catch block}
1889 \addtoindexx{unspecified parameters entry!in catch block}
1891 \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter} or
1892 \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters},
1893 and will have the same form as other parameter entries.
1895 The siblings immediately following
1896 a try \livelink{chap:tryblock}{block} entry are its
1897 corresponding catch \livelink{chap:catchblock}{block} entries.