1 \chapter{General Description}
2 \label{chap:generaldescription}
3 \section{The Debugging Information Entry (DIE)}
4 \label{chap:thedebuggingentrydie}
6 \addtoindexx{debugging information entry}
8 \addtoindexx{DIE|see{debugging information entry}}
9 a series of debugging information entries (DIEs) to
11 representation of a source program.
12 Each debugging information entry consists of an identifying
13 \addtoindex{tag} and a series of
14 \addtoindex{attributes}.
15 An entry, or group of entries together, provide a description of a
17 \addtoindex{entity} in the source program.
18 The tag specifies the class to which an entry belongs
19 and the attributes define the specific characteristics of the entry.
22 \addtoindexx{tag names|see{debugging information entry}}
23 is listed in Table \refersec{tab:tagnames}.
24 The debugging information entries they identify are
25 described in Chapters 3, 4 and 5.
27 % These each need to link to definition page: FIXME
33 \autocols[0pt]{c}{2}{l}{
34 \DWTAGaccessdeclaration,
39 \DWTAGcallsiteparameter,
44 \DWTAGcommoninclusion,
52 \DWTAGenumerationtype,
55 \DWTAGformalparameter,
57 \DWTAGgenericsubrange,
58 \DWTAGimporteddeclaration,
62 \DWTAGinlinedsubroutine,
74 \DWTAGptrtomembertype,
77 \DWTAGrvaluereferencetype,
86 \DWTAGtemplatetypeparameter,
87 \DWTAGtemplatevalueparameter,
93 \DWTAGunspecifiedparameters,
94 \DWTAGunspecifiedtype,
105 \textit{The debugging information entry descriptions
106 in Sections 3, 4 and 5 generally include mention of
107 most, but not necessarily all, of the attributes
108 that are normally or possibly used with the entry.
109 Some attributes, whose applicability tends to be
110 pervasive and invariant across many kinds of
111 debugging information entries, are described in
112 this section and not necessarily mentioned in all
113 contexts where they may be appropriate.
116 the \livelink{chap:declarationcoordinates}{declaration coordinates}, and
120 The debugging information entries are contained in the
121 \dotdebuginfo{} sections of an object file.
124 Optionally, debugging information may be partitioned such
125 that the majority of the debugging information can remain in
126 individual object files without being processed by the
127 linker. These debugging information entries are contained in
128 the \dotdebuginfodwo{} sections. These
129 sections may be placed in the object file but marked so that
130 the linker ignores them, or they may be placed in a separate
131 DWARF object file that resides alongside the normal object
132 file. See Section \refersec{datarep:splitdwarfobjectfiles} and
133 Appendix \refersec{app:splitdwarfobjectsinformative} for details.
135 As a further option, debugging information entries and other debugging
136 information that are the same in multiple executable or shared object files
137 may be found in a separate \addtoindex{supplementary object file} that
138 contains supplementary debug sections.
139 The executable or shared object file which contains references to
140 those debugging information entries contain a \dotdebugsup{} section
141 with information that identifies the \addtoindex{supplementary object file};
142 the supplementary object file contains a variant of this same section
143 that is used to unambiguously associate it with the referencing object.
144 See Section \refersec{datarep:dwarfsupplemetaryobjectfiles} for
147 \section{Attribute Types}
148 \label{chap:attributetypes}
149 Each attribute value is characterized by an attribute name.
150 \addtoindexx{attribute duplication}
151 No more than one attribute with a given name may appear in any
152 debugging information entry.
153 There are no limitations on the
154 \addtoindexx{attribute ordering}
155 ordering of attributes within a debugging information entry.
157 The attributes are listed in Table \referfol{tab:attributenames}.
159 \setlength{\extrarowheight}{0.1cm}
160 \addtoindexx{attributes!list of}
161 \begin{longtable}{l|p{9cm}}
162 \caption{Attribute names} \label{tab:attributenames} \\
163 \hline \bfseries Attribute&\bfseries Identifies or Specifies \\ \hline
165 \bfseries Attribute&\bfseries Identifies or Specifies \\ \hline
167 \hline \emph{Continued on next page}
172 \DWATabstractoriginTARG
173 &\livelinki{chap:DWATabstractorigininlineinstance}
174 {Inline instances of inline subprograms}
175 {inline instances of inline subprograms} \\
176 % Heren livelink we cannot use \dash or \dash{}.
177 &\livelinki{chap:DWATabstractoriginoutoflineinstance}
178 {Out-of-line instances of inline subprograms}
179 {out-of-line instances of inline subprograms} \\
180 \DWATaccessibilityTARG
181 &\livelink{chap:DWATaccessibilitycandadadeclarations}
182 {Accessibility of declarations} (\addtoindex{C++}, \addtoindex{Ada}) \\
183 &\livelink{chap:DWATaccessibilitycppbaseclasses}
184 {Accessibility of base classes} (\addtoindex{C++}) \\
185 &\livelink{chap:DWATaccessibilitycppinheritedmembers}
186 {Accessibility of inherited members} (\addtoindex{C++}) \\
187 \DWATaddressclassTARG
188 &\livelinki{chap:DWATadressclasspointerorreferencetypes}
189 {Pointer or reference types}
190 {pointer or reference types} \\
191 &\livelinki{chap:DWATaddressclasssubroutineorsubroutinetype}
192 {Subroutine or subroutine type}
193 {subroutine or subroutine type} \\
195 &\livelinki{chap:DWATaddrbaseforaddresstable}{Base offset for address table}{address table} \\
197 &\livelinki{chap:DWATalignmentnondefault}
198 {Non-default alignment of type, subprogram or variable}
199 {non-default alignment} \addtoindexx{alignment!non-default} \\
201 &\livelinki{chap:DWATallocatedallocationstatusoftypes}
202 {Allocation status of types}
203 {allocation status of types} \\
205 &\livelinki{chap:DWATartificialobjectsortypesthat}
206 {Objects or types that are not actually declared in the source}
207 {objects or types that are not actually declared in the source} \\
208 \DWATassociatedTARG{}
209 &\livelinki{chap:DWATassociatedassociationstatusoftypes}
210 {Association status of types}
211 {association status of types} \\
213 &\livelinki{chap:DWATbasetypesprimitivedatatypesofcompilationunit}
214 {Primitive data types of compilation unit}
215 {primitive data types of compilation unit} \\
216 \DWATbinaryscaleTARG{}
217 &\livelinki{chap:DWATbinaryscalebinaryscalefactorforfixedpointtype}
218 {Binary scale factor for fixed-point type}
219 {binary scale factor for fixed-point type} \\
220 %\DWATbitoffsetTARG{}
221 %&\livelinki{chap:DWATbitoffsetbasetypebitlocation}{Base type bit location}{base type bit location} \\
222 %&\livelinki{chap:DWATbitoffsetdatamemberbitlocation}{Data member bit location}{data member bit location} \\
224 &\livelinki{chap:DWATbitsizebasetypebitsize}{Size of a base in bits}{base type bit size} \\
225 &\livelinki{chap:DWATbitsizedatamemberbitsize}{Size of a data member in bits}{data member bit size} \\
227 &\livelinki{chap:DWATbitstridearrayelementstrideofarraytype}
228 {Array element stride (of array type)}
229 {array element stride (of array type)} \\
230 &\livelinki{chap:DWATbitstridesubrangestridedimensionofarraytype}
231 {Subrange stride (dimension of array type)}
232 {subrange stride (dimension of array type)} \\
233 &\livelinki{chap:DWATbitstrideenumerationstridedimensionofarraytype}
234 {Enumeration stride (dimension of array type)}
235 {enumeration stride (dimension of array type)} \\
237 &\livelinki{chap:DWATbytesizedataobjectordatatypesize}
238 {Size of a data object or data type in bytes}
239 {data object or data type size} \\
240 \DWATbytestrideTARG{}
241 &\livelinki{chap:DWATbytestridearrayelementstrideofarraytype}
242 {Array element stride (of array type)}
243 {array element stride (of array type)} \\
244 &\livelinki{chap:DWATbytestridesubrangestridedimensionofarraytype}
245 {Subrange stride (dimension of array type)}
246 {subrange stride (dimension of array type)} \\
247 &\livelinki{chap:DWATbytestrideenumerationstridedimensionofarraytype}
248 {Enumeration stride (dimension of array type)}
249 {enumeration stride (dimension of array type)} \\
250 \DWATcallallcallsTARG{}
251 &\livelinki{chap:DWATcallallcallsofasubprogram}
252 {All tail and normal calls in a subprogram are described by call site entries}
253 {all tail and normal calls are described}
254 \index{call site!summary!all tail and normal calls are described} \\
255 \DWATcallallsourcecallsTARG{}
256 &\livelinki{chap:DWATcallallsourcecallsofasubprogram}
257 {All tail, normal and inlined calls in a subprogram are described by call site and inlined subprogram entries}
258 {all tail, normal and inlined calls are described}
259 \index{call site!summary!all tail, normal and inlined calls are described} \\
260 \DWATcallalltailcallsTARG{}
261 &\livelinki{chap:DWATcallalltailcallsofasubprogram}
262 {All tail calls in a subprogram are described by call site entries}
263 {all tail calls are described}
264 \index{call site!summary!all tail calls are described} \\
265 \DWATcallcolumnTARG{}
266 &\livelinki{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}
267 {Column position of inlined subroutine call}
268 {column position of inlined subroutine call} \\
269 \DWATcalldatalocationTARG{}
270 &\livelinki{chap:DWATcalldatalocationofcallparameter}
271 {Address of the value pointed to by an argument passed in a call}
272 {address of the value pointed to by an argument}
273 \index{call site!address of the value pointed to by an argument} \\
274 \DWATcalldatavalueTARG{}
275 &\livelinki{chap:DWATcalldatavalueofcallparameter}
276 {Value pointed to by an argument passed in a call}
277 {value pointed to by an argument}
278 \index{call site!value pointed to by an argument} \\
280 &\livelinki{chap:DWATcallfilefilecontaininginlinedsubroutinecall}
281 {File containing inlined subroutine call}
282 {file containing inlined subroutine call} \\
284 &\livelinki{chap:DWATcalllinelinenumberofinlinedsubroutinecall}
285 {Line number of inlined subroutine call}
286 {line number of inlined subroutine call} \\
287 \DWATcallingconventionTARG{}
288 &\livelinki{chap:DWATcallingconventionforsubprograms}
289 {Calling convention for subprograms}
290 {Calling convention!for subprograms} \\
291 &\livelinki{chap:DWATcallingconventionfortypes}
292 {Calling convention for types}
293 {Calling convention!for types} \\
294 \DWATcalloriginTARG{}
295 &\livelinki{chap:DWATcalloriginofcallsite}
296 {Subprogram called in a call}
298 \index{call site!subprogram called} \\
299 \DWATcallparameterTARG{}
300 &\livelinki{chap:DWATcallparameterofcallparameter}
301 {Parameter entry in a call}
303 \index{call site!parameter entry} \\
305 &\livelinki{chap:DWATcallpcofcallsite}
306 {Address of the call instruction in a call}
307 {address of call instruction}
308 \index{call site!address of the call instruction} \\
309 \DWATcallreturnpcTARG{}
310 &\livelinki{chap:DWATcallreturnpcofcallsite}
311 {Return address from a call}
312 {return address from a call}
313 \index{call site!return address} \\
314 \DWATcalltailcallTARG{}
315 &\livelinki{chap:DWATcalltailcallofcallsite}
316 {Call is a tail call}
317 {call is a tail call}
318 \index{call site!tail call} \\
319 \DWATcalltargetTARG{}
320 &\livelinki{chap:DWATcalltargetofcallsite}
321 {Address of called routine in a call}
322 {address of called routine}
323 \index{call site!address of called routine} \\
324 \DWATcalltargetclobberedTARG{}
325 &\livelinki{chap:DWATcalltargetclobberedofcallsite}
326 {Address of called routine, which may be clobbered, in a call}
327 {address of called routine, which may be clobbered}
328 \index{call site!address of called routine, which may be clobbered} \\
330 &\livelinki{chap:DWATcallvalueofcallparameter}
331 {Argument value passed in a call}
332 {argument value passed}
333 \index{call site!argument value passed} \\
334 \DWATcommonreferenceTARG
335 &\livelinki{chap:commonreferencecommonblockusage}{Common block usage}{common block usage} \\
337 &\livelinki{chap:DWATcompdircompilationdirectory}{Compilation directory}{compilation directory} \\
339 &\livelinki{chap:DWATconstvalueconstantobject}{Constant object}{constant object} \\
340 &\livelinki{chap:DWATconstvalueenumerationliteralvalue}{Enumeration literal value}{enumeration literal value} \\
341 &\livelinki{chap:DWATconstvaluetemplatevalueparameter}{Template value parameter}{template value parameter} \\
343 &\livelinki{chap:DWATconstexprcompiletimeconstantobject}
344 {Compile-time constant object}
345 {compile-time constant object} \\
346 &\livelinki{chap:DWATconstexprcompiletimeconstantfunction}
347 {Compile-time constant function}
348 {compile-time constant function} \\
349 \DWATcontainingtypeTARG
350 &\livelinki{chap:DWATcontainingtypecontainingtypeofpointertomembertype}
351 {Containing type of pointer to member type}
352 {containing type of pointer to member type} \\
354 &\livelinki{chap:DWATcountelementsofsubrangetype}{Elements of subrange type}{elements of breg subrange type} \\
355 \DWATdatabitoffsetTARG
356 &\livelinki{chap:DWATdatabitoffsetbasetypebitlocation}{Base type bit location}{base type bit location} \\
357 &\livelinki{chap:DWATdatabitoffsetdatamemberbitlocation}{Data member bit location}{data member bit location} \\
358 \DWATdatalocationTARG{}
359 &\livelinki{chap:DWATdatalocationindirectiontoactualdata}{Indirection to actual data}{indirection to actual data} \\
360 \DWATdatamemberlocationTARG
361 &\livelinki{chap:DWATdatamemberlocationdatamemberlocation}{Data member location}{data member location} \\
362 &\livelinki{chap:DWATdatamemberlocationinheritedmemberlocation}{Inherited member location}{inherited member location} \\
363 \DWATdecimalscaleTARG
364 &\livelinki{chap:DWATdecimalscaledecimalscalefactor}{Decimal scale factor}{decimal scale factor} \\
366 &\livelinki{chap:DWATdecimalsigndecimalsignrepresentation}{Decimal sign representation}{decimal sign representation} \\
368 &\livelinki{chap:DWATdeclcolumncolumnpositionofsourcedeclaration}
369 {Column position of source declaration}
370 {column position of source declaration} \\
372 &\livelinki{chap:DWATdeclfilefilecontainingsourcedeclaration}
373 {File containing source declaration}
374 {file containing source declaration} \\
376 &\livelinki{chap:DWATdecllinelinenumberofsourcedeclaration}
377 {Line number of source declaration}
378 {line number of source declaration} \\
380 &\livelinki{chap:DWATdeclarationincompletenondefiningorseparateentitydeclaration}
381 {Incomplete, non-defining, or separate entity declaration}
382 {incomplete, non-defining, or separate entity declaration} \\
384 &\livelinki{chap:DWATdefaulteddef}{Whether a member function has been declared as default}{defaulted attribute} \\
385 \DWATdefaultvalueTARG
386 &\livelinki{chap:DWATdefaultvaluedefaultvalueofparameter}{Default value of parameter}{default value of parameter} \\
388 &\livelinki{chap:DWATdeleteddef}{Whether a member has been declared as deleted}{Deletion of member function} \\
389 \DWATdescriptionTARG{}
390 &\livelinki{chap:DWATdescriptionartificialnameordescription}
391 {Artificial name or description}
392 {artificial name or description} \\
394 &\livelinki{chap:DWATdigitcountdigitcountforpackeddecimalornumericstringtype}
395 {Digit count for packed decimal or numeric string type}
396 {digit count for packed decimal or numeric string type} \\
398 &\livelinki{chap:DWATdiscrdiscriminantofvariantpart}{Discriminant of variant part}{discriminant of variant part} \\
400 &\livelinki{chap:DWATdiscrlistlistofdiscriminantvalues}{List of discriminant values}{list of discriminant values} \\
402 &\livelinki{chap:DWATdiscrvaluediscriminantvalue}{Discriminant value}{discriminant value} \\
404 &\livelinki{chap:DWATdwoidforunit}{Signature for compilation unit}{split DWARF object file!unit signature} \\
406 &\livelinki{chap:DWATdwonameforunit}{Name of split DWARF object file}{split DWARF object file!object file name} \\
408 &\livelinki{chap:DWATelementalelementalpropertyofasubroutine}
409 {Elemental property of a subroutine}
410 {elemental property of a subroutine} \\
412 &\livelinki{chap:DWATencodingencodingofbasetype}{Encoding of base type}{encoding of base type} \\
414 &\livelinki{chap:DWATendianityendianityofdata}{Endianity of data}{endianity of data} \\
416 &\livelinki{chap:entryaddressofscope}{Entry address of a scope (compilation unit, \mbox{subprogram,} and so on)}{} \\
418 &\livelinki{chap:DWATenumclasstypesafeenumerationdefinition}
419 {Type safe enumeration definition}
420 {type safe enumeration definition}\\
422 &\livelinki{chap:DWATexplicitexplicitpropertyofmemberfunction}
423 {Explicit property of member function}
424 {explicit property of member function}\\
425 \DWATexportsymbolsTARG
426 &\livelinki{chap:DWATexportsymbolsofnamespace}
427 {Export (inline) symbols of namespace}
428 {export symbols of a namespace} \\
429 &\livelinki{chap:DWATexportsymbolsofstructunionclass}
430 {Export symbols of a structure, union or class}
431 {export symbols of a structure, union or class} \\
433 &\livelinki{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}
434 {Previous namespace extension or original namespace}
435 {previous namespace extension or original namespace}\\
437 &\livelinki{chap:DWATexternalexternalsubroutine}{External subroutine}{external subroutine} \\
438 &\livelinki{chap:DWATexternalexternalvariable}{External variable}{external variable} \\
440 &\livelinki{chap:DWATframebasesubroutineframebaseaddress}{Subroutine frame base address}{subroutine frame base address} \\
442 &\livelinki{chap:DWATfriendfriendrelationship}{Friend relationship}{friend relationship} \\
444 &\livelinki{chap:DWAThighpccontiguousrangeofcodeaddresses}
445 {Contiguous range of code addresses}
446 {contiguous range of code addresses} \\
447 \DWATidentifiercaseTARG
448 &\livelinki{chap:DWATidentifiercaseidentifiercaserule}{Identifier case rule}{identifier case rule} \\
450 &\livelinki{chap:DWATimportimporteddeclaration}{Imported declaration}{imported declaration} \\
451 &\livelinki{chap:DWATimportimportedunit}{Imported unit}{imported unit} \\
452 &\livelinki{chap:DWATimportnamespacealias}{Namespace alias}{namespace alias} \\
453 &\livelinki{chap:DWATimportnamespaceusingdeclaration}{Namespace using declaration}{namespace using declaration} \\
454 &\livelinki{chap:DWATimportnamespaceusingdirective}{Namespace using directive}{namespace using directive} \\
456 &\livelinki{chap:DWATinlineabstracttinstance}{Abstract instance}{abstract instance} \\
457 &\livelinki{chap:DWATinlineinlinedsubroutine}{Inlined subroutine}{inlined subroutine} \\
459 &\livelinki{chap:DWATisoptionaloptionalparameter}{Optional parameter}{optional parameter} \\
461 &\livelinki{chap:DWATlanguageprogramminglanguage}{Programming language}{programming language} \\
463 &\livelinki{chap:DWATlinkagenameobjectfilelinkagenameofanentity}
464 {Object file linkage name of an entity}
465 {object file linkage name of an entity}\\
467 &\livelinki{chap:DWATlocationdataobjectlocation}{Data object location}{data object location}\\
469 &\livelinki{chap:DWATlowpccodeaddressorrangeofaddresses}
470 {Code address or range of addresses}
471 {code address or range of addresses}\\
473 &\livelinki{chap:DWATlowerboundlowerboundofsubrange}{Lower bound of subrange}{lower bound of subrange} \\
475 &\livelinki{chap:DWATmacroinfomacroinformation}
476 {Macro preprocessor information (legacy)}
477 {macro preprocessor information (legacy)} \\
478 & \textit{(reserved for coexistence with \DWARFVersionIV{} and earlier)} \\
480 &\livelinki{chap:DWATmacrosmacroinformation}
481 {Macro preprocessor information}
482 {macro preprocessor information} \\
483 & \textit{(\texttt{\#define}, \texttt{\#undef}, and so on in \addtoindex{C},
484 \addtoindex{C++} and similar languages)} \\
485 \DWATmainsubprogramTARG
486 &\livelinki{chap:DWATmainsubprogrammainorstartingsubprogram}{Main or starting subprogram}{main or starting subprogram} \\
487 &\livelinki{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}
488 {Unit containing main or starting subprogram}
489 {unit containing main or starting subprogram}\\
491 &\livelinki{chap:DWATmutablemutablepropertyofmemberdata}
492 {Mutable property of member data}
493 {mutable property of member data} \\
495 &\livelinki{chap:DWATnamenameofdeclaration}{Name of declaration}{name of declaration}\\
496 &\livelinki{chap:DWATnamepathnameofcompilationsource}{Path name of compilation source}{path name of compilation source} \\
497 \DWATnamelistitemTARG
498 &\livelinki{chap:DWATnamelistitemnamelistitem}{Namelist item}{namelist item}\\
500 &\livelinki{chap:DWATnoreturnofsubprogram}{\doublequote{no return} property of a subprogram}{noreturn attribute} \\
501 \DWATobjectpointerTARG
502 &\livelinki{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}
503 {Object (\texttt{this}, \texttt{self}) pointer of member function}
504 {object (\texttt{this}, \texttt{self}) pointer of member function}\\
506 &\livelinki{chap:DWATorderingarrayrowcolumnordering}{Array row/column ordering} {array row/column ordering}\\
507 \DWATpicturestringTARG
508 &\livelinki{chap:DWATpicturestringpicturestringfornumericstringtype}
509 {Picture string for numeric string type}
510 {picture string for numeric string type} \\
512 &\livelinki{chap:DWATprioritymodulepriority}{Module priority}{module priority}\\
514 &\livelinki{chap:DWATproducercompileridentification}{Compiler identification}{compiler identification}\\
516 &\livelinki{chap:DWATprototypedsubroutineprototype}{Subroutine prototype}{subroutine prototype}\\
518 &\livelinki{chap:DWATpurepurepropertyofasubroutine}{Pure property of a subroutine}{pure property of a subroutine} \\
520 &\livelinki{chap:DWATrangesnoncontiguousrangeofcodeaddresses}
521 {Non-contiguous range of code addresses}
522 {non-contiguous range of code addresses} \\
524 &\livelinki{chap:DWATrangesbaseforrangelists}{Base offset for range lists}{ranges lists} \\
526 &\livelinki{chap:DWATrankofdynamicarray}{Dynamic number of array dimensions}{dynamic number of array dimensions} \\
528 &\livelinki{chap:DWATrecursiverecursivepropertyofasubroutine}
529 {Recursive property of a subroutine}
530 {recursive property of a subroutine} \\
532 &\livelink{chap:DWATreferenceofnonstaticmember}
533 {\&-qualified non-static member function} \textit{(\addtoindex{C++})} \\
535 &\livelinki{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}
536 {Subroutine return address save location}
537 {subroutine return address save location} \\
538 \DWATrvaluereferenceTARG
539 &\livelink{chap:DWATrvaluereferenceofnonstaticmember}
540 {\&\&-qualified non-static member function} \textit{(\addtoindex{C++})} \\
543 &\livelinki{chap:DWATsegmentaddressinginformation}{Addressing information}{addressing information} \\
545 &\livelinki{chap:DWATsiblingdebugginginformationentryrelationship}
546 {Debugging information entry relationship}
547 {debugging information entry relationship} \\
549 &\livelinki{chap:DWATsmallscalefactorforfixedpointtype}
550 {Scale factor for fixed-point type}
551 {scale factor for fixed-point type} \\
553 &\livelinki{chap:DWATsignaturetypesignature}
556 \DWATspecificationTARG
557 &\livelinki{chap:DWATspecificationincompletenondefiningorseparatedeclaration}
558 {Incomplete, non-defining, or separate declaration corresponding to a declaration}
559 {incomplete, non-defining, or separate declaration corresponding to a declaration} \\
561 &\livelinki{chap:DWATstartscopeobjectdeclaration}{Object declaration}{object declaration}\\*
562 &\livelinki{chap:DWATstartscopetypedeclaration}{Type declaration}{type declaration}\\
564 &\livelinki{chap:DWATstaticlinklocationofuplevelframe}{Location of uplevel frame}{location of uplevel frame} \\
566 &\livelinki{chap:DWATstmtlistlinenumberinformationforunit}
567 {Line number information for unit}
568 {line number information for unit}\\
569 \DWATstringlengthTARG
570 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
571 {String length of string type}
572 {string length of string type} \\
573 \DWATstringlengthbitsizeTARG
574 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
575 {Size of string length of string type}
576 {string length of string type!size of} \\
577 \DWATstringlengthbytesizeTARG
578 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
579 {Size of string length of string type}
580 {string length of string type!size of} \\
581 \DWATstroffsetsbaseTARG
582 &\livelinki{chap:DWATstroffsetbaseforindirectstringtable}{Base of string offsets table}{string offsets table} \\
583 \DWATthreadsscaledTARG
584 &\livelink{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}{UPC array bound THREADS scale factor}\\
586 &\livelinki{chap:DWATtrampolinetargetsubroutine}{Target subroutine}{target subroutine of trampoline} \\
588 &\livelinki{chap:DWATtypeofcallsite}{Type of call site}{type!of call site} \\
589 &\livelinki{char:DWAATtypeofstringtype}{Type of string type components}{type!of string type components} \\
590 &\livelinki{chap:DWATtypetypeofsubroutinereturn}{Type of subroutine return}{type!of subroutine return} \\
591 &\livelinki{chap:DWATtypetypeofdeclaration}{Type of declaration}{type!of declaration} \\
593 &\livelinki{chap:DWATupperboundupperboundofsubrange}{Upper bound of subrange}{upper bound of subrange} \\
595 &\livelinki{chap:DWATuselocationmemberlocationforpointertomembertype}
596 {Member location for pointer to member type}
597 {member location for pointer to member type} \\
598 \DWATuseUTFeightTARG\addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
599 &\livelinki{chap:DWATuseUTF8compilationunitusesutf8strings}
600 {Compilation unit uses UTF-8 strings}
601 {compilation unit uses UTF-8 strings} \\
602 \DWATvariableparameterTARG
603 &\livelinki{chap:DWATvariableparameternonconstantparameterflag}
604 {Non-constant parameter flag}
605 {non-constant parameter flag} \\
607 &\livelinki{chap:DWATvirtualityvirtualityindication}{Virtuality indication}{virtuality indication} \\
608 &\livelinki{chap:DWATvirtualityvirtualityofbaseclass}{Virtuality of base class} {virtuality of base class} \\
609 &\livelinki{chap:DWATvirtualityvirtualityoffunction}{Virtuality of function}{virtuality of function} \\
611 &\livelinki{chap:DWATvisibilityvisibilityofdeclaration}{Visibility of declaration}{visibility of declaration} \\
612 \DWATvtableelemlocationTARG
613 &\livelinki{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}
614 {Virtual function vtable slot}
615 {virtual function vtable slot}\\
618 \addtoindexx{address|see {\textit{also} address class}}
619 \addtoindexx{addrptr|see {\textit{also} addrptr class}}
620 \addtoindexx{block|see {\textit{also} block class}}
621 \addtoindexx{constant|see {\textit{also} constant class}}
622 \addtoindexx{exprloc|see {\textit{also} exprloc class}}
623 \addtoindexx{flag|see {\textit{also} flag class}}
624 \addtoindexx{lineptr|see {\textit{also} lineptr class}}
625 \addtoindexx{loclistptr|see {\textit{also} loclistptr class}}
626 \addtoindexx{macptr|see {\textit{also} macptr class}}
627 \addtoindexx{rangelistptr|see {\textit{also} rangelistptr class}}
628 \addtoindexx{reference|see {\textit{also} reference class}}
629 \addtoindexx{string|see {\textit{also} string class}}
630 \addtoindexx{stroffsetsptr|see {\textit{also} stroffsetsptr class}}
632 \addtoindexx{class of attribute value!address|see {address class}}
633 \addtoindexx{class of attribute value!addrptr|see {addrptr class}}
634 \addtoindexx{class of attribute value!block|see {block class}}
635 \addtoindexx{class of attribute value!constant|see {constant class}}
636 \addtoindexx{class of attribute value!exprloc|see {exprloc class}}
637 \addtoindexx{class of attribute value!flag|see {flag class}}
638 \addtoindexx{class of attribute value!lineptr|see {lineptr class}}
639 \addtoindexx{class of attribute value!loclistptr|see {loclistptr class}}
640 \addtoindexx{class of attribute value!macptr|see {macptr class}}
641 \addtoindexx{class of attribute value!rangelistptr|see {rangelistptr class}}
642 \addtoindexx{class of attribute value!reference|see {reference class}}
643 \addtoindexx{class of attribute value!string|see {string class}}
644 \addtoindexx{class of attribute value!stroffsetsptr|see {stroffsetsptr class}}
646 The permissible values
647 \addtoindexx{attribute value classes}
648 for an attribute belong to one or more classes of attribute
650 Each form class may be represented in one or more ways.
651 For example, some attribute values consist
652 of a single piece of constant data.
653 \doublequote{Constant data}
654 is the class of attribute value that those attributes may have.
655 There are several representations of constant data,
656 however (one, two, four, or eight bytes, and variable length
658 The particular representation for any given instance
659 of an attribute is encoded along with the attribute name as
660 part of the information that guides the interpretation of a
661 debugging information entry.
664 Attribute value forms belong
665 \addtoindexx{tag names!list of}
666 to one of the classes shown in Table \referfol{tab:classesofattributevalue}.
668 \begin{longtable}{l|p{11cm}}
669 \caption{Classes of attribute value}
670 \label{tab:classesofattributevalue} \\
671 \hline \bfseries Attribute Class & \bfseries General Use and Encoding \\ \hline
673 \bfseries Attribute Class & \bfseries General Use and Encoding \\ \hline
675 \hline \emph{Continued on next page}
680 \hypertarget{chap:classaddress}{}
681 \livelinki{datarep:classaddress}{address}{address class}
682 &Refers to some location in the address space of the \mbox{described} program.
685 \hypertarget{chap:classaddrptr}{}
686 \livelinki{datarep:classaddrptr}{addrptr}{addrptr class}
687 &Refers to a base location in the DWARF section that holds
688 a series of machine address values. Certain attributes \mbox{refer}
689 one of these addresses by indexing relative to this base
693 \hypertarget{chap:classblock}{}
694 \livelinki{datarep:classblock}{block}{block class}
695 & An arbitrary number of uninterpreted bytes of data.
698 \hypertarget{chap:classconstant}{}
699 \livelinki{datarep:classconstant}{constant}{constant class}
700 &One, two, four or eight bytes of uninterpreted data, or data
701 encoded in the variable length format known as LEB128
702 (see Section \refersec{datarep:variablelengthdata}).
704 \textit{Most constant values are integers of one kind or
705 another (codes, offsets, counts, and so on); these are
706 sometimes called \doublequote{integer constants} for emphasis.}
707 \addtoindexx{integer constant}
708 \addtoindexx{constant class!integer}
711 \hypertarget{chap:classexprloc}{}
712 \livelinki{datarep:classexprloc}{exprloc}{exprloc class}
713 &A DWARF expression for a value or a location in the \mbox{address} space of the described program.
716 \hypertarget{chap:classflag}{}
717 \livelinki{datarep:classflag}{flag}{flag class}
718 &A small constant that indicates the presence or absence of an attribute.
721 \hypertarget{chap:classlineptr}{}
722 \livelinki{datarep:classlineptr}{lineptr}{lineptr class}
723 &Refers to a location in the DWARF section that holds line number information.
726 \hypertarget{chap:classloclistptr}{}
727 \livelinki{datarep:classloclistptr}{loclistptr}{loclistptr class}
728 &Refers to a location in the DWARF section that holds \mbox{location} lists, which
729 describe objects whose location can change during their lifetime.
732 \hypertarget{chap:classmacptr}{}
733 \livelinki{datarep:classmacptr}{macptr}{macptr class}
734 & Refers to a location in the DWARF section that holds macro definition
738 \hypertarget{chap:classrangelistptr}{}
739 \livelinki{datarep:classrangelistptr}{rangelistptr}{rangelistptr class}
740 & Refers to a location in the DWARF section that holds non\dash contiguous address ranges.
743 \hypertarget{chap:classreference}{}
744 \livelinki{datarep:classreference}{reference}{reference class}
745 & Refers to one of the debugging information
746 entries that \mbox{describe} the program. There are four types of
747 \mbox{reference}. The first is an offset relative to the beginning
748 of the \mbox{compilation} unit in which the reference occurs and must
749 refer to an entry within that same compilation unit. The second
750 type of reference is the offset of a debugging \mbox{information}
751 entry in any compilation unit, including one different from
752 the unit containing the reference. The third type of reference
753 is an indirect reference to a
754 \addtoindexx{type signature}
755 type definition using a 64-bit \mbox{signature}
756 for that type. The fourth type of reference is a reference from within the
757 \dotdebuginfo{} section of the executable or shared object file to
758 a debugging information entry in the \dotdebuginfo{} section of
759 a \addtoindex{supplementary object file}.
762 \hypertarget{chap:classstring}{}
763 \livelinki{datarep:classstring}{string}{string class}
764 & A null\dash terminated sequence of zero or more
765 (non\dash null) bytes. Data in this class are generally
766 printable strings. Strings may be represented directly in
767 the debugging \mbox{information} entry or as an offset in a separate
771 \hypertarget{chap:classstroffsetsptr}{}
772 \livelinki{datarep:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class}
773 &Refers to a base location in the DWARF section that holds
774 a series of offsets in the DWARF section that holds strings.
775 Certain attributes refer one of these offsets by indexing
776 \mbox{relative} to this base location. The resulting offset is then
777 used to index into the DWARF string section.
784 \section{Relationship of Debugging Information Entries}
785 \label{chap:relationshipofdebugginginformationentries}
787 A variety of needs can be met by permitting a single
788 \addtoindexx{debugging information entry!ownership relation}
789 debugging information entry to \doublequote{own} an arbitrary number
790 of other debugging entries and by permitting the same debugging
791 information entry to be one of many owned by another debugging
793 This makes it possible, for example, to
794 describe the static \livelink{chap:lexicalblock}{block} structure
795 within a source file,
796 to show the members of a structure, union, or class, and to
797 associate declarations with source files or source files
798 with shared object files.
802 The ownership relation
803 \addtoindexx{debugging information entry!ownership relation}
805 information entries is achieved naturally because the debugging
806 information is represented as a tree.
807 The nodes of the tree
808 are the debugging information entries themselves.
810 entries of any node are exactly those debugging information
811 entries owned by that node.
814 While the ownership relation
815 of the debugging information entries is represented as a
816 tree, other relations among the entries exist, for example,
817 a reference from an entry representing a variable to another
818 entry representing the type of that variable.
820 relations are taken into account, the debugging entries
821 form a graph, not a tree.
825 The tree itself is represented
826 by flattening it in prefix order.
827 Each debugging information
828 entry is defined either to have child entries or not to have
829 child entries (see Section \refersec{datarep:abbreviationstables}).
830 If an entry is defined not
831 to have children, the next physically succeeding entry is a
833 If an entry is defined to have children, the next
834 physically succeeding entry is its first child.
836 children are represented as siblings of the first child.
837 A chain of sibling entries is terminated by a null entry.
839 In cases where a producer of debugging information feels that
840 \hypertarget{chap:DWATsiblingdebugginginformationentryrelationship}{}
841 it will be important for consumers of that information to
842 quickly scan chains of sibling entries, while ignoring the
843 children of individual siblings, that producer may attach
844 \addtoindexx{sibling attribute}
846 \DWATsibling{} attribute
847 to any debugging information entry.
849 value of this attribute is a reference to the sibling entry
850 of the entry to which the attribute is attached.
853 \section{Target Addresses}
854 \label{chap:targetaddresses}
855 Many places in this document refer to the size of an
856 \addtoindexx{size of an address|see{\textit{also} \texttt{address\_size}}}
857 \addtoindexi{address}{size of an address}
858 \addtoindexx{address size|see{size of an address}}
859 \addtoindexx{address size|see{\textit{also} \texttt{address\_size}}}
860 on the target architecture (or equivalently, target machine)
861 to which a DWARF description applies. For processors which
862 can be configured to have different address sizes or different
863 instruction sets, the intent is to refer to the configuration
864 which is either the default for that processor or which is
865 specified by the object file or executable file which contains
866 the DWARF information.
869 For example, if a particular target architecture supports
870 both 32-bit and 64-bit addresses, the compiler will generate
871 an object file which specifies that it contains executable
872 code generated for one or the other of these
873 \addtoindexx{size of an address}
875 that case, the DWARF debugging information contained in this
876 object file will use the same address size.
880 Architectures which have multiple instruction sets are
881 supported by the isa entry in the line number information
882 (see Section \refersec{chap:statemachineregisters}).
885 \section{DWARF Expressions}
886 \label{chap:dwarfexpressions}
887 DWARF expressions describe how to compute a value or name a
888 location during debugging of a program.
889 They are expressed in
890 terms of DWARF operations that operate on a stack of values.
892 All DWARF operations are encoded as a stream of opcodes that
893 are each followed by zero or more literal operands.
895 of operands is determined by the opcode.
898 general operations that are defined here, operations that are
899 specific to location descriptions are defined in
900 Section \refersec{chap:locationdescriptions}.
902 \subsection{General Operations}
903 \label{chap:generaloperations}
904 Each general operation represents a postfix operation on
905 a simple stack machine.
906 Each element of the stack has a type and a value, and can represent
907 a value of any supported base type of the target machine. Instead of
908 a base type, elements can have a
909 \livetarg{chap:specialaddresstype}{special address type},
910 which is an integral type that has the
911 \addtoindex{size of an address} on the target machine and
912 unspecified signedness. The value on the top of the stack after
913 \doublequote{executing} the
914 \addtoindex{DWARF expression}
916 \addtoindexx{DWARF expression|see{\textit{also} location description}}
917 taken to be the result (the address of the object, the
918 value of the array bound, the length of a dynamic string,
919 the desired value itself, and so on).
922 \textit{While the abstract definition of the stack calls for variable-size entries
923 able to hold any supported base type, in practice it is expected that each
924 element of the stack can be represented as a fixed-size element large enough
925 to hold a value of any type supported by the DWARF consumer for that target,
926 plus a small identifier sufficient to encode the type of that element.
927 Support for base types other than what is required to do address arithmetic
928 is intended only for debugging of optimized code, and the completeness of the
929 DWARF consumer's support for the full set of base types is a
930 quality-of-implementation issue. If a consumer encounters a DWARF expression
931 that uses a type it does not support, it should ignore the entire expression
932 and report its inability to provide the requested information.}
934 \textit{It should also be noted that floating-point arithmetic is highly dependent
935 on the computational environment. It is not the intention of this expression
936 evaluation facility to produce identical results to those produced by the
937 program being debugged while executing on the target machine. Floating-point
938 computations in this stack machine will be done with precision control and
939 rounding modes as defined by the implementation.}
942 \subsubsection{Literal Encodings}
943 \label{chap:literalencodings}
945 \addtoindexx{DWARF expression!literal encodings}
946 following operations all push a value onto the DWARF
948 \addtoindexx{DWARF expression!stack operations}
949 Operations other than \DWOPconsttype{} push a value with the
950 \specialaddresstype, and if the value of a constant in one of these
951 operations is larger than can be stored in a single stack element,
952 the value is truncated to the element size and the low-order bits
953 are pushed on the stack.
954 \begin{enumerate}[1. ]
955 \itembfnl{\DWOPlitzeroTARG, \DWOPlitoneTARG, \dots, \DWOPlitthirtyoneTARG}
956 The \DWOPlitnTARG{} operations encode the unsigned literal values
957 from 0 through 31, inclusive.
959 \itembfnl{\DWOPaddrTARG}
960 The \DWOPaddrNAME{} operation has a single operand that encodes
961 a machine address and whose size is the \addtoindex{size of an address}
962 on the target machine.
964 \itembfnl{\DWOPconstoneuTARG, \DWOPconsttwouTARG, \DWOPconstfouruTARG, \DWOPconsteightuTARG}
966 The single operand of a \DWOPconstnuNAME{} operation provides a 1,
967 2, 4, or 8-byte unsigned integer constant, respectively.
969 \itembfnl{\DWOPconstonesTARG, \DWOPconsttwosTARG, \DWOPconstfoursTARG, \DWOPconsteightsTARG}
970 The single operand of a \DWOPconstnsNAME{} operation provides a 1,
971 2, 4, or 8-byte signed integer constant, respectively.
973 \itembfnl{\DWOPconstuTARG}
974 The single operand of the \DWOPconstuNAME{} operation provides
975 an unsigned LEB128\addtoindexx{LEB128!unsigned} integer constant.
977 \itembfnl{\DWOPconstsTARG}
978 The single operand of the \DWOPconstsNAME{} operation provides
979 a signed LEB128\addtoindexx{LEB128!unsigned} integer constant.
982 \itembfnl{\DWOPaddrxTARG}
983 The \DWOPaddrxNAME{} operation has a single operand that
984 encodes an unsigned LEB128\addtoindexx{LEB128!unsigned} value,
985 which is a zero-based index into the \dotdebugaddr{} section,
986 where a machine address is stored.
987 This index is relative to the value of the
988 \DWATaddrbase{} attribute of the associated compilation unit.
990 \itembfnl{\DWOPconstxTARG}
991 The \DWOPconstxNAME{} operation has a single operand that
992 encodes an unsigned LEB128\addtoindexx{LEB128!unsigned} value,
993 which is a zero-based
994 index into the \dotdebugaddr{} section, where a constant, the
995 size of a machine address, is stored.
996 This index is relative to the value of the
997 \DWATaddrbase{} attribute of the associated compilation unit.
1000 \textit{The \DWOPconstxNAME{} operation is provided for constants that
1001 require link-time relocation but should not be
1002 interpreted by the consumer as a relocatable address
1003 (for example, offsets to thread-local storage).}
1006 \itembfnl{\DWOPconsttypeTARG}
1007 The \DWOPconsttypeNAME{} operation takes three operands. The first operand
1008 is an unsigned LEB128 integer that represents the offset of a debugging
1009 information entry in the current compilation unit, which must be a
1010 \DWTAGbasetype{} entry that provides the type of the constant provided. The
1011 second operand is 1-byte unsigned integer that specifies the size of the
1012 constant value, which may not be larger than the size of the largest supported
1013 base type of the target machine. The third operand is a block of specified
1014 size that is to be interpreted as a value of the referenced type.
1016 \textit{While the size of the constant could be inferred from the base type
1017 definition, it is encoded explicitly into the expression so that the
1018 expression can be parsed easily without reference to the \dotdebuginfo{}
1024 \subsubsection{Register Values}
1025 \label{chap:registervalues}
1026 The following operations push a value onto the stack that is either the
1027 contents of a register or the result of adding the contents of a register
1028 to a given signed offset.
1029 \addtoindexx{DWARF expression!register based addressing}
1030 \DWOPregvaltype{} pushes the contents
1031 of the register together with the given base type, while the other operations
1032 push the result of adding the contents of a register to a given
1033 signed offset together with the \specialaddresstype.
1036 \begin{enumerate}[1. ]
1037 \itembfnl{\DWOPfbregTARG}
1038 The \DWOPfbregNAME{} operation provides a
1039 signed LEB128\addtoindexx{LEB128!signed} offset
1040 from the address specified by the location description in the
1041 \DWATframebase{} attribute of the current function. (This
1042 is typically a \doublequote{stack pointer} register plus or minus
1043 some offset. On more sophisticated systems it might be a
1044 location list that adjusts the offset according to changes
1045 in the stack pointer as the PC changes.)
1047 \itembfnl{\DWOPbregzeroTARG, \DWOPbregoneTARG, \dots, \DWOPbregthirtyoneTARG}
1048 The single operand of the \DWOPbregnTARG{}
1050 a signed LEB128\addtoindexx{LEB128!signed} offset from
1051 the specified register.
1053 \itembfnl{\DWOPbregxTARG}
1054 The \DWOPbregxNAME{} operation provides the sum of two values specified
1055 by its two operands. The first operand is a register number
1056 which is specified by an unsigned LEB128\addtoindexx{LEB128!unsigned}
1057 number. The second operand is a signed LEB128\addtoindexx{LEB128!signed} offset.
1060 \itembfnl{\DWOPregvaltypeTARG}
1061 The \DWOPregvaltypeNAME{} operation provides the contents of
1062 a given register interpreted as a value of a given type. The first
1063 operand is an unsigned LEB128\addtoindexx{LEB128!unsigned} number,
1064 which identifies a register whose contents is to
1065 be pushed onto the stack. The second operand is an
1066 unsigned LEB128\addtoindexx{LEB128!unsigned} number
1067 that represents the offset of a debugging information entry in the current
1068 compilation unit, which must be a \DWTAGbasetype{} entry that provides the
1069 type of the value contained in the specified register.
1074 \subsubsection{Stack Operations}
1075 \label{chap:stackoperations}
1077 \addtoindexx{DWARF expression!stack operations}
1078 operations manipulate the DWARF stack. Operations
1079 that index the stack assume that the top of the stack (most
1080 recently added entry) has index 0.
1082 The \DWOPdup{}, \DWOPdrop{}, \DWOPpick{}, \DWOPover{}, \DWOPswap{}
1083 and \DWOProt{} operations manipulate the elements of the stack as pairs
1084 consisting of the value together with its type identifier.
1085 The \DWOPderef{}, \DWOPderefsize{}, \DWOPxderef{}, \DWOPxderefsize{}
1086 and \DWOPformtlsaddress{}
1087 operations require the popped values to have an integral type, either the
1088 \specialaddresstype{} or some other integral base type, and push a
1089 value with the \specialaddresstype.
1090 \DWOPdereftype{} and \DWOPxdereftype{} operations have the
1091 same requirement on the popped values, but push a value together
1092 with the same type as the popped values.
1093 All other operations push a value together with the \specialaddresstype.
1095 \begin{enumerate}[1. ]
1096 \itembfnl{\DWOPdupTARG}
1097 The \DWOPdupNAME{} operation duplicates the value (including its
1098 type identifier) at the top of the stack.
1100 \itembfnl{\DWOPdropTARG}
1101 The \DWOPdropNAME{} operation pops the value (including its type
1102 identifier) at the top of the stack.
1104 \itembfnl{\DWOPpickTARG}
1105 The single operand of the \DWOPpickNAME{} operation provides a
1106 1-byte index. A copy of the stack entry (including its
1107 type identifier) with the specified
1108 index (0 through 255, inclusive) is pushed onto the stack.
1110 \itembfnl{\DWOPoverTARG}
1111 The \DWOPoverNAME{} operation duplicates the entry currently second
1112 in the stack at the top of the stack.
1113 This is equivalent to a
1114 \DWOPpick{} operation, with index 1.
1117 \itembfnl{\DWOPswapTARG}
1118 The \DWOPswapNAME{} operation swaps the top two stack entries.
1119 The entry at the top of the stack (including its type identifier)
1120 becomes the second stack entry, and the second entry (including
1121 its type identifier) becomes the top of the stack.
1123 \itembfnl{\DWOProtTARG}
1124 The \DWOProtNAME{} operation rotates the first three stack
1125 entries. The entry at the top of the stack (including its
1126 type identifier) becomes the third stack entry, the second
1127 entry (including its type identifier) becomes the top of
1128 the stack, and the third entry (including its type identifier)
1129 becomes the second entry.
1131 \itembfnl{\DWOPderefTARG}
1132 The \DWOPderefNAME{} operation pops the top stack entry and
1133 treats it as an address. The popped value must have an integral type.
1134 The value retrieved from that address is pushed, together with the
1135 \specialaddresstype{} identifier.
1136 The size of the data retrieved from the
1137 \addtoindexi{dereferenced}{address!dereference operator}
1138 address is the \addtoindex{size of an address} on the target machine.
1141 \itembfnl{\DWOPderefsizeTARG}
1142 The \DWOPderefsizeNAME{} operation behaves like the
1144 operation: it pops the top stack entry and treats it as an
1145 address. The popped value must have an integral type.
1146 The value retrieved from that address is pushed, together with the
1147 \specialaddresstype{} identifier. In
1148 the \DWOPderefsizeNAME{} operation, however, the size in bytes
1149 of the data retrieved from the dereferenced address is
1150 specified by the single operand. This operand is a 1-byte
1151 unsigned integral constant whose value may not be larger
1152 than the size of the \specialaddresstype. The data
1153 retrieved is zero extended to the size of an address on the
1154 target machine before being pushed onto the expression stack.
1156 \itembfnl{\DWOPdereftypeTARG}
1157 The \DWOPdereftypeNAME{} operation behaves like the \DWOPderefsize{} operation:
1158 it pops the top stack entry and treats it as an address.
1159 The popped value must have an integral type.
1160 The value retrieved from that address is pushed together with a type identifier.
1161 In the \DWOPdereftypeNAME{} operation, the size in
1162 bytes of the data retrieved from the dereferenced address is specified by
1163 the first operand. This operand is a 1-byte unsigned integral constant whose
1164 value may not be larger than the size of the largest supported base type on
1165 the target machine. The second operand is an unsigned LEB128 integer that
1166 represents the offset of a debugging information entry in the current
1167 compilation unit, which must be a \DWTAGbasetype{} entry that provides the
1168 type of the data pushed.
1171 \itembfnl{\DWOPxderefTARG}
1172 The \DWOPxderefNAME{} operation provides an extended dereference
1173 mechanism. The entry at the top of the stack is treated as an
1174 address. The second stack entry is treated as an \doublequote{address
1175 space identifier} for those architectures that support
1176 \addtoindexi{multiple}{address space!multiple}
1178 Both of these entries must have integral type identifiers.
1179 The top two stack elements are popped,
1180 and a data item is retrieved through an implementation-defined
1181 address calculation and pushed as the new stack top together with the
1182 \specialaddresstype{} identifier.
1183 The size of the data retrieved from the
1184 \addtoindexi{dereferenced}{address!dereference operator}
1185 address is the size of the \specialaddresstype.
1187 \itembfnl{\DWOPxderefsizeTARG}
1188 The \DWOPxderefsizeNAME{} operation behaves like the
1189 \DWOPxderef{} operation. The entry at the top of the stack is
1190 treated as an address. The second stack entry is treated as
1191 an \doublequote{address space identifier} for those architectures
1193 \addtoindexi{multiple}{address space!multiple}
1195 Both of these entries must have integral type identifiers.
1197 elements are popped, and a data item is retrieved through an
1198 implementation\dash defined address calculation and pushed as the
1199 new stack top. In the \DWOPxderefsizeNAME{} operation, however,
1200 the size in bytes of the data retrieved from the
1201 \addtoindexi{dereferenced}{address!dereference operator}
1202 address is specified by the single operand. This operand is a
1203 1-byte unsigned integral constant whose value may not be larger
1204 than the \addtoindex{size of an address} on the target machine. The data
1205 retrieved is zero extended to the \addtoindex{size of an address} on the
1206 target machine before being pushed onto the expression stack together
1207 with the \specialaddresstype{} identifier.
1209 \itembfnl{\DWOPxdereftypeTARG}
1210 The \DWOPxdereftypeNAME{} operation behaves like the \DWOPxderefsize{}
1211 operation: it pops the top two stack entries, treats them as an address and
1212 an address space identifier, and pushes the value retrieved. In the
1213 \DWOPxdereftypeNAME{} operation, the size in bytes of the data retrieved from
1214 the dereferenced address is specified by the first operand. This operand is
1215 a 1-byte unsigned integral constant whose value may not be larger than the
1216 size of the largest supported base type on the target machine. The second
1217 operand is an unsigned LEB128 integer that represents the offset of a
1218 debugging information entry in the current compilation unit, which must be a
1219 \DWTAGbasetype{} entry that provides the type of the data pushed.
1222 \itembfnl{\DWOPpushobjectaddressTARG}
1223 The \DWOPpushobjectaddressNAME{}
1224 operation pushes the address
1225 of the object currently being evaluated as part of evaluation
1226 of a user presented expression. This object may correspond
1227 to an independent variable described by its own debugging
1228 information entry or it may be a component of an array,
1229 structure, or class whose address has been dynamically
1230 determined by an earlier step during user expression
1233 \textit{This operator provides explicit functionality
1234 (especially for arrays involving descriptors) that is analogous
1235 to the implicit push of the base
1236 \addtoindexi{address}{address!implicit push of base}
1237 of a structure prior to evaluation of a
1238 \DWATdatamemberlocation{}
1239 to access a data member of a structure. For an example, see
1240 Appendix \refersec{app:aggregateexamples}.}
1243 \itembfnl{\DWOPformtlsaddressTARG}
1244 The \DWOPformtlsaddressNAME{}
1245 operation pops a value from the stack, which must have an
1246 integral type identifier, translates this
1247 value into an address in the
1248 \addtoindex{thread-local storage}
1249 for a thread, and pushes the address
1250 onto the stack together with the \specialaddresstype{} identifier.
1251 The meaning of the value on the top of the stack prior to this
1252 operation is defined by the run-time environment. If the run-time
1253 environment supports multiple thread-local storage
1254 \nolink{blocks} for a single thread, then the \nolink{block}
1255 corresponding to the executable or shared
1256 library containing this DWARF expression is used.
1258 \textit{Some implementations of
1259 \addtoindex{C}, \addtoindex{C++}, \addtoindex{Fortran}, and other
1260 languages, support a
1261 thread-local storage class. Variables with this storage class
1262 have distinct values and addresses in distinct threads, much
1263 as automatic variables have distinct values and addresses in
1264 each function invocation. Typically, there is a single \nolink{block}
1265 of storage containing all thread\dash local variables declared in
1266 the main executable, and a separate \nolink{block} for the variables
1267 declared in each shared library. Each
1268 thread\dash local variable can then be accessed in its block using an
1269 identifier. This identifier is typically an offset into the block and
1270 pushed onto the DWARF stack by one of the
1271 \DWOPconstnx{} operations prior to the
1272 \DWOPformtlsaddress{} operation.
1273 Computing the address of
1274 the appropriate \nolink{block} can be complex (in some cases, the
1275 compiler emits a function call to do it), and difficult
1276 to describe using ordinary DWARF location descriptions.
1277 Instead of forcing complex thread-local storage calculations into
1278 the DWARF expressions, the \DWOPformtlsaddress{} allows the consumer
1279 to perform the computation based on the run-time environment.}
1282 \itembfnl{\DWOPcallframecfaTARG}
1283 The \DWOPcallframecfaNAME{}
1284 operation pushes the value of the
1285 CFA, obtained from the Call Frame Information
1286 (see Section \refersec{chap:callframeinformation}).
1288 \textit{Although the value of \DWATframebase{}
1289 can be computed using other DWARF expression operators,
1290 in some cases this would require an extensive location list
1291 because the values of the registers used in computing the
1292 CFA change during a subroutine. If the
1293 Call Frame Information
1294 is present, then it already encodes such changes, and it is
1295 space efficient to reference that.}
1298 \textit{Examples illustrating many of these stack operations are
1299 found in Appendix \refersec{app:dwarfstackoperationexamples}.}
1301 \subsubsection{Arithmetic and Logical Operations}
1302 \addtoindexx{DWARF expression!arithmetic operations}
1303 \addtoindexx{DWARF expression!logical operations}
1304 The following provide arithmetic and logical operations. If an operation
1305 pops two values from the stack, both values must have the same type,
1306 either the same base type or both the \specialaddresstype.
1307 The result of the operation which is pushed back has the same type
1308 as the type of the operands.
1310 If the type of the operands is the \specialaddresstype,
1311 except as otherwise specified, the arithmetic operations
1312 perform addressing arithmetic, that is, unsigned arithmetic that is performed
1313 modulo one plus the largest representable address (for example, 0x100000000
1314 when the \addtoindex{size of an address} is 32 bits).
1316 Operations other than \DWOPabs{},
1317 \DWOPdiv{}, \DWOPminus{}, \DWOPmul{}, \DWOPneg{} and \DWOPplus{}
1318 require integral types of the operand (either integral base type
1319 or the \specialaddresstype). Operations do not cause an exception
1323 \begin{enumerate}[1. ]
1324 \itembfnl{\DWOPabsTARG}
1325 The \DWOPabsTARG{} operation pops the top stack entry, interprets
1326 it as a signed value and pushes its absolute value. If the
1327 absolute value cannot be represented, the result is undefined.
1330 \itembfnl{\DWOPandTARG}
1331 The \DWOPandTARG{} operation pops the top two stack values, performs
1332 a bitwise and operation on the two, and pushes the result.
1334 \itembfnl{\DWOPdivTARG}
1335 The \DWOPdivTARG{} operation pops the top two stack values, divides the former second entry by
1336 the former top of the stack using signed division, and pushes the result.
1338 \itembfnl{\DWOPminusTARG}
1339 The \DWOPminusTARG{} operation pops the top two stack values, subtracts the former top of the
1340 stack from the former second entry, and pushes the result.
1342 \itembfnl{\DWOPmodTARG}
1343 The \DWOPmodTARG{} operation pops the top two stack values and pushes the result of the
1344 calculation: former second stack entry modulo the former top of the stack.
1347 \itembfnl{\DWOPmulTARG}
1348 The \DWOPmulTARG{} operation pops the top two stack entries, multiplies them together, and
1351 \itembfnl{\DWOPnegTARG}
1352 The \DWOPnegTARG{} operation pops the top stack entry, interprets
1353 it as a signed value and pushes its negation. If the negation
1354 cannot be represented, the result is undefined.
1356 \itembfnl{\DWOPnotTARG}
1357 The \DWOPnotTARG{} operation pops the top stack entry, and pushes
1358 its bitwise complement.
1360 \itembfnl{\DWOPorTARG}
1361 The \DWOPorTARG{} operation pops the top two stack entries, performs
1362 a bitwise or operation on the two, and pushes the result.
1364 \itembfnl{\DWOPplusTARG}
1365 The \DWOPplusTARG{} operation pops the top two stack entries,
1366 adds them together, and pushes the result.
1369 \itembfnl{\DWOPplusuconstTARG}
1370 The \DWOPplusuconstTARG{} operation pops the top stack entry,
1371 adds it to the unsigned LEB128\addtoindexx{LEB128!unsigned}
1372 constant operand and pushes the result.
1374 \textit{This operation is supplied specifically to be
1375 able to encode more field offsets in two bytes than can be
1377 \doublequote{\DWOPlitn~\DWOPplus.}}
1380 \itembfnl{\DWOPshlTARG}
1381 The \DWOPshlTARG{} operation pops the top two stack entries,
1382 shifts the former second entry left (filling with zero bits)
1383 by the number of bits specified by the former top of the stack,
1384 and pushes the result.
1386 \itembfnl{\DWOPshrTARG}
1387 The \DWOPshrTARG{} operation pops the top two stack entries,
1388 shifts the former second entry right logically (filling with
1389 zero bits) by the number of bits specified by the former top
1390 of the stack, and pushes the result.
1393 \itembfnl{\DWOPshraTARG}
1394 The \DWOPshraTARG{} operation pops the top two stack entries,
1395 shifts the former second entry right arithmetically (divide
1396 the magnitude by 2, keep the same sign for the result) by
1397 the number of bits specified by the former top of the stack,
1398 and pushes the result.
1400 \itembfnl{\DWOPxorTARG}
1401 The \DWOPxorTARG{} operation pops the top two stack entries,
1402 performs a bitwise exclusive\dash or operation on the two, and
1407 \subsubsection{Control Flow Operations}
1408 \label{chap:controlflowoperations}
1410 \addtoindexx{DWARF expression!control flow operations}
1411 following operations provide simple control of the flow of a DWARF expression.
1412 \begin{enumerate}[1. ]
1413 \itembfnl{\DWOPleTARG, \DWOPgeTARG, \DWOPeqTARG, \DWOPltTARG, \DWOPgtTARG, \DWOPneTARG}
1414 The six relational operators each:
1416 \item pop the top two stack values, which should both have the same type,
1417 either the same base type or both the \specialaddresstype,
1419 \item compare the operands:
1421 \textless~former second entry~\textgreater \textless~relational operator~\textgreater \textless~former top entry~\textgreater
1423 \item push the constant value 1 onto the stack
1424 if the result of the operation is true or the
1425 constant value 0 if the result of the operation is false.
1426 The pushed value has the \specialaddresstype.
1429 If the operands have the \specialaddresstype, the comparisons
1430 are performed as signed operations.
1431 The six operators are \DWOPleNAME{} (less than or equal to), \DWOPgeNAME{}
1432 (greater than or equal to), \DWOPeqNAME{} (equal to), \DWOPltNAME{} (less
1433 than), \DWOPgtNAME{} (greater than) and \DWOPneNAME{} (not equal to).
1436 \itembfnl{\DWOPskipTARG}
1437 \DWOPskipNAME{} is an unconditional branch. Its single operand
1438 is a 2-byte signed integer constant. The 2-byte constant is
1439 the number of bytes of the DWARF expression to skip forward
1440 or backward from the current operation, beginning after the
1443 \itembfnl{\DWOPbraTARG}
1444 \DWOPbraNAME{} is a conditional branch. Its single operand is a
1445 2-byte signed integer constant. This operation pops the
1446 top of stack. If the value popped is not the constant 0,
1447 the 2-byte constant operand is the number of bytes of the
1448 DWARF expression to skip forward or backward from the current
1449 operation, beginning after the 2-byte constant.
1451 % The following item does not correctly hyphenate leading
1452 % to an overfull hbox and a visible artifact.
1453 % So we use \- to suggest hyphenation in this rare situation.
1454 \itembfnl{\DWOPcalltwoTARG, \DWOPcallfourTARG, \DWOPcallrefTARG}
1457 and \DWOPcallrefNAME{} perform
1458 DWARF procedure calls during evaluation of a DWARF expression or
1459 location description.
1460 For \DWOPcalltwoNAME{} and \DWOPcallfourNAME{},
1461 the operand is the 2\dash~ or 4-byte unsigned offset, respectively,
1462 of a debugging information entry in the current compilation
1463 unit. The \DWOPcallrefNAME{} operator has a single operand. In the
1464 \thirtytwobitdwarfformat,
1465 the operand is a 4-byte unsigned value;
1466 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1467 (see Section \referfol{datarep:32bitand64bitdwarfformats}).
1468 The operand is used as the offset of a
1469 debugging information entry in a
1471 section which may be contained in an executable or shared object file
1472 other than that containing the operator. For references from
1473 one executable or shared object file to another, the relocation
1474 must be performed by the consumer.
1476 \textit{Operand interpretation of
1477 \DWOPcalltwo, \DWOPcallfour{} and \DWOPcallref{} is exactly like
1478 that for \DWFORMreftwo, \DWFORMreffour{} and \DWFORMrefaddr,
1480 (see Section \refersec{datarep:attributeencodings}).
1483 These operations transfer
1484 control of DWARF expression evaluation to
1485 \addtoindexx{location attribute}
1488 attribute of the referenced debugging information entry. If
1489 there is no such attribute, then there is no effect. Execution
1490 of the DWARF expression of
1491 \addtoindexx{location attribute}
1493 \DWATlocation{} attribute may add
1494 to and/or remove from values on the stack. Execution returns
1495 to the point following the call when the end of the attribute
1496 is reached. Values on the stack at the time of the call may be
1497 used as parameters by the called expression and values left on
1498 the stack by the called expression may be used as return values
1499 by prior agreement between the calling and called expressions.
1502 \subsubsection{Type Conversions}
1503 \label{chap:typeconversions}
1504 The following operations provides for explicit type conversion.
1506 \begin{enumerate}[1. ]
1507 \itembfnl{\DWOPconvertTARG}
1508 The \DWOPconvertNAME{} operation pops the top stack entry, converts it to a
1509 different type, then pushes the result. It takes one operand, which is an
1510 unsigned LEB128 integer that represents the offset of a debugging
1511 information entry in the current compilation unit, or value 0 which
1512 represents the \specialaddresstype. If the operand is non-zero, the
1513 referenced entry must be a \DWTAGbasetype{} entry that provides the type
1514 to which the value is converted.
1516 \itembfnl{\DWOPreinterpretTARG}
1517 The \DWOPreinterpretNAME{} operation pops the top stack entry, reinterprets
1518 the bits in its value as a value of a different type, then pushes the
1519 result. It takes one operand, which is an unsigned LEB128 integer that
1520 represents the offset of a debugging information entry in the current
1521 compilation unit, or value 0 which represents the \specialaddresstype.
1522 If the operand is non-zero, the referenced entry must be a
1523 \DWTAGbasetype{} entry that provides the type to which the value is converted.
1524 The type of the operand and result type should have the same size in bits.
1529 \subsubsection{Special Operations}
1530 \label{chap:specialoperations}
1532 \addtoindexx{DWARF expression!special operations}
1533 are these special operations currently defined:
1534 \begin{enumerate}[1. ]
1535 \itembfnl{\DWOPnopNAME}
1536 The \DWOPnopTARG{} operation is a place holder. It has no effect
1537 on the location stack or any of its values.
1539 \itembfnl{\DWOPentryvalueNAME}
1540 The \DWOPentryvalueTARG{} operation pushes a value that had a known location
1541 upon entering the current subprogram. It has two operands: an
1542 unsigned LEB128\addtoindexx{LEB128!unsigned} length, followed by
1543 a block containing a DWARF expression or a register location description
1544 (see Section \refersec{chap:registerlocationdescriptions}).
1545 The length operand specifies the length
1546 in bytes of the block. If the block contains a register location
1547 description, \DWOPentryvalueNAME{} pushes the value that register had upon
1548 entering the current subprogram. If the block contains a DWARF expression,
1549 the DWARF expression is evaluated as if it has been evaluated upon entering
1550 the current subprogram. The DWARF expression should not assume any values
1551 being present on the DWARF stack initially and should result in exactly one
1552 value being pushed on the DWARF stack when completed. That value is the value
1553 being pushed by the \DWOPentryvalueNAME{} operation.
1555 \DWOPpushobjectaddress{} is not meaningful inside of this DWARF operation.
1557 \textit{The \DWOPentryvalueNAME{} operation can be used by consumers if they are able
1558 to find the call site in the caller function, can unwind to it, and the corresponding
1559 \DWTAGcallsiteparameter{} entry has \DWATcallvalue{} or
1560 \DWATcalldatavalue{} attributes that can be evaluated to find the
1561 value a function parameter had on the first instruction in the function.
1562 Non-interactive consumers which know what variables will need to be
1563 inspected in advance of running the debugged program could put breakpoints
1564 on the first instruction in functions where there is no way to find
1565 some variable's value other than by evaluating the \DWOPentryvalueNAME{}
1566 operation. The consumer can collect the value of registers or
1567 memory referenced in
1568 \DWOPentryvalueNAME{} operations, then continue to breakpoints where the values
1569 of variables or parameters need to be inspected and use the remembered
1570 register or memory values during \DWOPentryvalueNAME{} evaluation.}
1575 \section{Location Descriptions}
1576 \label{chap:locationdescriptions}
1577 \textit{Debugging information
1578 \addtoindexx{location description}
1580 \addtoindexx{location description|see{\textit{also} DWARF expression}}
1581 provide consumers a way to find
1582 the location of program variables, determine the bounds
1583 of dynamic arrays and strings, and possibly to find the
1584 base address of a subroutine\textquoteright s stack frame or the return
1585 address of a subroutine. Furthermore, to meet the needs of
1586 recent computer architectures and optimization techniques,
1587 debugging information must be able to describe the location of
1588 an object whose location changes over the object\textquoteright s lifetime.}
1590 Information about the location of program objects is provided
1591 by location descriptions. Location descriptions can be either
1593 \begin{enumerate}[1. ]
1594 \item \textit{Single location descriptions},
1596 \addtoindexx{location description!single}
1598 \addtoindexx{single location description}
1599 a language independent representation of
1600 addressing rules of arbitrary complexity built from
1601 DWARF expressions (See Section \refersec{chap:dwarfexpressions})
1603 DWARF operations specific to describing locations. They are
1604 sufficient for describing the location of any object as long
1605 as its lifetime is either static or the same as the
1606 \livelink{chap:lexicalblock}{lexical block} that owns it,
1607 and it does not move during its lifetime.
1609 Single location descriptions are of two kinds:
1610 \begin{enumerate}[a) ]
1611 \item Simple location descriptions, which describe the location
1612 \addtoindexx{location description!simple}
1613 of one contiguous piece (usually all) of an object. A simple
1614 location description may describe a location in addressable
1615 memory, or in a register, or the lack of a location (with or
1616 without a known value).
1618 \item Composite location descriptions, which describe an
1619 \addtoindexx{location description!composite}
1620 object in terms of pieces each of which may be contained in
1621 part of a register or stored in a memory location unrelated
1627 \item \textit{Location lists}, which are used to
1628 \addtoindexx{location list}
1630 \addtoindexx{location description!use in location list}
1631 objects that have a limited lifetime or change their location
1632 during their lifetime. Location lists are described in
1633 Section \refersec{chap:locationlists} below.
1637 Location descriptions are distinguished in a context sensitive
1638 manner. As the value of an attribute, a location description
1640 \addtoindexx{exprloc class}
1641 class \livelink{chap:classexprloc}{exprloc}
1642 and a location list is encoded
1643 using class \livelink{chap:classloclistptr}{loclistptr}
1645 \addtoindex{loclistptr}
1646 serves as an offset into a
1648 \addtoindexx{location list}
1649 location list table).
1652 \subsection{Single Location Descriptions}
1653 A single location description is either:
1654 \begin{enumerate}[1. ]
1655 \item A simple location description, representing an object
1656 \addtoindexx{location description!simple}
1658 \addtoindexx{simple location description}
1659 exists in one contiguous piece at the given location, or
1660 \item A composite location description consisting of one or more
1661 \addtoindexx{location description!composite}
1662 simple location descriptions, each of which is followed by
1663 one composition operation. Each simple location description
1664 describes the location of one piece of the object; each
1665 composition operation describes which part of the object is
1666 located there. Each simple location description that is a
1667 DWARF expression is evaluated independently of any others
1668 (as though on its own separate stack, if any).
1673 \subsubsection{Simple Location Descriptions}
1675 \addtoindexx{location description!simple}
1676 simple location description consists of one
1677 contiguous piece or all of an object or value.
1680 \subsubsubsection{Memory Location Descriptions}
1682 \addtoindexx{location description!memory}
1683 memory location description
1684 \addtoindexx{memory location description}
1685 consists of a non\dash empty DWARF
1687 Section \refersec{chap:dwarfexpressions}
1688 ), whose value is the address of
1689 a piece or all of an object or other entity in memory.
1691 \subsubsubsection{Register Location Descriptions}
1692 \label{chap:registerlocationdescriptions}
1693 A register location description consists of a register name
1694 operation, which represents a piece or all of an object
1695 located in a given register.
1697 \textit{Register location descriptions describe an object
1698 (or a piece of an object) that resides in a register, while
1699 the opcodes listed in
1700 Section \refersec{chap:registervalues}
1701 are used to describe an object (or a piece of
1702 an object) that is located in memory at an address that is
1703 contained in a register (possibly offset by some constant). A
1704 register location description must stand alone as the entire
1705 description of an object or a piece of an object.
1708 The following DWARF operations can be used to name a register.
1711 \textit{Note that the register number represents a DWARF specific
1712 mapping of numbers onto the actual registers of a given
1713 architecture. The mapping should be chosen to gain optimal
1714 density and should be shared by all users of a given
1715 architecture. It is recommended that this mapping be defined
1716 by the ABI authoring committee for each architecture.
1718 \begin{enumerate}[1. ]
1719 \itembfnl{\DWOPregzeroTARG, \DWOPregoneTARG, ..., \DWOPregthirtyoneTARG}
1720 The \DWOPregnTARG{} operations encode the names of up to 32
1721 registers, numbered from 0 through 31, inclusive. The object
1722 addressed is in register \textit{n}.
1725 \itembfnl{\DWOPregxTARG}
1726 The \DWOPregxTARG{} operation has a single
1727 unsigned LEB128\addtoindexx{LEB128!unsigned} literal
1728 operand that encodes the name of a register.
1732 \textit{These operations name a register location. To
1733 fetch the contents of a register, it is necessary to use
1734 one of the register based addressing operations, such as
1736 (Section \refersec{chap:registervalues})}.
1738 \subsubsubsection{Implicit Location Descriptions}
1739 An \addtoindex{implicit location description}
1740 represents a piece or all
1741 \addtoindexx{location description!implicit}
1742 of an object which has no actual location but whose contents
1743 are nonetheless either known or known to be undefined.
1745 The following DWARF operations may be used to specify a value
1746 that has no location in the program but is a known constant
1747 or is computed from other locations and values in the program.
1748 \begin{enumerate}[1. ]
1749 \itembfnl{\DWOPimplicitvalueTARG}
1750 The \DWOPimplicitvalueTARG{}
1751 operation specifies an immediate value
1752 using two operands: an unsigned LEB128\addtoindexx{LEB128!unsigned}
1754 %FIXME: should this block be a reference? To what?
1755 a \nolink{block} representing the value in the memory representation
1756 of the target machine. The length operand gives the length
1757 in bytes of the \nolink{block}.
1759 \itembfnl{\DWOPstackvalueTARG}
1760 The \DWOPstackvalueTARG{}
1761 operation specifies that the object
1762 does not exist in memory but its value is nonetheless known
1763 and is at the top of the DWARF expression stack. In this form
1764 of location description, the DWARF expression represents the
1765 actual value of the object, rather than its location. The
1766 \DWOPstackvalueNAME{} operation terminates the expression.
1769 \itembfnl{\DWOPimplicitpointerTARG}
1770 The \DWOPimplicitpointerNAME{} operation specifies that the object
1771 is a pointer that cannot be represented as a real pointer,
1772 even though the value it would point to can be described. In
1773 this form of location description, the DWARF expression refers
1774 to a debugging information entry that represents the actual
1775 value of the object to which the pointer would point. Thus, a
1776 consumer of the debug information would be able to show the
1777 value of the dereferenced pointer, even when it cannot show
1778 the value of the pointer itself.
1781 The \DWOPimplicitpointerNAME{} operation has two operands: a
1782 reference to a debugging information entry that describes
1783 the dereferenced object's value, and a signed number that
1784 is treated as a byte offset from the start of that value.
1785 The first operand is a 4-byte unsigned value in the 32-bit
1786 DWARF format, or an 8-byte unsigned value in the 64-bit
1787 DWARF format (see Section
1788 \refersec{datarep:32bitand64bitdwarfformats}).
1789 The second operand is a
1790 signed LEB128\addtoindexx{LEB128!signed} number.
1792 The first operand is used as the offset of a debugging
1793 information entry in a \dotdebuginfo{} section, which may be
1794 contained in an executable or shared object file other than that
1795 containing the operator. For references from one executable or
1796 shared object file to another, the relocation must be performed
1799 \textit{The debugging information entry referenced by a
1800 \DWOPimplicitpointerNAME{} operation is typically a
1801 \DWTAGvariable{} or \DWTAGformalparameter{} entry whose
1802 \DWATlocation{} attribute gives a second DWARF expression or a
1803 location list that describes the value of the object, but the
1804 referenced entry may be any entry that contains a \DWATlocation{}
1805 or \DWATconstvalue{} attribute (for example, \DWTAGdwarfprocedure).
1806 By using the second DWARF expression, a consumer can
1807 reconstruct the value of the object when asked to dereference
1808 the pointer described by the original DWARF expression
1809 containing the \DWOPimplicitpointer{} operation.}
1813 \textit{DWARF location expressions are intended to yield the \textbf{location}
1814 of a value rather than the value itself. An optimizing compiler
1815 may perform a number of code transformations where it becomes
1816 impossible to give a location for a value, but remains possible
1817 to describe the value itself.
1818 Section \refersec{chap:registerlocationdescriptions}
1819 describes operators that can be used to
1820 describe the location of a value when that value exists in a
1821 register but not in memory. The operations in this section are
1822 used to describe values that exist neither in memory nor in a
1825 \subsubsubsection{Empty Location Descriptions}
1826 An \addtoindex{empty location description}
1827 consists of a DWARF expression
1828 \addtoindexx{location description!empty}
1829 containing no operations. It represents a piece or all of an
1830 object that is present in the source but not in the object code
1831 (perhaps due to optimization).
1834 \subsubsection{Composite Location Descriptions}
1835 A composite location description describes an object or
1836 value which may be contained in part of a register or stored
1837 in more than one location. Each piece is described by a
1838 composition operation, which does not compute a value nor
1839 store any result on the DWARF stack. There may be one or
1840 more composition operations in a single composite location
1841 description. A series of such operations describes the parts
1842 of a value in memory address order.
1844 Each composition operation is immediately preceded by a simple
1845 location description which describes the location where part
1846 of the resultant value is contained.
1847 \begin{enumerate}[1. ]
1848 \itembfnl{\DWOPpieceTARG}
1849 The \DWOPpieceTARG{} operation takes a
1850 single operand, which is an
1851 unsigned LEB128\addtoindexx{LEB128!unsigned} number.
1852 The number describes the size in bytes
1853 of the piece of the object referenced by the preceding simple
1854 location description. If the piece is located in a register,
1855 but does not occupy the entire register, the placement of
1856 the piece within that register is defined by the ABI.
1858 \textit{Many compilers store a single variable in sets of registers,
1859 or store a variable partially in memory and partially in
1860 registers. \DWOPpieceNAME{} provides a way of describing how large
1861 a part of a variable a particular DWARF location description
1864 \itembfnl{\DWOPbitpieceTARG}
1865 The \DWOPbitpieceTARG{}
1866 operation takes two operands. The first
1867 is an unsigned LEB128\addtoindexx{LEB128!unsigned}
1868 number that gives the size in bits
1869 of the piece. The second is an
1870 unsigned LEB128\addtoindexx{LEB128!unsigned} number that
1871 gives the offset in bits from the location defined by the
1872 preceding DWARF location description.
1874 Interpretation of the
1875 offset depends on the kind of location description. If the
1876 location description is empty, the offset doesn\textquoteright t matter and
1877 the \DWOPbitpieceNAME{} operation describes a piece consisting
1878 of the given number of bits whose values are undefined. If
1879 the location is a register, the offset is from the least
1880 significant bit end of the register. If the location is a
1881 memory address, the \DWOPbitpieceNAME{} operation describes a
1882 sequence of bits relative to the location whose address is
1883 on the top of the DWARF stack using the bit numbering and
1884 direction conventions that are appropriate to the current
1885 language on the target system. If the location is any implicit
1886 value or stack value, the \DWOPbitpieceNAME{} operation describes
1887 a sequence of bits using the least significant bits of that
1891 \textit{\DWOPbitpieceNAME{} is
1892 used instead of \DWOPpieceNAME{} when
1893 the piece to be assembled into a value or assigned to is not
1894 byte-sized or is not at the start of a register or addressable
1898 \subsection{Location Lists}
1899 \label{chap:locationlists}
1900 There are two forms of location lists. The first form
1901 is intended for use in other than a \splitDWARFobjectfile,
1902 while the second is intended for use in a \splitDWARFobjectfile{}
1903 (see Section \refersec{datarep:splitdwarfobjectfiles}). The two
1904 forms are otherwise equivalent.
1906 \textit{The form for \splitDWARFobjectfile{s} is new in \DWARFVersionV.}
1908 \subsubsection{Location Lists in Non-split Objects}
1909 \label{chap:locationlistsinnonsplitobjects}
1911 \addtoindexx{location list}
1912 are used in place of location expressions
1913 whenever the object whose location is being described
1914 can change location during its lifetime.
1916 \addtoindexx{location list}
1917 are contained in a separate object file section called
1918 \dotdebugloc{}. A location list is indicated by a location
1919 attribute whose value is an offset from the beginning of
1920 the \dotdebugloc{} section to the first byte of the list for the
1923 The \addtoindex{applicable base address} of a normal
1924 location list entry (see following) is
1925 \addtoindexx{location list!base address selection entry}
1926 determined by the closest preceding base address selection
1927 entry in the same location list. If there is
1928 no such selection entry, then the applicable base address
1929 defaults to the base address of the compilation unit (see
1930 Section \refersec{chap:normalandpartialcompilationunitentries}).
1932 \textit{In the case of a compilation unit where all of
1933 the machine code is contained in a single contiguous section,
1934 no base address selection entry is needed.}
1936 Each entry in a location list is either a location
1937 \addtoindexi{list}{address selection|see{base address selection}}
1940 \addtoindexi{base}{base address selection entry!in location list}
1941 address selection entry,
1942 \addtoindexx{location list!base address selection entry}
1944 \addtoindexx{end-of-list entry!in location list}
1947 \subsubsubsection{Location List Entry}
1948 A location list entry has two forms:
1949 a normal location list entry and a default location list entry.
1952 \subsubsubsubsection{Normal Location List Entry}
1953 A\addtoindexx{location list!normal entry}
1954 \addtoindex{normal location list entry} consists of:
1955 \begin{enumerate}[1. ]
1956 \item A beginning address offset.
1957 This address offset has the \addtoindex{size of an address} and is
1958 relative to the applicable base address of the compilation
1959 unit referencing this location list. It marks the beginning
1961 \addtoindexi{range}{address range!in location list}
1962 over which the location is valid.
1964 \item An ending address offset. This address offset again
1965 has the \addtoindex{size of an address} and is relative to the applicable
1966 base address of the compilation unit referencing this location
1967 list. It marks the first address past the end of the address
1968 range over which the location is valid. The ending address
1969 must be greater than or equal to the beginning address.
1971 \textit{A location list entry (but not a base address selection or
1972 end-of-list entry) whose beginning
1973 and ending addresses are equal has no effect
1974 because the size of the range covered by such
1977 \item An unsigned 2-byte length describing the length of the location
1978 description that follows.
1980 \item A \addtoindex{single location description}
1981 describing the location of the object over the range specified by
1982 the beginning and end addresses.
1985 Address ranges defined by normal location list entries
1986 may overlap. When they do, they describe a
1987 situation in which an object exists simultaneously in more than
1988 one place. If all of the address ranges in a given location
1989 list do not collectively cover the entire range over which the
1990 object in question is defined, it is assumed that the object is
1991 not available for the portion of the range that is not covered.
1994 \subsubsubsubsection{Default Location List Entry}
1995 A \addtoindex{default location list entry} consists of:
1996 \addtoindexx{location list!default entry}
1997 \begin{enumerate}[1. ]
1999 \item The value of the largest representable address offset (for
2000 example, \wffffffff when the size of an address is 32 bits).
2001 \item A simple location description describing the location of the
2002 object when there is no prior normal location list entry
2003 that applies in the same location list.
2006 A default location list entry is independent of any applicable
2007 base address (except to the extent to which base addresses
2008 affect prior normal location list entries).
2010 A default location list entry must be the last location list
2011 entry of a location list except for the terminating end-of-list
2014 A \addtoindex{default location list entry} describes a simple
2015 location which applies to all addresses which are not included
2016 in any range defined earlier in the same location list.
2019 \subsubsubsection{Base Address Selection Entry}
2021 \addtoindexi{address}{address selection|see{base address selection}}
2022 \addtoindexx{location list!base address selection entry}
2024 \addtoindexi{entry}{base address selection entry!in location list}
2026 \begin{enumerate}[1. ]
2027 \item The value of the largest representable
2028 address offset (for example, \wffffffff when the size of
2029 an address is 32 bits).
2030 \item An address, which defines the
2031 appropriate base address for use in interpreting the beginning
2032 and ending address offsets of subsequent entries of the location list.
2035 \textit{A base address selection entry
2036 affects only the remainder of the list in which it is contained.}
2039 \subsubsubsection{End-of-List Entry}
2040 The end of any given location list is marked by an
2041 \addtoindexx{location list!end-of-list entry}
2042 end-of-list entry, which consists of a 0 for the beginning address
2043 offset and a 0 for the ending address offset. A location list
2045 \addtoindexx{end-of-list entry!in location list}
2046 end-of-list entry describes an object that
2047 exists in the source code but not in the executable program.
2049 Neither a base address selection entry nor an end-of-list
2050 entry includes a location description.
2053 \textit{When a DWARF consumer is parsing and decoding a location
2054 list, it must recognize the beginning and ending address
2055 offsets of (0, 0) for an end-of-list entry and
2056 \mbox{(0, \texttt{maximum-address})} for
2057 a default location list entry prior to applying any base
2058 address. Any other pair of offsets beginning with 0 is a
2059 valid normal location list entry. Next, it must recognize the
2060 beginning address offset of \texttt{maximum-address} for a base address selection
2061 entry prior to applying any base address. The current base
2062 address is not applied to the subsequent value (although there
2063 may be an underlying object language relocation that affects
2066 \textit{A base address selection entry and an end-of-list
2067 entry for a location list are identical to a base address
2068 selection entry and end-of-list entry, respectively, for a
2069 \addtoindex{range list}
2070 (see Section \refersec{chap:noncontiguousaddressranges})
2071 in interpretation and representation.}
2074 \subsubsection{Location Lists in Split Object Files}
2075 \label{chap:locationlistsinsplitobjectfiles}
2076 In a \splitDWARFobjectfile{} (see
2077 Section \refersec{datarep:splitdwarfobjectfiles}),
2078 location lists are contained in the \dotdebuglocdwo{} section.
2080 The \addtoindex{applicable base address} of a split
2081 location list entry (see following) is
2082 \addtoindexx{location list!base address selection entry}
2083 determined by the closest preceding base address selection
2084 entry (\DWLLEbaseaddressselectionentry) in the same location list. If there is
2085 no such selection entry, then the applicable base address
2086 defaults to the base address of the compilation unit (see
2087 Section \refersec{chap:normalandpartialcompilationunitentries}).
2089 Each entry in the split location list
2090 begins with a type code, which is a single unsigned byte that
2091 identifies the type of entry. There are five types of entries:
2093 \itembfnl{\DWLLEendoflistentryTARG}
2094 This entry indicates the end of a location list, and
2095 contains no further data.
2098 \itembfnl{\DWLLEbaseaddressselectionentryTARG}
2099 This entry contains an
2100 unsigned LEB128\addtoindexx{LEB128!unsigned} value immediately
2101 following the type code. This value is the index of an
2102 address in the \dotdebugaddr{} section, which is then used as
2103 the base address when interpreting offsets in subsequent
2104 location list entries of type \DWLLEoffsetpairentry.
2105 This index is relative to the value of the
2106 \DWATaddrbase{} attribute of the associated compilation unit.
2108 \itembfnl{\DWLLEstartendentryTARG}
2109 This entry contains two unsigned LEB128\addtoindexx{LEB128!unsigned}
2110 values immediately following the type code. These values are the
2111 indices of two addresses in the \dotdebugaddr{} section.
2112 These indices are relative to the value of the
2113 \DWATaddrbase{} attribute of the associated compilation unit
2114 (see Section \refersec{chap:unitentries}).
2115 These indicate the starting and ending addresses,
2116 respectively, that define the address range for which
2117 this location is valid. The starting and ending addresses
2118 given by this type of entry are not relative to the
2119 compilation unit base address. A single location
2120 description follows the fields that define the address range.
2122 \itembfnl{\DWLLEstartlengthentryTARG}
2123 This entry contains one unsigned LEB128\addtoindexx{LEB128!unsigned}
2125 unsigned value immediately following the type code. The
2126 first value is the index of an address in the \dotdebugaddr{}
2127 section, which marks the beginning of the address range
2128 over which the location is valid.
2129 This index is relative to the value of the
2130 \DWATaddrbase{} attribute of the associated compilation unit.
2131 The starting address given by this
2132 type of entry is not relative to the compilation unit
2133 base address. The second value is the
2134 length of the range. A single location
2135 description follows the fields that define the address range.
2137 \itembfnl{\DWLLEoffsetpairentryTARG}
2138 This entry contains two 4-byte unsigned values
2139 immediately following the type code. These values are the
2140 starting and ending offsets, respectively, relative to
2141 the applicable base address, that define the address
2142 range for which this location is valid. A single location
2143 description follows the fields that define the address range.
2146 \textit{The \DWLLEbaseaddressselectionentry, \DWLLEstartendentry{}
2147 and \DWLLEstartlengthentry entries obtain addresses within the
2148 target program indirectly using an index (not an offset) into an
2149 array of addresses. The base of that array is obtained using the
2150 \DWATaddrbase{} attribute of the containing compilation unit.
2151 The value of that attribute is the offset of the base of the array
2152 in the \dotdebugaddr{} section of the unit.}
2155 \section{Types of Program Entities}
2156 \label{chap:typesofprogramentities}
2157 \hypertarget{chap:DWATtypetypeofdeclaration}{}
2158 Any debugging information entry describing a declaration that
2160 \addtoindexx{type attribute}
2161 a \DWATtype{} attribute, whose value is a
2162 reference to another debugging information entry. The entry
2163 referenced may describe a base type, that is, a type that is
2164 not defined in terms of other data types, or it may describe a
2165 user-defined type, such as an array, structure or enumeration.
2166 Alternatively, the entry referenced may describe a type
2167 modifier, such as constant, packed, pointer, reference or
2168 volatile, which in turn will reference another entry describing
2169 a type or type modifier (using
2170 \addtoindexx{type attribute}
2171 a \DWATtype{} attribute of its
2173 Section \referfol{chap:typeentries}
2174 for descriptions of the entries describing
2175 base types, user-defined types and type modifiers.
2179 \section{Accessibility of Declarations}
2180 \label{chap:accessibilityofdeclarations}
2181 \textit{Some languages, notably \addtoindex{C++} and
2182 \addtoindex{Ada}, have the concept of
2183 the accessibility of an object or of some other program
2184 entity. The accessibility specifies which classes of other
2185 program objects are permitted access to the object in question.}
2187 The accessibility of a declaration is
2188 \hypertarget{chap:DWATaccessibilitycandadadeclarations}{}
2190 \DWATaccessibility{}
2192 \addtoindexx{accessibility attribute}
2193 value is a constant drawn from the set of codes listed in Table
2194 \refersec{tab:accessibilitycodes}.
2196 \begin{simplenametable}[1.9in]{Accessibility codes}{tab:accessibilitycodes}
2197 \DWACCESSpublicTARG{} \\
2198 \DWACCESSprivateTARG{} \\
2199 \DWACCESSprotectedTARG{} \\
2200 \end{simplenametable}
2203 \section{Visibility of Declarations}
2204 \label{chap:visibilityofdeclarations}
2206 \textit{Several languages (such as \addtoindex{Modula-2})
2207 have the concept of the visibility of a declaration. The
2208 visibility specifies which declarations are to be
2209 visible outside of the entity in which they are
2213 \hypertarget{chap:DWATvisibilityvisibilityofdeclaration}{}
2214 visibility of a declaration is represented
2215 by a \DWATvisibility{}
2216 attribute\addtoindexx{visibility attribute}, whose value is a
2217 constant drawn from the set of codes listed in
2218 Table \refersec{tab:visibilitycodes}.
2220 \begin{simplenametable}[1.5in]{Visibility codes}{tab:visibilitycodes}
2221 \DWVISlocalTARG{} \\
2222 \DWVISexportedTARG{} \\
2223 \DWVISqualifiedTARG{} \\
2224 \end{simplenametable}
2227 \section{Virtuality of Declarations}
2228 \label{chap:virtualityofdeclarations}
2229 \textit{\addtoindex{C++} provides for virtual and pure virtual structure or class
2230 member functions and for virtual base classes.}
2233 \hypertarget{chap:DWATvirtualityvirtualityindication}{}
2234 virtuality of a declaration is represented by a
2236 attribute\addtoindexx{virtuality attribute}, whose value is a constant drawn
2237 from the set of codes listed in
2238 Table \refersec{tab:virtualitycodes}.
2240 \begin{simplenametable}[2.5in]{Virtuality codes}{tab:virtualitycodes}
2241 \DWVIRTUALITYnoneTARG{} \\
2242 \DWVIRTUALITYvirtualTARG{} \\
2243 \DWVIRTUALITYpurevirtualTARG{} \\
2244 \end{simplenametable}
2247 \section{Artificial Entries}
2248 \label{chap:artificialentries}
2249 \textit{A compiler may wish to generate debugging information entries
2250 for objects or types that were not actually declared in the
2251 source of the application. An example is a formal parameter
2252 %FIXME: The word 'this' should be rendered like a variant italic,
2253 %FIXME: not as a quoted name. Changed to tt font--RB
2254 entry to represent the hidden
2255 \texttt{this} parameter\index{this parameter@\texttt{this} parameter}
2256 that most \addtoindex{C++} implementations pass as the first argument
2257 to non-static member functions.}
2259 Any debugging information entry representing the
2260 \addtoindexx{artificial attribute}
2261 declaration of an object or type artificially generated by
2262 a compiler and not explicitly declared by the source program
2263 \hypertarget{chap:DWATartificialobjectsortypesthat}{}
2265 \DWATartificial{} attribute,
2266 which is a \livelink{chap:classflag}{flag}.
2269 \section{Segmented Addresses}
2270 \label{chap:segmentedaddresses}
2271 \textit{In some systems, addresses are specified as offsets within a
2273 \addtoindexx{address space!segmented}
2275 \addtoindexx{segmented addressing|see{address space}}
2276 rather than as locations within a single flat
2277 \addtoindexx{address space!flat}
2280 Any debugging information entry that contains a description
2281 \hypertarget{chap:DWATsegmentaddressinginformation}{}
2282 of the location of an object or subroutine may have a
2283 \DWATsegment{} attribute,
2284 \addtoindexx{segment attribute}
2285 whose value is a location
2286 description. The description evaluates to the segment selector
2287 of the item being described. If the entry containing the
2288 \DWATsegment{} attribute has a
2292 \DWATentrypc{} attribute,
2293 \addtoindexx{entry PC attribute}
2296 description that evaluates to an address, then those address
2297 values represent the offset portion of the address within
2298 the segment specified
2299 \addtoindexx{segment attribute}
2303 \DWATsegment{} attribute, it inherits
2304 \addtoindexx{segment attribute}
2305 the segment value from its parent entry. If none of the
2306 entries in the chain of parents for this entry back to
2307 its containing compilation unit entry have
2308 \DWATsegment{} attributes,
2309 then the entry is assumed to exist within a flat
2311 Similarly, if the entry has a
2312 \DWATsegment{} attribute
2313 \addtoindexx{segment attribute}
2314 containing an empty location description, that
2315 entry is assumed to exist within a
2316 \addtoindexi{flat}{address space!flat}
2319 \textit{Some systems support different
2320 classes of addresses\addtoindexx{address class}.
2321 The address class may affect the way a pointer is dereferenced
2322 or the way a subroutine is called.}
2325 Any debugging information entry representing a pointer or
2326 reference type or a subroutine or subroutine type may
2329 attribute, whose value is an integer
2330 constant. The set of permissible values is specific to
2331 each target architecture. The value \DWADDRnoneTARG,
2333 is common to all encodings, and means that no address class
2337 \textit {For example, the Intel386 \texttrademark\ processor might use the following values:}
2340 \caption{Example address class codes}
2341 \label{tab:inteladdressclasstable}
2343 \begin{tabular}{l|c|l}
2345 Name&Value&Meaning \\
2347 \textit{DW\_ADDR\_none}& 0 & \textit{no class specified} \\
2348 \textit{DW\_ADDR\_near16}& 1 & \textit{16-bit offset, no segment} \\
2349 \textit{DW\_ADDR\_far16}& 2 & \textit{16-bit offset, 16-bit segment} \\
2350 \textit{DW\_ADDR\_huge16}& 3 & \textit{16-bit offset, 16-bit segment} \\
2351 \textit{DW\_ADDR\_near32}& 4 & \textit{32-bit offset, no segment} \\
2352 \textit{DW\_ADDR\_far32}& 5 & \textit{32-bit offset, 16-bit segment} \\
2358 \section{Non-Defining Declarations and Completions}
2359 \label{nondefiningdeclarationsandcompletions}
2360 A debugging information entry representing a program entity
2361 typically represents the defining declaration of that
2362 entity. In certain contexts, however, a debugger might need
2363 information about a declaration of an entity that is not
2364 \addtoindexx{incomplete declaration}
2365 also a definition, or is otherwise incomplete, to evaluate
2366 \hypertarget{chap:DWATdeclarationincompletenondefiningorseparateentitydeclaration}{}
2367 an expression correctly.
2370 \textit{As an example, consider the following fragment of \addtoindex{C} code:}
2384 \textit{\addtoindex{C} scoping rules require that the
2385 value of the variable \texttt{x} passed to the function
2386 \texttt{g} is the value of the global \texttt{float}
2387 variable \texttt{x} rather than of the local \texttt{int}
2388 variable \texttt{x}.}
2390 \subsection{Non-Defining Declarations}
2391 A debugging information entry that
2392 represents a non-defining
2393 \addtoindexx{non-defining declaration}
2395 \addtoindex{incomplete declaration}
2396 of a program entity has a
2397 \addtoindexx{declaration attribute}
2398 \DWATdeclaration{} attribute, which is a
2399 \livelink{chap:classflag}{flag}.
2401 \subsection{Declarations Completing Non-Defining Declarations}
2402 A debugging information entry that represents a
2403 declaration\hypertarget{chap:DWATspecificationincompletenondefiningorseparatedeclaration}{}
2404 that completes another (earlier) non-defining declaration may have a
2405 \DWATspecification{}
2406 attribute whose value is a \livelink{chap:classreference}{reference} to
2407 the debugging information entry representing the non-defining declaration.
2408 A debugging information entry with a
2409 \DWATspecification{}
2410 attribute does not need to duplicate information provided by the
2411 debugging information entry referenced by that specification attribute.
2413 When the non-defining declaration is contained within a type that has
2414 been placed in a separate type unit (see Section \refersec{chap:typeunitentries}),
2415 the \DWATspecification{} attribute cannot refer directly to the entry in
2416 the type unit. Instead, the current compilation unit may contain a
2417 \doublequote{skeleton} declaration of the type, which contains only the relevant
2418 declaration and its ancestors as necessary to provide the context
2419 (including containing types and namespaces). The \DWATspecification{}
2420 attribute would then be a reference to the declaration entry within
2421 the skeleton declaration tree. The debugging information entry for the
2422 top-level type in the skeleton tree may contain a \DWATsignature{}
2423 attribute whose value is the type signature
2424 (see Section \refersec{datarep:typesignaturecomputation}).
2427 Not all attributes of the debugging information entry referenced by a
2428 \DWATspecification{} attribute
2429 apply to the referring debugging information entry.
2430 For\addtoindexx{declaration attribute}
2434 \addtoindexx{declaration attribute}
2436 \addtoindexx{declaration attribute}
2438 \addtoindexx{sibling attribute}
2442 \section{Declaration Coordinates}
2443 \label{chap:declarationcoordinates}
2444 \livetargi{chap:declarationcoordinates}{}{declaration coordinates}
2445 \textit{It is sometimes useful in a debugger to be able to associate
2446 a declaration with its occurrence in the program source.}
2448 Any debugging information
2449 \hypertarget{chap:DWATdeclfilefilecontainingsourcedeclaration}{}
2451 \hypertarget{chap:DWATdecllinelinenumberofsourcedeclaration}{}
2453 \hypertarget{chap:DWATdeclcolumncolumnpositionofsourcedeclaration}{}
2455 \addtoindexx{line number of declaration}
2456 declaration of an object, module, subprogram or
2457 \addtoindex{declaration column attribute}
2459 \addtoindex{declaration file attribute}
2461 \addtoindex{declaration line attribute}
2466 attributes each of whose value is an unsigned
2467 \livelink{chap:classconstant}{integer constant}.
2470 \addtoindexx{declaration file attribute}
2474 \addtoindexx{file containing declaration}
2476 a file number from the line number information table for the
2477 compilation unit containing the debugging information entry and
2478 represents the source file in which the declaration appeared
2479 (see Section \refersec{chap:linenumberinformation}).
2480 The value 0 indicates that no source file
2484 \addtoindexx{declaration line attribute}
2485 the \DWATdeclline{} attribute represents
2486 the source line number at which the first character of
2487 the identifier of the declared object appears. The value 0
2488 indicates that no source line has been specified.
2491 \addtoindexx{declaration column attribute}
2492 the \DWATdeclcolumn{} attribute represents
2493 the source column number at which the first character of
2494 the identifier of the declared object appears. The value 0
2495 indicates that no column has been specified.
2497 \section{Identifier Names}
2498 \label{chap:identifiernames}
2499 Any\hypertarget{chap:DWATnamenameofdeclaration}{}
2500 debugging information entry
2501 \addtoindexx{identifier names}
2503 \addtoindexx{names!identifier}
2504 a program entity that has been given a name may have a
2506 attribute\addtoindexx{name attribute}, whose value of
2507 \CLASSstring{} represents the name as it appears in
2508 the source program. A debugging information entry containing
2509 no name attribute, or containing a name attribute whose value
2510 consists of a name containing a single null byte, represents
2511 a program entity for which no name was given in the source.
2513 \textit{Because the names of program objects described by DWARF are
2514 the names as they appear in the source program, implementations
2515 of language translators that use some form of mangled name
2516 \addtoindexx{mangled names}
2517 (as do many implementations of \addtoindex{C++}) should use the
2518 unmangled form of the name in the
2519 \DWATname{} attribute,
2520 \addtoindexx{name attribute}
2521 including the keyword operator (in names such as \doublequote{operator +}),
2522 if present. See also
2523 Section \referfol{chap:linkagenames} regarding the use of
2524 \DWATlinkagename{} for
2525 \addtoindex{mangled names}.
2526 Sequences of multiple whitespace characters may be compressed.}
2528 \section{Data Locations and DWARF Procedures}
2529 Any debugging information entry describing a data object (which
2530 \hypertarget{chap:DWATlocationdataobjectlocation}{}
2531 includes variables and parameters) or
2532 \livelink{chap:commonblockentry}{common blocks}
2534 \addtoindexx{location attribute}
2536 \DWATlocation{} attribute,
2537 \addtoindexx{location attribute}
2538 whose value is a location description
2539 (see Section \refersec{chap:locationdescriptions}).
2543 \addtoindex{DWARF procedure}
2544 is represented by any
2545 kind of debugging information entry that has
2546 \addtoindexx{location attribute}
2550 \addtoindexx{location attribute}
2551 If a suitable entry is not otherwise available,
2552 a DWARF procedure can be represented using a debugging
2553 \addtoindexx{DWARF procedure entry}
2554 information entry with the
2555 tag \DWTAGdwarfprocedureTARG{}
2557 \addtoindexx{location attribute}
2558 a \DWATlocation{} attribute.
2561 is called by a \DWOPcalltwo,
2564 DWARF expression operator
2565 (see Section \refersec{chap:controlflowoperations}).
2568 \section{Code Addresses and Ranges}
2569 \label{chap:codeaddressesandranges}
2570 Any debugging information entry describing an entity that has
2571 a machine code address or range of machine code addresses,
2572 which includes compilation units, module initialization,
2573 \hypertarget{chap:DWATrangesnoncontiguousrangeofcodeaddresses}{}
2574 subroutines, ordinary \nolink{blocks},
2575 try/catch \nolink{blocks} (see Section\refersec{chap:tryandcatchblockentries}),
2576 labels and the like, may have
2578 \item A \DWATlowpc{} attribute for
2579 \hypertarget{chap:DWATlowpccodeaddressorrangeofaddresses}{}
2582 \item A \DWATlowpc{}
2583 \addtoindexx{low PC attribute}
2586 \addtoindexx{high PC attribute}
2587 \hypertarget{chap:DWAThighpccontiguousrangeofcodeaddresses}{}
2588 pair of attributes for
2589 a single contiguous range of
2592 \item A \DWATranges{} attribute
2593 \addtoindexx{ranges attribute}
2594 for a non-contiguous range of addresses.
2597 In addition, a non-contiguous range of
2598 addresses may also be specified for the
2599 \DWATstartscope{} attribute.
2600 \addtoindexx{start scope attribute}
2602 If an entity has no associated machine code,
2603 none of these attributes are specified.
2605 \subsection{Single Address}
2606 When there is a single address associated with an entity,
2607 such as a label or alternate entry point of a subprogram,
2608 the entry has a \DWATlowpc{} attribute whose value is the
2609 relocated address for the entity.
2611 \textit{While the \DWATentrypc{}
2612 attribute might also seem appropriate for this purpose,
2613 historically the \DWATlowpc{} attribute was used before
2614 \DWATentrypc{} was introduced
2615 (in \addtoindex{DWARF Version 3}). There is
2616 insufficient reason to change this;
2617 \DWATlowpc{} serves as a default entry PC address as described
2618 in Section \refersec{chap:entryaddress}.}
2621 \subsection{Continuous Address Range}
2622 \label{chap:contiguousaddressranges}
2623 When the set of addresses of a debugging information entry can
2624 be described as a single contiguous range, the entry
2625 \addtoindexx{high PC attribute}
2627 \addtoindexx{low PC attribute}
2630 \DWAThighpc{} pair of attributes.
2633 \DWATlowpc{} attribute
2634 is the relocated address of the
2635 first instruction associated with the entity. If the value of
2636 the \DWAThighpc{} is of class address, it is the relocated
2637 address of the first location past the last instruction
2638 associated with the entity; if it is of class constant, the
2639 value is an unsigned integer offset which when added to the
2640 low PC gives the address of the first location past the last
2641 instruction associated with the entity.
2643 \textit{The high PC value
2644 may be beyond the last valid instruction in the executable.}
2647 The presence of low and high PC attributes for an entity
2648 implies that the code generated for the entity is contiguous
2649 and exists totally within the boundaries specified by those
2650 two attributes. If that is not the case, no low and high PC
2651 attributes should be produced.
2653 \subsection{Non-Contiguous Address Ranges}
2654 \label{chap:noncontiguousaddressranges}
2655 When the set of addresses of a debugging information entry
2656 \addtoindexx{non-contiguous address ranges}
2657 cannot be described as a single contiguous range, the entry has
2658 a \DWATranges{} attribute
2659 \addtoindexx{ranges attribute}
2660 whose value is of class \livelink{chap:classrangelistptr}{rangelistptr}
2661 and indicates the beginning of a \addtoindex{range list}.
2663 a \DWATstartscope{} attribute
2664 \addtoindexx{start scope attribute}
2665 may have a value of class
2666 \livelink{chap:classrangelistptr}{rangelistptr} for the same reason.
2668 Range lists are contained in a separate object file section called
2669 \dotdebugranges{}. A
2670 \addtoindex{range list} is indicated by a
2671 \DWATranges{} attribute whose
2672 \addtoindexx{ranges attribute}
2673 value is represented as an offset from the beginning of the
2674 \dotdebugranges{} section to the beginning of the
2675 \addtoindex{range list}.
2678 If the current compilation unit contains a \DWATrangesbase{}
2679 attribute, the value of that attribute establishes a base
2680 offset within the \dotdebugranges{} section for the compilation
2681 unit. The offset given by the \DWATranges{} attribute is
2682 relative to that base.
2684 \textit{The \DWATrangesbase{} attribute is new in \DWARFVersionV.
2685 The advantage of this attribute is that it reduces the number of
2686 object language relocations needed for references to the \dotdebugranges{}
2687 section from one for each range entry to a single relocation that
2688 applies for the entire compilation unit.}
2690 The \addtoindex{applicable base address} of a \addtoindex{range list}
2692 by the closest preceding base address selection entry (see
2693 below) in the same range list. If there is no such selection
2694 entry, then the applicable base address defaults to the base
2695 address of the compilation unit
2696 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2698 \textit{In the case of a compilation unit where all of the machine
2699 code is contained in a single contiguous section, no base
2700 address selection entry is needed.}
2702 Address range entries in a \addtoindex{range list} may not overlap.
2703 There is no requirement that the entries be ordered in any particular way.
2705 Each entry in a \addtoindex{range list} is either a
2706 \addtoindex{range list entry},
2707 \addtoindexx{base address selection entry!in range list}
2708 a base address selection entry, or an
2709 \addtoindexx{end-of-list entry!in range list}
2713 \subsubsection{Range List Entry}
2714 A \addtoindex{range list entry} consists of:
2715 \begin{enumerate}[1. ]
2716 \item A beginning address offset. This address offset has the
2717 \addtoindex{size of an address} and is relative to
2718 the \addtoindex{applicable base address} of the compilation unit referencing this
2719 \addtoindex{range list}.
2720 It marks the beginning of an
2721 \addtoindexi{address range}{address range!in range list}.
2723 \item An ending address offset. This address offset again has the
2724 \addtoindex{size of an address} and is relative
2725 to the \addtoindex{applicable base address} of the compilation unit referencing
2726 this \addtoindex{range list}.
2727 It marks the first address past the end of the address range.
2728 The ending address must be greater than or
2729 equal to the beginning address.
2732 \textit{A \addtoindex{range list} entry (but not a base address
2733 selection or end-of-list entry) whose beginning and
2734 ending addresses are equal has no effect because the size of the
2735 range covered by such an entry is zero.}
2739 \subsubsection{Base Address Selection Entry}
2740 A \addtoindex{base address selection entry} consists of:
2741 \begin{enumerate}[1. ]
2742 \item The value of the largest representable address offset
2743 (for example, \wffffffff when the size of an address is 32 bits).
2745 \item An address, which defines the appropriate base address
2746 for use in interpreting the beginning and ending address offsets
2747 of subsequent entries of the location list.
2750 \textit{A base address selection entry affects only the
2751 remainder of list in which it is contained.}
2753 \subsubsection{End-of-List Entry}
2754 The end of any given \addtoindex{range list} is marked by an
2755 \addtoindexx{end-of-list entry!in range list}
2757 which consists of a 0 for the beginning address
2758 offset and a 0 for the ending address offset.
2759 A \addtoindex{range list}
2760 containing only an end-of-list entry describes an empty scope
2761 (which contains no instructions).
2763 \textit{A base address selection entry and an
2764 \addtoindexx{end-of-list entry!in range list}
2765 end-of-list entry for
2766 a \addtoindex{range list}
2767 are identical to a base address selection entry
2768 and end-of-list entry, respectively, for a location list
2769 (see Section \refersec{chap:locationlists})
2770 in interpretation and representation.}
2773 \section{Entry Address}
2774 \label{chap:entryaddress}
2775 \textit{The entry or first executable instruction generated
2776 for an entity, if applicable, is often the lowest addressed
2777 instruction of a contiguous range of instructions. In other
2778 cases, the entry address needs to be specified explicitly.}
2780 Any debugging information entry describing an entity that has
2781 a range of code addresses, which includes compilation units,
2782 module initialization, subroutines,
2783 \livelink{chap:lexicalblock}{lexical \nolink{blocks}},
2784 \livelink{chap:tryandcatchblockentries}{try/catch \nolink{blocks}},
2785 and the like, may have a \DWATentrypcNAME{} attribute
2786 \addtoindexx{entry PC address}
2787 to indicate the first executable instruction within that
2788 range\hypertarget{chap:entryaddressofscope}{}
2789 of addresses. The value of the \DWATentrypcNAME{} attribute is a
2790 relocated address if the
2791 value of \DWATentrypcNAME{} is of class \CLASSaddress; or if it is of class
2792 \CLASSconstant, the value is an unsigned integer offset which, when
2793 added to the base address of the function, gives the entry
2796 The base address of the containing scope is given by either the
2797 \DWATlowpc{} attribute, or the first range entry in the list of
2798 ranges given by the \DWATranges{} attribute.
2799 If no \DWATentrypcNAME{} attribute is present,
2800 then the entry address is assumed to be the same as the
2804 \section{Static and Dynamic Values of Attributes}
2805 \label{chap:staticanddynamicvaluesofattributes}
2807 Some attributes that apply to types specify a property (such
2808 as the lower bound of an array) that is an integer value,
2809 where the value may be known during compilation or may be
2810 computed dynamically during execution.
2814 attributes is determined based on the class as follows:
2816 \item For a \livelink{chap:classconstant}{constant}, the value of the constant is the value of
2819 \item For a \livelink{chap:classreference}{reference}, the
2820 value is a reference to another DIE. This DIE may:
2822 \renewcommand{\itemsep}{0cm}
2823 \item describe a constant which is the attribute value,
2824 \item describe a variable which contains the attribute value, or
2825 \item contain a DWARF expression which computes the attribute value
2826 (for example, be a \DWTAGdwarfprocedure{} entry).
2829 \item For an \livelink{chap:classexprloc}{exprloc}, the value is interpreted as a
2831 evaluation of the expression yields the value of
2835 \textit{Whether an attribute value can be dynamic depends on the
2836 rules of the applicable programming language.
2840 \section{Entity Descriptions}
2841 \textit{Some debugging information entries may describe entities
2842 in the program that are artificial, or which otherwise have a
2843 \doublequote{name} that is not a valid identifier in the
2844 programming language. For example, several languages may
2845 capture or freeze the value of a variable at a particular
2846 point in the program and hold that value in an artificial variable.
2847 \addtoindex{Ada} 95 has package elaboration routines,
2848 type descriptions of the form \texttt{typename\textquoteright Class}, and
2849 \doublequote{\texttt{access} typename} parameters.}
2851 Generally, any debugging information entry that
2852 \hypertarget{chap:DWATdescriptionartificialnameordescription}{}
2854 \addtoindexx{name attribute}
2856 \DWATname{} attribute, may
2858 \addtoindexx{description attribute}
2860 \DWATdescription{} attribute whose value is a
2861 null-terminated string providing a description of the entity.
2863 \textit{It is expected that a debugger will only display these
2864 descriptions as part of the description of other entities.}
2867 \section{Byte and Bit Sizes}
2868 \label{chap:byteandbitsizes}
2869 % Some trouble here with hbox full, so we try optional word breaks.
2870 Many debugging information entries allow either a
2871 \DWATbytesize{} attribute or a
2872 \DWATbitsize{} attribute,
2873 whose \livelink{chap:classconstant}{integer constant} value
2874 (see Section \ref{chap:staticanddynamicvaluesofattributes})
2876 amount of storage. The value of the
2877 \DWATbytesize{} attribute
2878 is interpreted in bytes and the value of the
2880 attribute is interpreted in bits. The
2881 \DWATstringlengthbytesize{} and
2882 \DWATstringlengthbitsize{}
2883 attributes are similar.
2885 In addition, the \livelink{chap:classconstant}{integer constant}
2886 value of a \DWATbytestride{} attribute is interpreted
2887 in bytes and the \livelink{chap:classconstant}{integer constant} value of a
2889 attribute is interpreted in bits.
2891 \section{Linkage Names}
2892 \label{chap:linkagenames}
2893 \textit{Some language implementations, notably
2894 \addtoindex{C++} and similar
2895 languages, make use of implementation-defined names within
2896 object files that are different from the \addtoindex{identifier names}
2897 (see Section \refersec{chap:identifiernames}) of entities as they
2898 appear in the source. Such names, sometimes known as
2899 \addtoindex{mangled names}\addtoindexx{names!mangled},
2900 are used in various ways, such as: to encode additional
2901 information about an entity, to distinguish multiple entities
2902 that have the same name, and so on. When an entity has an
2903 associated distinct linkage name it may sometimes be useful
2904 for a producer to include this name in the DWARF description
2905 of the program to facilitate consumer access to and use of
2906 object file information about an entity and/or information
2907 \hypertarget{chap:DWATlinkagenameobjectfilelinkagenameofanentity}{}
2908 that is encoded in the linkage name itself.
2911 % Some trouble maybe with hbox full, so we try optional word breaks.
2912 A debugging information entry may have
2913 \addtoindexx{linkage name attribute}
2916 attribute whose value is a null-terminated string containing the
2917 object file linkage name associated with the corresponding entity.
2920 \section{Template Parameters}
2921 \label{chap:templateparameters}
2922 \textit{In \addtoindex{C++}, a template is a generic definition
2923 of a class, function, member function, or typedef (alias).
2924 A template has formal parameters that
2925 can be types or constant values; the class, function,
2926 member function, or typedef is instantiated differently for each
2927 distinct combination of type or value actual parameters. DWARF does
2928 not represent the generic template definition, but does represent each
2931 A debugging information entry that represents a
2932 \addtoindex{template instantiation}
2933 will contain child entries describing the actual template parameters.
2934 The containing entry and each of its child entries reference a template
2935 parameter entry in any circumstance where the template definition
2936 referenced a formal template parameter.
2938 A template type parameter is represented by a debugging information
2940 \addtoindexx{template type parameter entry}
2941 \DWTAGtemplatetypeparameterTARG.
2942 A template value parameter is represented by a debugging information
2944 \addtoindexx{template value parameter entry}
2945 \DWTAGtemplatevalueparameterTARG.
2946 The actual template parameter entries appear in the same order as the
2947 corresponding template formal parameter declarations in the
2951 A type or value parameter entry may have a \DWATname{} attribute,
2952 \addtoindexx{name attribute}
2954 null\dash terminated string containing the name of the corresponding
2955 formal parameter as it appears in the source program.
2956 The entry may also have a
2957 \DWATdefaultvalue{} attribute, which is a flag indicating
2958 that the value corresponds to the default argument for the
2962 \addtoindexx{formal type parameter|see{template type parameter entry}}
2963 template type parameter entry has a
2964 \addtoindexx{type attribute}
2965 \DWATtype{} attribute
2966 describing the actual type by which the formal is replaced.
2968 A template value parameter entry has a \DWATtype{} attribute
2969 describing the type of the parameterized value.
2970 The entry also has an attribute giving the
2971 actual compile-time or run-time constant value
2972 of the value parameter for this instantiation.
2974 \DWATconstvalue{}\livetarg{chap:DWATconstvaluetemplatevalueparameter}{}
2975 attribute, whose value is the compile-time constant value
2976 as represented on the target architecture, or a
2977 \DWATlocation{} attribute, whose value is a
2978 single location description for the run-time constant address.
2981 \label{chap:alignment}
2982 \livetarg{chap:DWATalignmentnondefault}{}
2983 A debugging information entry may have a
2984 \DWATalignment{} attribute\addtoindexx{alignment attribute}
2985 that describes the (non-default) alignment requirements of the entry.
2986 \DWATalignment{} has a positive, non-zero, integer constant value
2987 describing the strictest specified (non-default) alignment of the entity.
2988 This constant describes the actual alignment used by the compiler.
2989 (If there are multiple alignments specified by the user, or if the
2990 user specified an alignment the compiler could not satisfy, then
2991 only the strictest alignment is added using this attribute.)
2993 \textit{For example, an alignment attribute whose value is 8 indicates
2994 that the entity to which it applies occurs at an address that is a
2995 multiple of eight (not a multiple of $2^8$ or 256).}