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.
31 \autocols[0pt]{c}{2}{l}{
32 \DWTAGaccessdeclaration,
37 \DWTAGcallsiteparameter,
42 \DWTAGcommoninclusion,
50 \DWTAGenumerationtype,
53 \DWTAGformalparameter,
55 \DWTAGgenericsubrange,
56 \DWTAGimporteddeclaration,
60 \DWTAGinlinedsubroutine,
72 \DWTAGptrtomembertype,
75 \DWTAGrvaluereferencetype,
84 \DWTAGtemplatetypeparameter,
85 \DWTAGtemplatevalueparameter,
91 \DWTAGunspecifiedparameters,
92 \DWTAGunspecifiedtype,
103 \textit{The debugging information entry descriptions
104 in Sections 3, 4 and 5 generally include mention of
105 most, but not necessarily all, of the attributes
106 that are normally or possibly used with the entry.
107 Some attributes, whose applicability tends to be
108 pervasive and invariant across many kinds of
109 debugging information entries, are described in
110 this section and not necessarily mentioned in all
111 contexts where they may be appropriate.
114 the \livelink{chap:declarationcoordinates}{declaration coordinates}, and
118 The debugging information entries are contained in the
119 \dotdebuginfo{} and/or \dotdebuginfodwo{} sections of an object file.
122 Optionally, debugging information may be partitioned such
123 that the majority of the debugging information can remain in
124 individual object files without being processed by the
125 linker. These debugging information entries are contained in
126 the \dotdebuginfodwo{} sections. These
127 sections may be placed in the object file but marked so that
128 the linker ignores them, or they may be placed in a separate
129 DWARF object file that resides alongside the normal object
130 file. See Section \refersec{datarep:splitdwarfobjectfiles} and
131 Appendix \refersec{app:splitdwarfobjectsinformative} for details.
133 As a further option, debugging information entries and other debugging
134 information that are the same in multiple executable or shared object files
135 may be found in a separate \addtoindex{supplementary object file} that
136 contains supplementary debug sections.
137 The executable or shared object file which contains references to
138 those debugging information entries contain a \dotdebugsup{} section
139 with information that identifies the \addtoindex{supplementary object file};
140 the \addtoindex{supplementary object file} contains a variant of this same section
141 that is used to unambiguously associate it with the referencing object.
142 See Section \refersec{datarep:dwarfsupplemetaryobjectfiles} for
145 \section{Attribute Types}
146 \label{chap:attributetypes}
147 Each attribute value is characterized by an attribute name.
148 \addtoindexx{attribute duplication}
149 No more than one attribute with a given name may appear in any
150 debugging information entry.
151 There are no limitations on the
152 \addtoindexx{attribute ordering}
153 ordering of attributes within a debugging information entry.
155 The attributes are listed in Table \referfol{tab:attributenames}.
157 \setlength{\extrarowheight}{0.1cm}
158 \addtoindexx{attributes!list of}
159 \begin{longtable}{l|P{9cm}}
160 \caption{Attribute names} \label{tab:attributenames} \\
161 \hline \bfseries Attribute&\bfseries Identifies or Specifies \\ \hline
163 \bfseries Attribute&\bfseries Identifies or Specifies \\ \hline
165 \hline \emph{Continued on next page}
170 \DWATabstractoriginTARG
171 &\livelinki{chap:DWATabstractorigininlineinstance}
172 {Inline instances of inline subprograms}
173 {inline instances of inline subprograms} \\
174 % Heren livelink we cannot use \dash or \dash{}.
175 &\livelinki{chap:DWATabstractoriginoutoflineinstance}
176 {Out-of-line instances of inline subprograms}
177 {out-of-line instances of inline subprograms} \\
178 \DWATaccessibilityTARG
179 &\livelink{chap:DWATaccessibilitycandadadeclarations}
180 {Accessibility of declarations} (\addtoindex{C++}, \addtoindex{Ada}) \\
181 &\livelink{chap:DWATaccessibilitycppbaseclasses}
182 {Accessibility of base classes} (\addtoindex{C++}) \\
183 &\livelink{chap:DWATaccessibilitycppinheritedmembers}
184 {Accessibility of inherited members} (\addtoindex{C++}) \\
185 \DWATaddressclassTARG
186 &\livelinki{chap:DWATadressclasspointerorreferencetypes}
187 {Pointer or reference types}
188 {pointer or reference types} \\
189 &\livelinki{chap:DWATaddressclasssubroutineorsubroutinetype}
190 {Subroutine or subroutine type}
191 {subroutine or subroutine type} \\
193 &\livelinki{chap:DWATaddrbaseforaddresstable}
194 {Base offset for 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}
225 {Size of a base type in bits}
226 {base type bit size} \\
227 &\livelinki{chap:DWATbitsizedatamemberbitsize}
228 {Size of a data member in bits}
229 {data member bit size} \\
231 &\livelinki{chap:DWATbitstridearrayelementstrideofarraytype}
232 {Array element stride (of array type)}
233 {array element stride (of array type)} \\
234 &\livelinki{chap:DWATbitstridesubrangestridedimensionofarraytype}
235 {Subrange stride (dimension of array type)}
236 {subrange stride (dimension of array type)} \\
237 &\livelinki{chap:DWATbitstrideenumerationstridedimensionofarraytype}
238 {Enumeration stride (dimension of array type)}
239 {enumeration stride (dimension of array type)} \\
241 &\livelinki{chap:DWATbytesizedataobjectordatatypesize}
242 {Size of a data object or data type in bytes}
243 {data object or data type size} \\
244 \DWATbytestrideTARG{}
245 &\livelinki{chap:DWATbytestridearrayelementstrideofarraytype}
246 {Array element stride (of array type)}
247 {array element stride (of array type)} \\
248 &\livelinki{chap:DWATbytestridesubrangestridedimensionofarraytype}
249 {Subrange stride (dimension of array type)}
250 {subrange stride (dimension of array type)} \\
251 &\livelinki{chap:DWATbytestrideenumerationstridedimensionofarraytype}
252 {Enumeration stride (dimension of array type)}
253 {enumeration stride (dimension of array type)} \\
254 \DWATcallallcallsTARG{}
255 &\livelinki{chap:DWATcallallcallsofasubprogram}
256 {All tail and normal calls in a subprogram are described by call site entries}
257 {all tail and normal calls are described}
258 \index{call site!summary!all tail and normal calls are described} \\
259 \DWATcallallsourcecallsTARG{}
260 &\livelinki{chap:DWATcallallsourcecallsofasubprogram}
261 {All tail, normal and inlined calls in a subprogram are described by call site and inlined subprogram entries}
262 {all tail, normal and inlined calls are described}
263 \index{call site!summary!all tail, normal and inlined calls are described} \\
264 \DWATcallalltailcallsTARG{}
265 &\livelinki{chap:DWATcallalltailcallsofasubprogram}
266 {All tail calls in a subprogram are described by call site entries}
267 {all tail calls are described}
268 \index{call site!summary!all tail calls are described} \\
269 \DWATcallcolumnTARG{}
270 &\livelinki{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}
271 {Column position of inlined subroutine call}
272 {column position of inlined subroutine call} \\
273 \DWATcalldatalocationTARG{}
274 &\livelinki{chap:DWATcalldatalocationofcallparameter}
275 {Address of the value pointed to by an argument passed in a call}
276 {address of the value pointed to by an argument}
277 \index{call site!address of the value pointed to by an argument} \\
278 \DWATcalldatavalueTARG{}
279 &\livelinki{chap:DWATcalldatavalueofcallparameter}
280 {Value pointed to by an argument passed in a call}
281 {value pointed to by an argument}
282 \index{call site!value pointed to by an argument} \\
284 &\livelinki{chap:DWATcallfilefilecontaininginlinedsubroutinecall}
285 {File containing inlined subroutine call}
286 {file containing inlined subroutine call} \\
288 &\livelinki{chap:DWATcalllinelinenumberofinlinedsubroutinecall}
289 {Line number of inlined subroutine call}
290 {line number of inlined subroutine call} \\
291 \DWATcallingconventionTARG{}
292 &\livelinki{chap:DWATcallingconventionforsubprograms}
293 {Calling convention for subprograms}
294 {Calling convention!for subprograms} \\
295 &\livelinki{chap:DWATcallingconventionfortypes}
296 {Calling convention for types}
297 {Calling convention!for types} \\
298 \DWATcalloriginTARG{}
299 &\livelinki{chap:DWATcalloriginofcallsite}
300 {Subprogram called in a call}
302 \index{call site!subprogram called} \\
303 \DWATcallparameterTARG{}
304 &\livelinki{chap:DWATcallparameterofcallparameter}
305 {Parameter entry in a call}
307 \index{call site!parameter entry} \\
309 &\livelinki{chap:DWATcallpcofcallsite}
310 {Address of the call instruction in a call}
311 {address of call instruction}
312 \index{call site!address of the call instruction} \\
313 \DWATcallreturnpcTARG{}
314 &\livelinki{chap:DWATcallreturnpcofcallsite}
315 {Return address from a call}
316 {return address from a call}
317 \index{call site!return address} \\
318 \DWATcalltailcallTARG{}
319 &\livelinki{chap:DWATcalltailcallofcallsite}
320 {Call is a tail call}
321 {call is a tail call}
322 \index{call site!tail call} \\
323 \DWATcalltargetTARG{}
324 &\livelinki{chap:DWATcalltargetofcallsite}
325 {Address of called routine in a call}
326 {address of called routine}
327 \index{call site!address of called routine} \\
328 \DWATcalltargetclobberedTARG{}
329 &\livelinki{chap:DWATcalltargetclobberedofcallsite}
330 {Address of called routine, which may be clobbered, in a call}
331 {address of called routine, which may be clobbered}
332 \index{call site!address of called routine, which may be clobbered} \\
334 &\livelinki{chap:DWATcallvalueofcallparameter}
335 {Argument value passed in a call}
336 {argument value passed}
337 \index{call site!argument value passed} \\
338 \DWATcommonreferenceTARG
339 &\livelinki{chap:commonreferencecommonblockusage}
341 {common block usage} \\
343 &\livelinki{chap:DWATcompdircompilationdirectory}
344 {Compilation directory}
345 {compilation directory} \\
347 &\livelinki{chap:DWATconstexprcompiletimeconstantobject}
348 {Compile-time constant object}
349 {compile-time constant object} \\
350 &\livelinki{chap:DWATconstexprcompiletimeconstantfunction}
351 {Compile-time constant function}
352 {compile-time constant function} \\
354 &\livelinki{chap:DWATconstvalueconstantobject}
357 &\livelinki{chap:DWATconstvalueenumerationliteralvalue}
358 {Enumeration literal value}
359 {enumeration literal value} \\
360 &\livelinki{chap:DWATconstvaluetemplatevalueparameter}
361 {Template value parameter}
362 {template value parameter} \\
363 \DWATcontainingtypeTARG
364 &\livelinki{chap:DWATcontainingtypecontainingtypeofpointertomembertype}
365 {Containing type of pointer to member type}
366 {containing type of pointer to member type} \\
368 &\livelinki{chap:DWATcountelementsofsubrangetype}
369 {Elements of subrange type}
370 {elements of breg subrange type} \\
371 \DWATdatabitoffsetTARG
372 &\livelinki{chap:DWATdatabitoffsetbasetypebitlocation}
373 {Base type bit location}
374 {base type bit location} \\
375 &\livelinki{chap:DWATdatabitoffsetdatamemberbitlocation}
376 {Data member bit location}
377 {data member bit location} \\
378 \DWATdatalocationTARG{}
379 &\livelinki{chap:DWATdatalocationindirectiontoactualdata}
380 {Indirection to actual data}
381 {indirection to actual data} \\
382 \DWATdatamemberlocationTARG
383 &\livelinki{chap:DWATdatamemberlocationdatamemberlocation}
384 {Data member location}
385 {data member location} \\
386 &\livelinki{chap:DWATdatamemberlocationinheritedmemberlocation}
387 {Inherited member location}
388 {inherited member location} \\
389 \DWATdecimalscaleTARG
390 &\livelinki{chap:DWATdecimalscaledecimalscalefactor}
391 {Decimal scale factor}
392 {decimal scale factor} \\
394 &\livelinki{chap:DWATdecimalsigndecimalsignrepresentation}
395 {Decimal sign representation}
396 {decimal sign representation} \\
398 &\livelinki{chap:DWATdeclcolumncolumnpositionofsourcedeclaration}
399 {Column position of source declaration}
400 {column position of source declaration} \\
402 &\livelinki{chap:DWATdeclfilefilecontainingsourcedeclaration}
403 {File containing source declaration}
404 {file containing source declaration} \\
406 &\livelinki{chap:DWATdecllinelinenumberofsourcedeclaration}
407 {Line number of source declaration}
408 {line number of source declaration} \\
410 &\livelinki{chap:DWATdeclarationincompletenondefiningorseparateentitydeclaration}
411 {Incomplete, non-defining, or separate entity declaration}
412 {incomplete, non-defining, or separate entity declaration} \\
414 &\livelinki{chap:DWATdefaulteddef}
415 {Whether a member function has been declared as default}
416 {defaulted attribute} \\
417 \DWATdefaultvalueTARG
418 &\livelinki{chap:DWATdefaultvaluedefaultvalueofparameter}
419 {Default value of parameter}
420 {default value of parameter} \\
422 &\livelinki{chap:DWATdeleteddef}
423 {Whether a member has been declared as deleted}
424 {Deletion of member function} \\
425 \DWATdescriptionTARG{}
426 &\livelinki{chap:DWATdescriptionartificialnameordescription}
427 {Artificial name or description}
428 {artificial name or description} \\
430 &\livelinki{chap:DWATdigitcountdigitcountforpackeddecimalornumericstringtype}
431 {Digit count for packed decimal or numeric string type}
432 {digit count for packed decimal or numeric string type} \\
434 &\livelinki{chap:DWATdiscrdiscriminantofvariantpart}
435 {Discriminant of variant part}
436 {discriminant of variant part} \\
438 &\livelinki{chap:DWATdiscrlistlistofdiscriminantvalues}
439 {List of discriminant values}
440 {list of discriminant values} \\
442 &\livelinki{chap:DWATdiscrvaluediscriminantvalue}
444 {discriminant value} \\
446 &\livelinki{chap:DWATdwoidforunit}
447 {Signature for compilation unit}
448 {split DWARF object file!unit signature} \\
450 &\livelinki{chap:DWATdwonameforunit}
451 {Name of split DWARF object file}
452 {split DWARF object file!object file name} \\
454 &\livelinki{chap:DWATelementalelementalpropertyofasubroutine}
455 {Elemental property of a subroutine}
456 {elemental property of a subroutine} \\
458 &\livelinki{chap:DWATencodingencodingofbasetype}
459 {Encoding of base type}
460 {encoding of base type} \\
462 &\livelinki{chap:DWATendianityendianityofdata}
464 {endianity of data} \\
466 &\livelinki{chap:entryaddressofscope}
467 {Entry address of a scope (compilation unit, \mbox{subprogram,} and so on)}
468 {entry address of a scope} \\
470 &\livelinki{chap:DWATenumclasstypesafeenumerationdefinition}
471 {Type safe enumeration definition}
472 {type safe enumeration definition}\\
474 &\livelinki{chap:DWATexplicitexplicitpropertyofmemberfunction}
475 {Explicit property of member function}
476 {explicit property of member function}\\
477 \DWATexportsymbolsTARG
478 &\livelinki{chap:DWATexportsymbolsofnamespace}
479 {Export (inline) symbols of namespace}
480 {export symbols of a namespace} \\
481 &\livelinki{chap:DWATexportsymbolsofstructunionclass}
482 {Export symbols of a structure, union or class}
483 {export symbols of a structure, union or class} \\
485 &\livelinki{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}
486 {Previous namespace extension or original namespace}
487 {previous namespace extension or original namespace}\\
489 &\livelinki{chap:DWATexternalexternalsubroutine}
490 {External subroutine}
491 {external subroutine} \\
492 &\livelinki{chap:DWATexternalexternalvariable}
494 {external variable} \\
496 &\livelinki{chap:DWATframebasesubroutineframebaseaddress}
497 {Subroutine frame base address}
498 {subroutine frame base address} \\
500 &\livelinki{chap:DWATfriendfriendrelationship}
501 {Friend relationship}
502 {friend relationship} \\
504 &\livelinki{chap:DWAThighpccontiguousrangeofcodeaddresses}
505 {Contiguous range of code addresses}
506 {contiguous range of code addresses} \\
507 \DWATidentifiercaseTARG
508 &\livelinki{chap:DWATidentifiercaseidentifiercaserule}
509 {Identifier case rule}
510 {identifier case rule} \\
512 &\livelinki{chap:DWATimportimporteddeclaration}
513 {Imported declaration}
514 {imported declaration} \\
515 &\livelinki{chap:DWATimportimportedunit}
518 &\livelinki{chap:DWATimportnamespacealias}
521 &\livelinki{chap:DWATimportnamespaceusingdeclaration}
522 {Namespace using declaration}
523 {namespace using declaration} \\
524 &\livelinki{chap:DWATimportnamespaceusingdirective}
525 {Namespace using directive}
526 {namespace using directive} \\
528 &\livelinki{chap:DWATinlineabstracttinstance}
530 {abstract instance} \\
531 &\livelinki{chap:DWATinlineinlinedsubroutine}
533 {inlined subroutine} \\
535 &\livelinki{chap:DWATisoptionaloptionalparameter}
537 {optional parameter} \\
539 &\livelinki{chap:DWATlanguageprogramminglanguage}
540 {Programming language}
541 {programming language} \\
543 &\livelinki{chap:DWATlinkagenameobjectfilelinkagenameofanentity}
544 {Object file linkage name of an entity}
545 {object file linkage name of an entity}\\
547 &\livelinki{chap:DWATlocationdataobjectlocation}
548 {Data object location}
549 {data object location}\\
551 &\livelinki{chap:DWATlowpccodeaddressorrangeofaddresses}
552 {Code address or range of addresses}
553 {code address or range of addresses}\\
555 &\livelinki{chap:DWATlowerboundlowerboundofsubrange}
556 {Lower bound of subrange}
557 {lower bound of subrange} \\
559 &\livelinki{chap:DWATmacroinfomacroinformation}
560 {Macro preprocessor information (legacy)}
561 {macro preprocessor information (legacy)} \\
562 & \textit{(reserved for coexistence with \DWARFVersionIV{} and earlier)} \\
564 &\livelinki{chap:DWATmacrosmacroinformation}
565 {Macro preprocessor information}
566 {macro preprocessor information} \\
567 & \textit{(\texttt{\#define}, \texttt{\#undef}, and so on in \addtoindex{C},
568 \addtoindex{C++} and similar languages)} \\
569 \DWATmainsubprogramTARG
570 &\livelinki{chap:DWATmainsubprogrammainorstartingsubprogram}
571 {Main or starting subprogram}
572 {main or starting subprogram} \\
573 &\livelinki{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}
574 {Unit containing main or starting subprogram}
575 {unit containing main or starting subprogram}\\
577 &\livelinki{chap:DWATmutablemutablepropertyofmemberdata}
578 {Mutable property of member data}
579 {mutable property of member data} \\
581 &\livelinki{chap:DWATnamenameofdeclaration}
582 {Name of declaration}
583 {name of declaration}\\
584 &\livelinki{chap:DWATnamepathnameofcompilationsource}
585 {Path name of compilation source}
586 {path name of compilation source} \\
587 \DWATnamelistitemTARG
588 &\livelinki{chap:DWATnamelistitemnamelistitem}
592 &\livelinki{chap:DWATnoreturnofsubprogram}
593 {\doublequote{no return} property of a subprogram}
594 {noreturn attribute} \\
595 \DWATobjectpointerTARG
596 &\livelinki{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}
597 {Object (\texttt{this}, \texttt{self}) pointer of member function}
598 {object (\texttt{this}, \texttt{self}) pointer of member function}\\
600 &\livelinki{chap:DWATorderingarrayrowcolumnordering}
601 {Array row/column ordering}
602 {array row/column ordering}\\
603 \DWATpicturestringTARG
604 &\livelinki{chap:DWATpicturestringpicturestringfornumericstringtype}
605 {Picture string for numeric string type}
606 {picture string for numeric string type} \\
608 &\livelinki{chap:DWATprioritymodulepriority}
612 &\livelinki{chap:DWATproducercompileridentification}
613 {Compiler identification}
614 {compiler identification}\\
616 &\livelinki{chap:DWATprototypedsubroutineprototype}
617 {Subroutine prototype}
618 {subroutine prototype}\\
620 &\livelinki{chap:DWATpurepurepropertyofasubroutine}
621 {Pure property of a subroutine}
622 {pure property of a subroutine} \\
624 &\livelinki{chap:DWATrangesnoncontiguousrangeofcodeaddresses}
625 {Non-contiguous range of code addresses}
626 {non-contiguous range of code addresses} \\
628 &\livelinki{chap:DWATrangesbaseforrangelists}
629 {Base offset for range lists}
632 &\livelinki{chap:DWATrankofdynamicarray}
633 {Dynamic number of array dimensions}
634 {dynamic number of array dimensions} \\
636 &\livelinki{chap:DWATrecursiverecursivepropertyofasubroutine}
637 {Recursive property of a subroutine}
638 {recursive property of a subroutine} \\
640 &\livelink{chap:DWATreferenceofnonstaticmember}
641 {\&-qualified non-static member function} \textit{(\addtoindex{C++})} \\
643 &\livelinki{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}
644 {Subroutine return address save location}
645 {subroutine return address save location} \\
646 \DWATrvaluereferenceTARG
647 &\livelink{chap:DWATrvaluereferenceofnonstaticmember}
648 {\&\&-qualified non-static member function} \textit{(\addtoindex{C++})} \\
651 &\livelinki{chap:DWATsegmentaddressinginformation}
652 {Addressing information}
653 {addressing information} \\
655 &\livelinki{chap:DWATsiblingdebugginginformationentryrelationship}
656 {Debugging information entry relationship}
657 {debugging information entry relationship} \\
659 &\livelinki{chap:DWATsmallscalefactorforfixedpointtype}
660 {Scale factor for fixed-point type}
661 {scale factor for fixed-point type} \\
663 &\livelinki{chap:DWATsignaturetypesignature}
666 \DWATspecificationTARG
667 &\livelinki{chap:DWATspecificationincompletenondefiningorseparatedeclaration}
668 {Incomplete, non-defining, or separate declaration corresponding to a declaration}
669 {incomplete, non-defining, or separate declaration corresponding to a declaration} \\
671 &\livelinki{chap:DWATstartscopeobjectdeclaration}
673 {object declaration}\\*
674 &\livelinki{chap:DWATstartscopetypedeclaration}
678 &\livelinki{chap:DWATstaticlinklocationofuplevelframe}
679 {Location of uplevel frame}
680 {location of uplevel frame} \\
682 &\livelinki{chap:DWATstmtlistlinenumberinformationforunit}
683 {Line number information for unit}
684 {line number information for unit}\\
685 \DWATstringlengthTARG
686 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
687 {String length of string type}
688 {string length of string type} \\
689 \DWATstringlengthbitsizeTARG
690 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
691 {Size of string length of string type}
692 {string length of string type!size of} \\
693 \DWATstringlengthbytesizeTARG
694 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
695 {Size of string length of string type}
696 {string length of string type!size of} \\
697 \DWATstroffsetsbaseTARG
698 &\livelinki{chap:DWATstroffsetbaseforindirectstringtable}
699 {Base of string offsets table}
700 {string offsets table} \\
701 \DWATthreadsscaledTARG
702 &\livelink{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}
703 {UPC array bound THREADS scale factor}\\
705 &\livelinki{chap:DWATtrampolinetargetsubroutine}
707 {target subroutine of trampoline} \\
709 &\livelinki{chap:DWATtypeofcallsite}
711 {type!of call site} \\
712 &\livelinki{char:DWAATtypeofstringtype}
713 {Type of string type components}
714 {type!of string type components} \\
715 &\livelinki{chap:DWATtypetypeofsubroutinereturn}
716 {Type of subroutine return}
717 {type!of subroutine return} \\
718 &\livelinki{chap:DWATtypetypeofdeclaration}
719 {Type of declaration}
720 {type!of declaration} \\
722 &\livelinki{chap:DWATupperboundupperboundofsubrange}
723 {Upper bound of subrange}
724 {upper bound of subrange} \\
726 &\livelinki{chap:DWATuselocationmemberlocationforpointertomembertype}
727 {Member location for pointer to member type}
728 {member location for pointer to member type} \\
729 \DWATuseUTFeightTARG\addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
730 &\livelinki{chap:DWATuseUTF8compilationunitusesutf8strings}
731 {Compilation unit uses UTF-8 strings}
732 {compilation unit uses UTF-8 strings} \\
733 \DWATvariableparameterTARG
734 &\livelinki{chap:DWATvariableparameternonconstantparameterflag}
735 {Non-constant parameter flag}
736 {non-constant parameter flag} \\
738 &\livelinki{chap:DWATvirtualityvirtualityindication}
739 {Virtuality indication}
740 {virtuality indication} \\
741 &\livelinki{chap:DWATvirtualityvirtualityofbaseclass}
742 {Virtuality of base class}
743 {virtuality of base class} \\
744 &\livelinki{chap:DWATvirtualityvirtualityoffunction}
745 {Virtuality of function}
746 {virtuality of function} \\
748 &\livelinki{chap:DWATvisibilityvisibilityofdeclaration}
749 {Visibility of declaration}
750 {visibility of declaration} \\
751 \DWATvtableelemlocationTARG
752 &\livelinki{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}
753 {Virtual function vtable slot}
754 {virtual function vtable slot}\\
757 \addtoindexx{address|see {\textit{also} address class}}
758 \addtoindexx{addrptr|see {\textit{also} addrptr class}}
759 \addtoindexx{block|see {\textit{also} block class}}
760 \addtoindexx{constant|see {\textit{also} constant class}}
761 \addtoindexx{exprloc|see {\textit{also} exprloc class}}
762 \addtoindexx{flag|see {\textit{also} flag class}}
763 \addtoindexx{lineptr|see {\textit{also} lineptr class}}
764 \addtoindexx{loclistptr|see {\textit{also} loclistptr class}}
765 \addtoindexx{macptr|see {\textit{also} macptr class}}
766 \addtoindexx{rangelistptr|see {\textit{also} rangelistptr class}}
767 \addtoindexx{reference|see {\textit{also} reference class}}
768 \addtoindexx{string|see {\textit{also} string class}}
769 \addtoindexx{stroffsetsptr|see {\textit{also} stroffsetsptr class}}
771 \addtoindexx{class of attribute value!address|see {address class}}
772 \addtoindexx{class of attribute value!addrptr|see {addrptr class}}
773 \addtoindexx{class of attribute value!block|see {block class}}
774 \addtoindexx{class of attribute value!constant|see {constant class}}
775 \addtoindexx{class of attribute value!exprloc|see {exprloc class}}
776 \addtoindexx{class of attribute value!flag|see {flag class}}
777 \addtoindexx{class of attribute value!lineptr|see {lineptr class}}
778 \addtoindexx{class of attribute value!loclistptr|see {loclistptr class}}
779 \addtoindexx{class of attribute value!macptr|see {macptr class}}
780 \addtoindexx{class of attribute value!rangelistptr|see {rangelistptr class}}
781 \addtoindexx{class of attribute value!reference|see {reference class}}
782 \addtoindexx{class of attribute value!string|see {string class}}
783 \addtoindexx{class of attribute value!stroffsetsptr|see {stroffsetsptr class}}
785 The permissible values
786 \addtoindexx{attribute value classes}
787 for an attribute belong to one or more classes of attribute
789 Each form class may be represented in one or more ways.
790 For example, some attribute values consist
791 of a single piece of constant data.
792 \doublequote{Constant data}
793 is the class of attribute value that those attributes may have.
794 There are several representations of constant data,
795 however (one, two, four, or eight bytes, and variable length
797 The particular representation for any given instance
798 of an attribute is encoded along with the attribute name as
799 part of the information that guides the interpretation of a
800 debugging information entry.
803 Attribute value forms belong
804 \addtoindexx{tag names!list of}
805 to one of the classes shown in Table \referfol{tab:classesofattributevalue}.
807 \begin{longtable}{l|P{11cm}}
808 \caption{Classes of attribute value}
809 \label{tab:classesofattributevalue} \\
810 \hline \bfseries Attribute Class & \bfseries General Use and Encoding \\ \hline
812 \bfseries Attribute Class & \bfseries General Use and Encoding \\ \hline
814 \hline \emph{Continued on next page}
819 \hypertarget{chap:classaddress}{}
820 \livelinki{datarep:classaddress}{address}{address class}
821 &Refers to some location in the address space of the \mbox{described} program.
824 \hypertarget{chap:classaddrptr}{}
825 \livelinki{datarep:classaddrptr}{addrptr}{addrptr class}
826 &Refers to a base location in the DWARF section that holds
827 a series of machine address values. Certain attributes \mbox{refer}
828 one of these addresses by indexing relative to this base
832 \hypertarget{chap:classblock}{}
833 \livelinki{datarep:classblock}{block}{block class}
834 & An arbitrary number of uninterpreted bytes of data.
837 \hypertarget{chap:classconstant}{}
838 \livelinki{datarep:classconstant}{constant}{constant class}
839 &One, two, four or eight bytes of uninterpreted data, or data
840 encoded in the variable length format known as LEB128
841 (see Section \refersec{datarep:variablelengthdata}).
843 \textit{Most constant values are integers of one kind or
844 another (codes, offsets, counts, and so on); these are
845 sometimes called \doublequote{integer constants} for emphasis.}
846 \addtoindexx{integer constant}
847 \addtoindexx{constant class!integer}
850 \hypertarget{chap:classexprloc}{}
851 \livelinki{datarep:classexprloc}{exprloc}{exprloc class}
852 &A DWARF expression for a value or a location in the \mbox{address} space of the described program.
855 \hypertarget{chap:classflag}{}
856 \livelinki{datarep:classflag}{flag}{flag class}
857 &A small constant that indicates the presence or absence of an attribute.
860 \hypertarget{chap:classlineptr}{}
861 \livelinki{datarep:classlineptr}{lineptr}{lineptr class}
862 &Refers to a location in the DWARF section that holds line number information.
865 \hypertarget{chap:classloclistptr}{}
866 \livelinki{datarep:classloclistptr}{loclistptr}{loclistptr class}
867 &Refers to a location in the DWARF section that holds \mbox{location} lists, which
868 describe objects whose location can change during their lifetime.
871 \hypertarget{chap:classmacptr}{}
872 \livelinki{datarep:classmacptr}{macptr}{macptr class}
873 & Refers to a location in the DWARF section that holds macro definition
877 \hypertarget{chap:classrangelistptr}{}
878 \livelinki{datarep:classrangelistptr}{rangelistptr}{rangelistptr class}
879 & Refers to a location in the DWARF section that holds non\dash contiguous address ranges.
882 \hypertarget{chap:classreference}{}
883 \livelinki{datarep:classreference}{reference}{reference class}
884 & Refers to one of the debugging information
885 entries that \mbox{describe} the program. There are four types of
886 \mbox{reference}. The first is an offset relative to the beginning
887 of the \mbox{compilation} unit in which the reference occurs and must
888 refer to an entry within that same compilation unit. The second
889 type of reference is the offset of a debugging \mbox{information}
890 entry in any compilation unit, including one different from
891 the unit containing the reference. The third type of reference
892 is an indirect reference to a
893 \addtoindexx{type signature}
894 type definition using a 64-bit \mbox{signature}
895 for that type. The fourth type of reference is a reference from within the
896 \dotdebuginfo{} section of the executable or shared object file to
897 a debugging information entry in the \dotdebuginfo{} section of
898 a \addtoindex{supplementary object file}.
901 \hypertarget{chap:classstring}{}
902 \livelinki{datarep:classstring}{string}{string class}
903 & A null\dash terminated sequence of zero or more
904 (non\dash null) bytes. Data in this class are generally
905 printable strings. Strings may be represented directly in
906 the debugging \mbox{information} entry or as an offset in a separate
910 \hypertarget{chap:classstroffsetsptr}{}
911 \livelinki{datarep:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class}
912 &Refers to a base location in the DWARF section that holds
913 a series of offsets in the DWARF section that holds strings.
914 Certain attributes refer to one of these offsets by indexing
915 \mbox{relative} to this base location. The resulting offset is then
916 used to index into the DWARF string section.
923 \section{Relationship of Debugging Information Entries}
924 \label{chap:relationshipofdebugginginformationentries}
926 A variety of needs can be met by permitting a single
927 \addtoindexx{debugging information entry!ownership relation}
928 debugging information entry to \doublequote{own} an arbitrary number
929 of other debugging entries and by permitting the same debugging
930 information entry to be one of many owned by another debugging
932 This makes it possible, for example, to
933 describe the static \livelink{chap:lexicalblock}{block} structure
934 within a source file,
935 to show the members of a structure, union, or class, and to
936 associate declarations with source files or source files
937 with shared object files.
941 The ownership relation
942 \addtoindexx{debugging information entry!ownership relation}
944 information entries is achieved naturally because the debugging
945 information is represented as a tree.
946 The nodes of the tree
947 are the debugging information entries themselves.
949 entries of any node are exactly those debugging information
950 entries owned by that node.
953 While the ownership relation
954 of the debugging information entries is represented as a
955 tree, other relations among the entries exist, for example,
956 a reference from an entry representing a variable to another
957 entry representing the type of that variable.
959 relations are taken into account, the debugging entries
960 form a graph, not a tree.
964 The tree itself is represented
965 by flattening it in prefix order.
966 Each debugging information
967 entry is defined either to have child entries or not to have
968 child entries (see Section \refersec{datarep:abbreviationstables}).
969 If an entry is defined not
970 to have children, the next physically succeeding entry is a
972 If an entry is defined to have children, the next
973 physically succeeding entry is its first child.
975 children are represented as siblings of the first child.
976 A chain of sibling entries is terminated by a null entry.
978 In cases where a producer of debugging information feels that
979 \hypertarget{chap:DWATsiblingdebugginginformationentryrelationship}{}
980 it will be important for consumers of that information to
981 quickly scan chains of sibling entries, while ignoring the
982 children of individual siblings, that producer may attach a
983 \addtoindexx{sibling attribute}
984 \DWATsiblingDEFN{} attribute
985 to any debugging information entry.
986 The value of this attribute is a reference to the sibling entry
987 of the entry to which the attribute is attached.
990 \section{Target Addressable Units and Addresses}
991 \label{chap:targetaddressableunitsandaddresses}
992 The standard assumes that the smallest directly
993 \addtoindex{addressable unit} of memory on the
994 target architecture is a byte consisting of eight bits.
996 \label{chap:targetaddresses}
997 Many places in this document refer to the size of an
998 \addtoindexx{size of an address|see{\textit{also} \texttt{address\_size}}}
999 \addtoindexi{address}{size of an address}
1000 \addtoindexx{address size|see{size of an address}}
1001 \addtoindexx{address size|see{\textit{also} \texttt{address\_size}}}
1002 on the target architecture (or equivalently, target machine)
1003 to which a DWARF description applies. For processors which
1004 can be configured to have different address sizes or different
1005 instruction sets, the intent is to refer to the configuration
1006 which is either the default for that processor or which is
1007 specified by the object file or executable file which contains
1008 the DWARF information.
1011 For example, if a particular target architecture supports
1012 both 32-bit and 64-bit addresses, the compiler will generate
1013 an object file which specifies that it contains executable
1014 code generated for one or the other of these
1015 \addtoindexx{size of an address}
1017 that case, the DWARF debugging information contained in this
1018 object file will use the same address size.
1022 Architectures which have multiple instruction sets are
1023 supported by the \texttt{isa} entry in the line number information
1024 (see Section \refersec{chap:statemachineregisters}).
1027 \section{DWARF Expressions}
1028 \label{chap:dwarfexpressions}
1029 DWARF expressions describe how to compute a value or name a
1030 location during debugging of a program.
1031 They are expressed in
1032 terms of DWARF operations that operate on a stack of values.
1034 All DWARF operations are encoded as a stream of opcodes that
1035 are each followed by zero or more literal operands.
1037 of operands is determined by the opcode.
1040 general operations that are defined here, operations that are
1041 specific to location descriptions are defined in
1042 Section \refersec{chap:locationdescriptions}.
1044 \subsection{General Operations}
1045 \label{chap:generaloperations}
1046 Each general operation represents a postfix operation on
1047 a simple stack machine.
1048 Each element of the stack has a type and a value, and can represent
1049 a value of any supported base type of the target machine. Instead of
1050 a base type, elements can have a
1051 \livetarg{chap:specialaddresstype}{special address type},
1052 which is an integral type that has the
1053 \addtoindex{size of an address} on the target machine and
1054 unspecified signedness. The value on the top of the stack after
1055 \doublequote{executing} the
1056 \addtoindex{DWARF expression}
1058 \addtoindexx{DWARF expression|see{\textit{also} location description}}
1059 taken to be the result (the address of the object, the
1060 value of the array bound, the length of a dynamic string,
1061 the desired value itself, and so on).
1064 \textit{While the abstract definition of the stack calls for variable-size entries
1065 able to hold any supported base type, in practice it is expected that each
1066 element of the stack can be represented as a fixed-size element large enough
1067 to hold a value of any type supported by the DWARF consumer for that target,
1068 plus a small identifier sufficient to encode the type of that element.
1069 Support for base types other than what is required to do address arithmetic
1070 is intended only for debugging of optimized code, and the completeness of the
1071 DWARF consumer's support for the full set of base types is a
1072 quality-of-implementation issue. If a consumer encounters a DWARF expression
1073 that uses a type it does not support, it should ignore the entire expression
1074 and report its inability to provide the requested information.}
1076 \textit{It should also be noted that floating-point arithmetic is highly dependent
1077 on the computational environment. It is not the intention of this expression
1078 evaluation facility to produce identical results to those produced by the
1079 program being debugged while executing on the target machine. Floating-point
1080 computations in this stack machine will be done with precision control and
1081 rounding modes as defined by the implementation.}
1084 \subsubsection{Literal Encodings}
1085 \label{chap:literalencodings}
1087 \addtoindexx{DWARF expression!literal encodings}
1088 following operations all push a value onto the DWARF
1090 \addtoindexx{DWARF expression!stack operations}
1091 Operations other than \DWOPconsttype{} push a value with the
1092 \specialaddresstype, and if the value of a constant in one of these
1093 operations is larger than can be stored in a single stack element,
1094 the value is truncated to the element size and the low-order bits
1095 are pushed on the stack.
1096 \begin{enumerate}[1. ]
1097 \itembfnl{\DWOPlitzeroTARG, \DWOPlitoneTARG, \dots, \DWOPlitthirtyoneTARG}
1098 The \DWOPlitnTARG{} operations encode the unsigned literal values
1099 from 0 through 31, inclusive.
1101 \itembfnl{\DWOPaddrTARG}
1102 The \DWOPaddrNAME{} operation has a single operand that encodes
1103 a machine address and whose size is the \addtoindex{size of an address}
1104 on the target machine.
1106 \itembfnl{\DWOPconstoneuTARG, \DWOPconsttwouTARG, \DWOPconstfouruTARG, \DWOPconsteightuTARG}
1108 The single operand of a \DWOPconstnuNAME{} operation provides a 1,
1109 2, 4, or 8-byte unsigned integer constant, respectively.
1111 \itembfnl{\DWOPconstonesTARG, \DWOPconsttwosTARG, \DWOPconstfoursTARG, \DWOPconsteightsTARG}
1112 The single operand of a \DWOPconstnsNAME{} operation provides a 1,
1113 2, 4, or 8-byte signed integer constant, respectively.
1115 \itembfnl{\DWOPconstuTARG}
1116 The single operand of the \DWOPconstuNAME{} operation provides
1117 an unsigned LEB128\addtoindexx{LEB128!unsigned} integer constant.
1119 \itembfnl{\DWOPconstsTARG}
1120 The single operand of the \DWOPconstsNAME{} operation provides
1121 a signed LEB128\addtoindexx{LEB128!unsigned} integer constant.
1124 \itembfnl{\DWOPaddrxTARG}
1125 The \DWOPaddrxNAME{} operation has a single operand that
1126 encodes an unsigned LEB128\addtoindexx{LEB128!unsigned} value,
1127 which is a zero-based index into the \dotdebugaddr{} section,
1128 where a machine address is stored.
1129 This index is relative to the value of the
1130 \DWATaddrbase{} attribute of the associated compilation unit.
1132 \itembfnl{\DWOPconstxTARG}
1133 The \DWOPconstxNAME{} operation has a single operand that
1134 encodes an unsigned LEB128\addtoindexx{LEB128!unsigned} value,
1135 which is a zero-based
1136 index into the \dotdebugaddr{} section, where a constant, the
1137 size of a machine address, is stored.
1138 This index is relative to the value of the
1139 \DWATaddrbase{} attribute of the associated compilation unit.
1142 \textit{The \DWOPconstxNAME{} operation is provided for constants that
1143 require link-time relocation but should not be
1144 interpreted by the consumer as a relocatable address
1145 (for example, offsets to thread-local storage).}
1148 \itembfnl{\DWOPconsttypeTARG}
1149 The \DWOPconsttypeNAME{} operation takes three operands. The first operand
1150 is an unsigned LEB128 integer that represents the offset of a debugging
1151 information entry in the current compilation unit, which must be a
1152 \DWTAGbasetype{} entry that provides the type of the constant provided. The
1153 second operand is 1-byte unsigned integer that specifies the size of the
1154 constant value, which is the same as the size of the base type referenced
1155 by the first operand. The third operand is a block of specified
1156 size that is to be interpreted as a value of the referenced type.
1158 \textit{While the size of the constant could be inferred from the base type
1159 definition, it is encoded explicitly into the operation so that the
1160 operation can be parsed easily without reference to the \dotdebuginfo{}
1166 \subsubsection{Register Values}
1167 \label{chap:registervalues}
1168 The following operations push a value onto the stack that is either the
1169 contents of a register or the result of adding the contents of a register
1170 to a given signed offset.
1171 \addtoindexx{DWARF expression!register based addressing}
1172 \DWOPregvaltype{} pushes the contents
1173 of the register together with the given base type, while the other operations
1174 push the result of adding the contents of a register to a given
1175 signed offset together with the \specialaddresstype.
1178 \begin{enumerate}[1. ]
1179 \itembfnl{\DWOPfbregTARG}
1180 The \DWOPfbregNAME{} operation provides a
1181 signed LEB128\addtoindexx{LEB128!signed} offset
1182 from the address specified by the location description in the
1183 \DWATframebase{} attribute of the current function. (This
1184 is typically a \doublequote{stack pointer} register plus or minus
1185 some offset. On more sophisticated systems it might be a
1186 location list that adjusts the offset according to changes
1187 in the stack pointer as the PC changes.)
1189 \itembfnl{\DWOPbregzeroTARG, \DWOPbregoneTARG, \dots, \DWOPbregthirtyoneTARG}
1190 The single operand of the \DWOPbregnTARG{}
1192 a signed LEB128\addtoindexx{LEB128!signed} offset from
1193 the specified register.
1195 \itembfnl{\DWOPbregxTARG}
1196 The \DWOPbregxNAME{} operation provides the sum of two values specified
1197 by its two operands. The first operand is a register number
1198 which is specified by an unsigned LEB128\addtoindexx{LEB128!unsigned}
1199 number. The second operand is a signed LEB128\addtoindexx{LEB128!signed} offset.
1202 \itembfnl{\DWOPregvaltypeTARG}
1203 The \DWOPregvaltypeNAME{} operation provides the contents of
1204 a given register interpreted as a value of a given type. The first
1205 operand is an unsigned LEB128\addtoindexx{LEB128!unsigned} number,
1206 which identifies a register whose contents is to
1207 be pushed onto the stack. The second operand is an
1208 unsigned LEB128\addtoindexx{LEB128!unsigned} number
1209 that represents the offset of a debugging information entry in the current
1210 compilation unit, which must be a \DWTAGbasetype{} entry that provides the
1211 type of the value contained in the specified register.
1216 \subsubsection{Stack Operations}
1217 \label{chap:stackoperations}
1219 \addtoindexx{DWARF expression!stack operations}
1220 operations manipulate the DWARF stack. Operations
1221 that index the stack assume that the top of the stack (most
1222 recently added entry) has index 0.
1224 The \DWOPdup{}, \DWOPdrop{}, \DWOPpick{}, \DWOPover{}, \DWOPswap{}
1225 and \DWOProt{} operations manipulate the elements of the stack as pairs
1226 consisting of the value together with its type identifier.
1227 The \DWOPderef{}, \DWOPderefsize{}, \DWOPxderef{}, \DWOPxderefsize{}
1228 and \DWOPformtlsaddress{}
1229 operations require the popped values to have an integral type, either the
1230 \specialaddresstype{} or some other integral base type, and push a
1231 value with the \specialaddresstype.
1232 \DWOPdereftype{} and \DWOPxdereftype{} operations have the
1233 same requirement on the popped values, but push a value together
1234 with the same type as the popped values.
1235 All other operations push a value together with the \specialaddresstype.
1237 \begin{enumerate}[1. ]
1238 \itembfnl{\DWOPdupTARG}
1239 The \DWOPdupNAME{} operation duplicates the value (including its
1240 type identifier) at the top of the stack.
1242 \itembfnl{\DWOPdropTARG}
1243 The \DWOPdropNAME{} operation pops the value (including its type
1244 identifier) at the top of the stack.
1246 \itembfnl{\DWOPpickTARG}
1247 The single operand of the \DWOPpickNAME{} operation provides a
1248 1-byte index. A copy of the stack entry (including its
1249 type identifier) with the specified
1250 index (0 through 255, inclusive) is pushed onto the stack.
1252 \itembfnl{\DWOPoverTARG}
1253 The \DWOPoverNAME{} operation duplicates the entry currently second
1254 in the stack at the top of the stack.
1255 This is equivalent to a
1256 \DWOPpick{} operation, with index 1.
1259 \itembfnl{\DWOPswapTARG}
1260 The \DWOPswapNAME{} operation swaps the top two stack entries.
1261 The entry at the top of the stack (including its type identifier)
1262 becomes the second stack entry, and the second entry (including
1263 its type identifier) becomes the top of the stack.
1265 \itembfnl{\DWOProtTARG}
1266 The \DWOProtNAME{} operation rotates the first three stack
1267 entries. The entry at the top of the stack (including its
1268 type identifier) becomes the third stack entry, the second
1269 entry (including its type identifier) becomes the top of
1270 the stack, and the third entry (including its type identifier)
1271 becomes the second entry.
1273 \itembfnl{\DWOPderefTARG}
1274 The \DWOPderefNAME{} operation pops the top stack entry and
1275 treats it as an address. The popped value must have an integral type.
1276 The value retrieved from that address is pushed, together with the
1277 \specialaddresstype{} identifier.
1278 The size of the data retrieved from the
1279 \addtoindexi{dereferenced}{address!dereference operator}
1280 address is the \addtoindex{size of an address} on the target machine.
1283 \itembfnl{\DWOPderefsizeTARG}
1284 The \DWOPderefsizeNAME{} operation behaves like the
1286 operation: it pops the top stack entry and treats it as an
1287 address. The popped value must have an integral type.
1288 The value retrieved from that address is pushed, together with the
1289 \specialaddresstype{} identifier. In
1290 the \DWOPderefsizeNAME{} operation, however, the size in bytes
1291 of the data retrieved from the dereferenced address is
1292 specified by the single operand. This operand is a 1-byte
1293 unsigned integral constant whose value may not be larger
1294 than the size of the \specialaddresstype. The data
1295 retrieved is zero extended to the size of an address on the
1296 target machine before being pushed onto the expression stack.
1298 \itembfnl{\DWOPdereftypeTARG}
1299 The \DWOPdereftypeNAME{} operation behaves like the \DWOPderefsize{} operation:
1300 it pops the top stack entry and treats it as an address.
1301 The popped value must have an integral type.
1302 The value retrieved from that address is pushed together with a type identifier.
1303 In the \DWOPdereftypeNAME{} operation, the size in
1304 bytes of the data retrieved from the dereferenced address is specified by
1305 the first operand. This operand is a 1-byte unsigned integral constant whose
1306 value which is the same as the size of the base type referenced
1307 by the second operand.
1308 The second operand is an unsigned LEB128 integer that
1309 represents the offset of a debugging information entry in the current
1310 compilation unit, which must be a \DWTAGbasetype{} entry that provides the
1311 type of the data pushed.
1313 \textit{While the size of the pushed value could be inferred from the base
1314 type definition, it is encoded explicitly into the operation so that the
1315 operation can be parsed easily without reference to the \dotdebuginfo{}
1319 \itembfnl{\DWOPxderefTARG}
1320 The \DWOPxderefNAME{} operation provides an extended dereference
1321 mechanism. The entry at the top of the stack is treated as an
1322 address. The second stack entry is treated as an \doublequote{address
1323 space identifier} for those architectures that support
1324 \addtoindexi{multiple}{address space!multiple}
1326 Both of these entries must have integral type identifiers.
1327 The top two stack elements are popped,
1328 and a data item is retrieved through an implementation-defined
1329 address calculation and pushed as the new stack top together with the
1330 \specialaddresstype{} identifier.
1331 The size of the data retrieved from the
1332 \addtoindexi{dereferenced}{address!dereference operator}
1333 address is the size of the \specialaddresstype.
1335 \itembfnl{\DWOPxderefsizeTARG}
1336 The \DWOPxderefsizeNAME{} operation behaves like the
1337 \DWOPxderef{} operation. The entry at the top of the stack is
1338 treated as an address. The second stack entry is treated as
1339 an \doublequote{address space identifier} for those architectures
1341 \addtoindexi{multiple}{address space!multiple}
1343 Both of these entries must have integral type identifiers.
1345 elements are popped, and a data item is retrieved through an
1346 implementation\dash defined address calculation and pushed as the
1347 new stack top. In the \DWOPxderefsizeNAME{} operation, however,
1348 the size in bytes of the data retrieved from the
1349 \addtoindexi{dereferenced}{address!dereference operator}
1350 address is specified by the single operand. This operand is a
1351 1-byte unsigned integral constant whose value may not be larger
1352 than the \addtoindex{size of an address} on the target machine. The data
1353 retrieved is zero extended to the \addtoindex{size of an address} on the
1354 target machine before being pushed onto the expression stack together
1355 with the \specialaddresstype{} identifier.
1357 \itembfnl{\DWOPxdereftypeTARG}
1358 The \DWOPxdereftypeNAME{} operation behaves like the \DWOPxderefsize{}
1359 operation: it pops the top two stack entries, treats them as an address and
1360 an address space identifier, and pushes the value retrieved. In the
1361 \DWOPxdereftypeNAME{} operation, the size in bytes of the data retrieved from
1362 the dereferenced address is specified by the first operand. This operand is
1363 a 1-byte unsigned integral constant whose value
1364 value which is the same as the size of the base type referenced
1365 by the second operand. The second
1366 operand is an unsigned LEB128 integer that represents the offset of a
1367 debugging information entry in the current compilation unit, which must be a
1368 \DWTAGbasetype{} entry that provides the type of the data pushed.
1371 \itembfnl{\DWOPpushobjectaddressTARG}
1372 The \DWOPpushobjectaddressNAME{}
1373 operation pushes the address
1374 of the object currently being evaluated as part of evaluation
1375 of a user presented expression. This object may correspond
1376 to an independent variable described by its own debugging
1377 information entry or it may be a component of an array,
1378 structure, or class whose address has been dynamically
1379 determined by an earlier step during user expression
1382 \textit{This operator provides explicit functionality
1383 (especially for arrays involving descriptors) that is analogous
1384 to the implicit push of the base
1385 \addtoindexi{address}{address!implicit push of base}
1386 of a structure prior to evaluation of a
1387 \DWATdatamemberlocation{}
1388 to access a data member of a structure. For an example, see
1389 Appendix \refersec{app:aggregateexamples}.}
1392 \itembfnl{\DWOPformtlsaddressTARG}
1393 The \DWOPformtlsaddressNAME{}
1394 operation pops a value from the stack, which must have an
1395 integral type identifier, translates this
1396 value into an address in the
1397 \addtoindex{thread-local storage}
1398 for a thread, and pushes the address
1399 onto the stack together with the \specialaddresstype{} identifier.
1400 The meaning of the value on the top of the stack prior to this
1401 operation is defined by the run-time environment. If the run-time
1402 environment supports multiple thread-local storage
1403 \nolink{blocks} for a single thread, then the \nolink{block}
1404 corresponding to the executable or shared
1405 library containing this DWARF expression is used.
1407 \textit{Some implementations of
1408 \addtoindex{C}, \addtoindex{C++}, \addtoindex{Fortran}, and other
1409 languages, support a
1410 thread-local storage class. Variables with this storage class
1411 have distinct values and addresses in distinct threads, much
1412 as automatic variables have distinct values and addresses in
1413 each function invocation. Typically, there is a single \nolink{block}
1414 of storage containing all thread\dash local variables declared in
1415 the main executable, and a separate \nolink{block} for the variables
1416 declared in each shared library. Each
1417 thread\dash local variable can then be accessed in its block using an
1418 identifier. This identifier is typically an offset into the block and
1419 pushed onto the DWARF stack by one of the
1420 \DWOPconstnx{} operations prior to the
1421 \DWOPformtlsaddress{} operation.
1422 Computing the address of
1423 the appropriate \nolink{block} can be complex (in some cases, the
1424 compiler emits a function call to do it), and difficult
1425 to describe using ordinary DWARF location descriptions.
1426 Instead of forcing complex thread-local storage calculations into
1427 the DWARF expressions, the \DWOPformtlsaddress{} allows the consumer
1428 to perform the computation based on the run-time environment.}
1431 \itembfnl{\DWOPcallframecfaTARG}
1432 The \DWOPcallframecfaNAME{}
1433 operation pushes the value of the
1434 CFA, obtained from the Call Frame Information
1435 (see Section \refersec{chap:callframeinformation}).
1437 \textit{Although the value of \DWATframebase{}
1438 can be computed using other DWARF expression operators,
1439 in some cases this would require an extensive location list
1440 because the values of the registers used in computing the
1441 CFA change during a subroutine. If the
1442 Call Frame Information
1443 is present, then it already encodes such changes, and it is
1444 space efficient to reference that.}
1447 \textit{Examples illustrating many of these stack operations are
1448 found in Appendix \refersec{app:dwarfstackoperationexamples}.}
1450 \subsubsection{Arithmetic and Logical Operations}
1451 \addtoindexx{DWARF expression!arithmetic operations}
1452 \addtoindexx{DWARF expression!logical operations}
1453 The following provide arithmetic and logical operations. If an operation
1454 pops two values from the stack, both values must have the same type,
1455 either the same base type or both the \specialaddresstype.
1456 The result of the operation which is pushed back has the same type
1457 as the type of the operands.
1459 If the type of the operands is the \specialaddresstype,
1460 except as otherwise specified, the arithmetic operations
1461 perform addressing arithmetic, that is, unsigned arithmetic that is performed
1462 modulo one plus the largest representable address (for example, 0x100000000
1463 when the \addtoindex{size of an address} is 32 bits).
1465 Operations other than \DWOPabs{},
1466 \DWOPdiv{}, \DWOPminus{}, \DWOPmul{}, \DWOPneg{} and \DWOPplus{}
1467 require integral types of the operand (either integral base type
1468 or the \specialaddresstype). Operations do not cause an exception
1472 \begin{enumerate}[1. ]
1473 \itembfnl{\DWOPabsTARG}
1474 The \DWOPabsNAME{} operation pops the top stack entry, interprets
1475 it as a signed value and pushes its absolute value. If the
1476 absolute value cannot be represented, the result is undefined.
1479 \itembfnl{\DWOPandTARG}
1480 The \DWOPandNAME{} operation pops the top two stack values, performs
1481 a bitwise and operation on the two, and pushes the result.
1483 \itembfnl{\DWOPdivTARG}
1484 The \DWOPdivNAME{} operation pops the top two stack values, divides the former second entry by
1485 the former top of the stack using signed division, and pushes the result.
1487 \itembfnl{\DWOPminusTARG}
1488 The \DWOPminusNAME{} operation pops the top two stack values, subtracts the former top of the
1489 stack from the former second entry, and pushes the result.
1491 \itembfnl{\DWOPmodTARG}
1492 The \DWOPmodNAME{} operation pops the top two stack values and pushes the result of the
1493 calculation: former second stack entry modulo the former top of the stack.
1496 \itembfnl{\DWOPmulTARG}
1497 The \DWOPmulNAME{} operation pops the top two stack entries, multiplies them together, and
1500 \itembfnl{\DWOPnegTARG}
1501 The \DWOPnegNAME{} operation pops the top stack entry, interprets
1502 it as a signed value and pushes its negation. If the negation
1503 cannot be represented, the result is undefined.
1505 \itembfnl{\DWOPnotTARG}
1506 The \DWOPnotNAME{} operation pops the top stack entry, and pushes
1507 its bitwise complement.
1509 \itembfnl{\DWOPorTARG}
1510 The \DWOPorNAME{} operation pops the top two stack entries, performs
1511 a bitwise or operation on the two, and pushes the result.
1513 \itembfnl{\DWOPplusTARG}
1514 The \DWOPplusNAME{} operation pops the top two stack entries,
1515 adds them together, and pushes the result.
1518 \itembfnl{\DWOPplusuconstTARG}
1519 The \DWOPplusuconstNAME{} operation pops the top stack entry,
1520 adds it to the unsigned LEB128\addtoindexx{LEB128!unsigned}
1521 constant operand and pushes the result.
1523 \textit{This operation is supplied specifically to be
1524 able to encode more field offsets in two bytes than can be
1526 \doublequote{\DWOPlitn~\DWOPplus.}}
1529 \itembfnl{\DWOPshlTARG}
1530 The \DWOPshlNAME{} operation pops the top two stack entries,
1531 shifts the former second entry left (filling with zero bits)
1532 by the number of bits specified by the former top of the stack,
1533 and pushes the result.
1535 \itembfnl{\DWOPshrTARG}
1536 The \DWOPshrNAME{} operation pops the top two stack entries,
1537 shifts the former second entry right logically (filling with
1538 zero bits) by the number of bits specified by the former top
1539 of the stack, and pushes the result.
1542 \itembfnl{\DWOPshraTARG}
1543 The \DWOPshraNAME{} operation pops the top two stack entries,
1544 shifts the former second entry right arithmetically (divide
1545 the magnitude by 2, keep the same sign for the result) by
1546 the number of bits specified by the former top of the stack,
1547 and pushes the result.
1549 \itembfnl{\DWOPxorTARG}
1550 The \DWOPxorNAME{} operation pops the top two stack entries,
1551 performs a bitwise exclusive\dash or operation on the two, and
1556 \subsubsection{Control Flow Operations}
1557 \label{chap:controlflowoperations}
1559 \addtoindexx{DWARF expression!control flow operations}
1560 following operations provide simple control of the flow of a DWARF expression.
1561 \begin{enumerate}[1. ]
1562 \itembfnl{\DWOPleTARG, \DWOPgeTARG, \DWOPeqTARG, \DWOPltTARG, \DWOPgtTARG, \DWOPneTARG}
1563 The six relational operators each:
1565 \item pop the top two stack values, which should both have the same type,
1566 either the same base type or both the \specialaddresstype,
1568 \item compare the operands:
1570 \textless~former second entry~\textgreater \textless~relational operator~\textgreater \textless~former top entry~\textgreater
1572 \item push the constant value 1 onto the stack
1573 if the result of the operation is true or the
1574 constant value 0 if the result of the operation is false.
1575 The pushed value has the \specialaddresstype.
1578 If the operands have the \specialaddresstype, the comparisons
1579 are performed as signed operations.
1580 The six operators are \DWOPleNAME{} (less than or equal to), \DWOPgeNAME{}
1581 (greater than or equal to), \DWOPeqNAME{} (equal to), \DWOPltNAME{} (less
1582 than), \DWOPgtNAME{} (greater than) and \DWOPneNAME{} (not equal to).
1585 \itembfnl{\DWOPskipTARG}
1586 \DWOPskipNAME{} is an unconditional branch. Its single operand
1587 is a 2-byte signed integer constant. The 2-byte constant is
1588 the number of bytes of the DWARF expression to skip forward
1589 or backward from the current operation, beginning after the
1592 \itembfnl{\DWOPbraTARG}
1593 \DWOPbraNAME{} is a conditional branch. Its single operand is a
1594 2-byte signed integer constant. This operation pops the
1595 top of stack. If the value popped is not the constant 0,
1596 the 2-byte constant operand is the number of bytes of the
1597 DWARF expression to skip forward or backward from the current
1598 operation, beginning after the 2-byte constant.
1600 % The following item does not correctly hyphenate leading
1601 % to an overfull hbox and a visible artifact.
1602 % So we use \- to suggest hyphenation in this rare situation.
1603 \itembfnl{\DWOPcalltwoTARG, \DWOPcallfourTARG, \DWOPcallrefTARG}
1606 and \DWOPcallrefNAME{} perform
1607 DWARF procedure calls during evaluation of a DWARF expression or
1608 location description.
1609 For \DWOPcalltwoNAME{} and \DWOPcallfourNAME{},
1610 the operand is the 2\dash~ or 4-byte unsigned offset, respectively,
1611 of a debugging information entry in the current compilation
1612 unit. The \DWOPcallrefNAME{} operator has a single operand. In the
1613 \thirtytwobitdwarfformat,
1614 the operand is a 4-byte unsigned value;
1615 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1616 (see Section \referfol{datarep:32bitand64bitdwarfformats}).
1617 The operand is used as the offset of a
1618 debugging information entry in a
1620 section which may be contained in an executable or shared object file
1621 other than that containing the operator. For references from
1622 one executable or shared object file to another, the relocation
1623 must be performed by the consumer.
1625 \textit{Operand interpretation of
1626 \DWOPcalltwo, \DWOPcallfour{} and \DWOPcallref{} is exactly like
1627 that for \DWFORMreftwo, \DWFORMreffour{} and \DWFORMrefaddr,
1629 (see Section \refersec{datarep:attributeencodings}).
1632 These operations transfer
1633 control of DWARF expression evaluation to
1634 \addtoindexx{location attribute}
1637 attribute of the referenced debugging information entry. If
1638 there is no such attribute, then there is no effect. Execution
1639 of the DWARF expression of
1640 \addtoindexx{location attribute}
1642 \DWATlocation{} attribute may add
1643 to and/or remove from values on the stack. Execution returns
1644 to the point following the call when the end of the attribute
1645 is reached. Values on the stack at the time of the call may be
1646 used as parameters by the called expression and values left on
1647 the stack by the called expression may be used as return values
1648 by prior agreement between the calling and called expressions.
1651 \subsubsection{Type Conversions}
1652 \label{chap:typeconversions}
1653 The following operations provides for explicit type conversion.
1655 \begin{enumerate}[1. ]
1656 \itembfnl{\DWOPconvertTARG}
1657 The \DWOPconvertNAME{} operation pops the top stack entry, converts it to a
1658 different type, then pushes the result. It takes one operand, which is an
1659 unsigned LEB128 integer that represents the offset of a debugging
1660 information entry in the current compilation unit, or value 0 which
1661 represents the \specialaddresstype. If the operand is non-zero, the
1662 referenced entry must be a \DWTAGbasetype{} entry that provides the type
1663 to which the value is converted.
1665 \itembfnl{\DWOPreinterpretTARG}
1666 The \DWOPreinterpretNAME{} operation pops the top stack entry, reinterprets
1667 the bits in its value as a value of a different type, then pushes the
1668 result. It takes one operand, which is an unsigned LEB128 integer that
1669 represents the offset of a debugging information entry in the current
1670 compilation unit, or value 0 which represents the \specialaddresstype.
1671 If the operand is non-zero, the referenced entry must be a
1672 \DWTAGbasetype{} entry that provides the type to which the value is converted.
1673 The type of the operand and result type should have the same size in bits.
1678 \subsubsection{Special Operations}
1679 \label{chap:specialoperations}
1681 \addtoindexx{DWARF expression!special operations}
1682 are these special operations currently defined:
1683 \begin{enumerate}[1. ]
1684 \itembfnl{\DWOPnopNAME}
1685 The \DWOPnopTARG{} operation is a place holder. It has no effect
1686 on the location stack or any of its values.
1688 \itembfnl{\DWOPentryvalueNAME}
1689 The \DWOPentryvalueTARG{} operation pushes a value that had a known location
1690 upon entering the current subprogram. It has two operands: an
1691 unsigned LEB128\addtoindexx{LEB128!unsigned} length, followed by
1692 a block containing a DWARF expression or a register location description
1693 (see Section \refersec{chap:registerlocationdescriptions}).
1694 The length operand specifies the length
1695 in bytes of the block. If the block contains a register location
1696 description, \DWOPentryvalueNAME{} pushes the value that register had upon
1697 entering the current subprogram. If the block contains a DWARF expression,
1698 the DWARF expression is evaluated as if it has been evaluated upon entering
1699 the current subprogram. The DWARF expression should not assume any values
1700 being present on the DWARF stack initially and should result in exactly one
1701 value being pushed on the DWARF stack when completed. That value is the value
1702 being pushed by the \DWOPentryvalueNAME{} operation.
1704 \DWOPpushobjectaddress{} is not meaningful inside of this DWARF operation.
1706 \textit{The \DWOPentryvalueNAME{} operation can be used by consumers if they are able
1707 to find the call site in the caller function, can unwind to it, and the corresponding
1708 \DWTAGcallsiteparameter{} entry has \DWATcallvalue{} or
1709 \DWATcalldatavalue{} attributes that can be evaluated to find the
1710 value a function parameter had on the first instruction in the function.
1711 Non-interactive consumers which know what variables will need to be
1712 inspected in advance of running the debugged program could put breakpoints
1713 on the first instruction in functions where there is no way to find
1714 some variable's value other than by evaluating the \DWOPentryvalueNAME{}
1715 operation. The consumer can collect the value of registers or
1716 memory referenced in
1717 \DWOPentryvalueNAME{} operations, then continue to breakpoints where the values
1718 of variables or parameters need to be inspected and use the remembered
1719 register or memory values during \DWOPentryvalueNAME{} evaluation.}
1724 \section{Location Descriptions}
1725 \label{chap:locationdescriptions}
1726 \textit{Debugging information
1727 \addtoindexx{location description}
1729 \addtoindexx{location description|see{\textit{also} DWARF expression}}
1730 provide consumers a way to find
1731 the location of program variables, determine the bounds
1732 of dynamic arrays and strings, and possibly to find the
1733 base address of a subroutine\textquoteright s stack frame or the return
1734 address of a subroutine. Furthermore, to meet the needs of
1735 recent computer architectures and optimization techniques,
1736 debugging information must be able to describe the location of
1737 an object whose location changes over the object\textquoteright s lifetime.}
1739 Information about the location of program objects is provided
1740 by location descriptions. Location descriptions can be either
1742 \begin{enumerate}[1. ]
1743 \item \textit{Single location descriptions},
1745 \addtoindexx{location description!single}
1747 \addtoindexx{single location description}
1748 a language independent representation of
1749 addressing rules of arbitrary complexity built from
1750 DWARF expressions (See Section \refersec{chap:dwarfexpressions})
1752 DWARF operations specific to describing locations. They are
1753 sufficient for describing the location of any object as long
1754 as its lifetime is either static or the same as the
1755 \livelink{chap:lexicalblock}{lexical block} that owns it,
1756 and it does not move during its lifetime.
1758 Single location descriptions are of two kinds:
1759 \begin{enumerate}[a) ]
1760 \item Simple location descriptions, which describe the location
1761 \addtoindexx{location description!simple}
1762 of one contiguous piece (usually all) of an object. A simple
1763 location description may describe a location in addressable
1764 memory, or in a register, or the lack of a location (with or
1765 without a known value).
1767 \item Composite location descriptions, which describe an
1768 \addtoindexx{location description!composite}
1769 object in terms of pieces each of which may be contained in
1770 part of a register or stored in a memory location unrelated
1776 \item \textit{Location lists}, which are used to
1777 \addtoindexx{location list}
1779 \addtoindexx{location description!use in location list}
1780 objects that have a limited lifetime or change their location
1781 during their lifetime. Location lists are described in
1782 Section \refersec{chap:locationlists} below.
1786 Location descriptions are distinguished in a context sensitive
1787 manner. As the value of an attribute, a location description
1789 \addtoindexx{exprloc class}
1790 class \livelink{chap:classexprloc}{exprloc}
1791 and a location list is encoded
1792 using class \livelink{chap:classloclistptr}{loclistptr}
1794 \addtoindex{loclistptr}
1795 serves as an offset into a
1797 \addtoindexx{location list}
1798 location list table).
1801 \subsection{Single Location Descriptions}
1802 A single location description is either:
1803 \begin{enumerate}[1. ]
1804 \item A simple location description, representing an object
1805 \addtoindexx{location description!simple}
1807 \addtoindexx{simple location description}
1808 exists in one contiguous piece at the given location, or
1809 \item A composite location description consisting of one or more
1810 \addtoindexx{location description!composite}
1811 simple location descriptions, each of which is followed by
1812 one composition operation. Each simple location description
1813 describes the location of one piece of the object; each
1814 composition operation describes which part of the object is
1815 located there. Each simple location description that is a
1816 DWARF expression is evaluated independently of any others
1817 (as though on its own separate stack, if any).
1822 \subsubsection{Simple Location Descriptions}
1824 \addtoindexx{location description!simple}
1825 simple location description consists of one
1826 contiguous piece or all of an object or value.
1829 \subsubsubsection{Memory Location Descriptions}
1831 \addtoindexx{location description!memory}
1832 memory location description
1833 \addtoindexx{memory location description}
1834 consists of a non\dash empty DWARF
1836 Section \refersec{chap:dwarfexpressions}
1837 ), whose value is the address of
1838 a piece or all of an object or other entity in memory.
1840 \subsubsubsection{Register Location Descriptions}
1841 \label{chap:registerlocationdescriptions}
1842 A register location description consists of a register name
1843 operation, which represents a piece or all of an object
1844 located in a given register.
1846 \textit{Register location descriptions describe an object
1847 (or a piece of an object) that resides in a register, while
1848 the opcodes listed in
1849 Section \refersec{chap:registervalues}
1850 are used to describe an object (or a piece of
1851 an object) that is located in memory at an address that is
1852 contained in a register (possibly offset by some constant). A
1853 register location description must stand alone as the entire
1854 description of an object or a piece of an object.
1857 The following DWARF operations can be used to name a register.
1860 \textit{Note that the register number represents a DWARF specific
1861 mapping of numbers onto the actual registers of a given
1862 architecture. The mapping should be chosen to gain optimal
1863 density and should be shared by all users of a given
1864 architecture. It is recommended that this mapping be defined
1865 by the ABI authoring committee for each architecture.
1867 \begin{enumerate}[1. ]
1868 \itembfnl{\DWOPregzeroTARG, \DWOPregoneTARG, ..., \DWOPregthirtyoneTARG}
1869 The \DWOPregnTARG{} operations encode the names of up to 32
1870 registers, numbered from 0 through 31, inclusive. The object
1871 addressed is in register \textit{n}.
1874 \itembfnl{\DWOPregxTARG}
1875 The \DWOPregxNAME{} operation has a single
1876 unsigned LEB128\addtoindexx{LEB128!unsigned} literal
1877 operand that encodes the name of a register.
1881 \textit{These operations name a register location. To
1882 fetch the contents of a register, it is necessary to use
1883 one of the register based addressing operations, such as
1885 (Section \refersec{chap:registervalues})}.
1887 \subsubsubsection{Implicit Location Descriptions}
1888 An \addtoindex{implicit location description}
1889 represents a piece or all
1890 \addtoindexx{location description!implicit}
1891 of an object which has no actual location but whose contents
1892 are nonetheless either known or known to be undefined.
1894 The following DWARF operations may be used to specify a value
1895 that has no location in the program but is a known constant
1896 or is computed from other locations and values in the program.
1897 \begin{enumerate}[1. ]
1898 \itembfnl{\DWOPimplicitvalueTARG}
1899 The \DWOPimplicitvalueNAME{}
1900 operation specifies an immediate value
1901 using two operands: an unsigned LEB128\addtoindexx{LEB128!unsigned}
1903 %FIXME: should this block be a reference? To what?
1904 a \nolink{block} representing the value in the memory representation
1905 of the target machine. The length operand gives the length
1906 in bytes of the \nolink{block}.
1908 \itembfnl{\DWOPstackvalueTARG}
1909 The \DWOPstackvalueNAME{}
1910 operation specifies that the object
1911 does not exist in memory but its value is nonetheless known
1912 and is at the top of the DWARF expression stack. In this form
1913 of location description, the DWARF expression represents the
1914 actual value of the object, rather than its location. The
1915 \DWOPstackvalueNAME{} operation terminates the expression.
1918 \itembfnl{\DWOPimplicitpointerTARG}
1919 The \DWOPimplicitpointerNAME{} operation specifies that the object
1920 is a pointer that cannot be represented as a real pointer,
1921 even though the value it would point to can be described. In
1922 this form of location description, the DWARF expression refers
1923 to a debugging information entry that represents the actual
1924 value of the object to which the pointer would point. Thus, a
1925 consumer of the debug information would be able to show the
1926 value of the dereferenced pointer, even when it cannot show
1927 the value of the pointer itself.
1930 The \DWOPimplicitpointerNAME{} operation has two operands: a
1931 reference to a debugging information entry that describes
1932 the dereferenced object's value, and a signed number that
1933 is treated as a byte offset from the start of that value.
1934 The first operand is a 4-byte unsigned value in the 32-bit
1935 DWARF format, or an 8-byte unsigned value in the 64-bit
1936 DWARF format (see Section
1937 \refersec{datarep:32bitand64bitdwarfformats}).
1938 The second operand is a
1939 signed LEB128\addtoindexx{LEB128!signed} number.
1941 The first operand is used as the offset of a debugging
1942 information entry in a \dotdebuginfo{} section, which may be
1943 contained in an executable or shared object file other than that
1944 containing the operator. For references from one executable or
1945 shared object file to another, the relocation must be performed
1948 \textit{The debugging information entry referenced by a
1949 \DWOPimplicitpointerNAME{} operation is typically a
1950 \DWTAGvariable{} or \DWTAGformalparameter{} entry whose
1951 \DWATlocation{} attribute gives a second DWARF expression or a
1952 location list that describes the value of the object, but the
1953 referenced entry may be any entry that contains a \DWATlocation{}
1954 or \DWATconstvalue{} attribute (for example, \DWTAGdwarfprocedure).
1955 By using the second DWARF expression, a consumer can
1956 reconstruct the value of the object when asked to dereference
1957 the pointer described by the original DWARF expression
1958 containing the \DWOPimplicitpointer{} operation.}
1962 \textit{DWARF location expressions are intended to yield the \textbf{location}
1963 of a value rather than the value itself. An optimizing compiler
1964 may perform a number of code transformations where it becomes
1965 impossible to give a location for a value, but it remains possible
1966 to describe the value itself.
1967 Section \refersec{chap:registerlocationdescriptions}
1968 describes operators that can be used to
1969 describe the location of a value when that value exists in a
1970 register but not in memory. The operations in this section are
1971 used to describe values that exist neither in memory nor in a
1974 \subsubsubsection{Empty Location Descriptions}
1975 An \addtoindex{empty location description}
1976 consists of a DWARF expression
1977 \addtoindexx{location description!empty}
1978 containing no operations. It represents a piece or all of an
1979 object that is present in the source but not in the object code
1980 (perhaps due to optimization).
1983 \subsubsection{Composite Location Descriptions}
1984 A composite location description describes an object or
1985 value which may be contained in part of a register or stored
1986 in more than one location. Each piece is described by a
1987 composition operation, which does not compute a value nor
1988 store any result on the DWARF stack. There may be one or
1989 more composition operations in a single composite location
1990 description. A series of such operations describes the parts
1991 of a value in memory address order.
1993 Each composition operation is immediately preceded by a simple
1994 location description which describes the location where part
1995 of the resultant value is contained.
1996 \begin{enumerate}[1. ]
1997 \itembfnl{\DWOPpieceTARG}
1998 The \DWOPpieceNAME{} operation takes a
1999 single operand, which is an
2000 unsigned LEB128\addtoindexx{LEB128!unsigned} number.
2001 The number describes the size in bytes
2002 of the piece of the object referenced by the preceding simple
2003 location description. If the piece is located in a register,
2004 but does not occupy the entire register, the placement of
2005 the piece within that register is defined by the ABI.
2007 \textit{Many compilers store a single variable in sets of registers,
2008 or store a variable partially in memory and partially in
2009 registers. \DWOPpieceNAME{} provides a way of describing how large
2010 a part of a variable a particular DWARF location description
2013 \itembfnl{\DWOPbitpieceTARG}
2014 The \DWOPbitpieceNAME{}
2015 operation takes two operands. The first
2016 is an unsigned LEB128\addtoindexx{LEB128!unsigned}
2017 number that gives the size in bits
2018 of the piece. The second is an
2019 unsigned LEB128\addtoindexx{LEB128!unsigned} number that
2020 gives the offset in bits from the location defined by the
2021 preceding DWARF location description.
2023 Interpretation of the
2024 offset depends on the kind of location description. If the
2025 location description is empty, the offset doesn\textquoteright t matter and
2026 the \DWOPbitpieceNAME{} operation describes a piece consisting
2027 of the given number of bits whose values are undefined. If
2028 the location is a register, the offset is from the least
2029 significant bit end of the register. If the location is a
2030 memory address, the \DWOPbitpieceNAME{} operation describes a
2031 sequence of bits relative to the location whose address is
2032 on the top of the DWARF stack using the bit numbering and
2033 direction conventions that are appropriate to the current
2034 language on the target system. If the location is any implicit
2035 value or stack value, the \DWOPbitpieceNAME{} operation describes
2036 a sequence of bits using the least significant bits of that
2040 \textit{\DWOPbitpieceNAME{} is
2041 used instead of \DWOPpieceNAME{} when
2042 the piece to be assembled into a value or assigned to is not
2043 byte-sized or is not at the start of a register or addressable
2047 \subsection{Location Lists}
2048 \label{chap:locationlists}
2049 There are two forms of location lists. The first form
2050 is intended for use in other than a \splitDWARFobjectfile,
2051 while the second is intended for use in a \splitDWARFobjectfile{}
2052 (see Section \refersec{datarep:splitdwarfobjectfiles}). The two
2053 forms are otherwise equivalent.
2055 \textit{The form for \splitDWARFobjectfile{s} is new in \DWARFVersionV.}
2057 \subsubsection{Location Lists in Non-split Objects}
2058 \label{chap:locationlistsinnonsplitobjects}
2060 \addtoindexx{location list}
2061 are used in place of location expressions
2062 whenever the object whose location is being described
2063 can change location during its lifetime.
2065 \addtoindexx{location list}
2066 are contained in a separate object file section called
2067 \dotdebugloc{}. A location list is indicated by a location
2068 attribute whose value is an offset from the beginning of
2069 the \dotdebugloc{} section to the first byte of the list for the
2072 The \addtoindex{applicable base address} of a normal
2073 location list entry (see following) is
2074 \addtoindexx{location list!base address selection entry}
2075 determined by the closest preceding base address selection
2076 entry in the same location list. If there is
2077 no such selection entry, then the applicable base address
2078 defaults to the base address of the compilation unit (see
2079 Section \refersec{chap:normalandpartialcompilationunitentries}).
2081 \textit{In the case of a compilation unit where all of
2082 the machine code is contained in a single contiguous section,
2083 no base address selection entry is needed.}
2085 Each entry in a location list is either a location
2086 \addtoindexi{list}{address selection|see{base address selection}}
2089 \addtoindexi{base}{base address selection entry!in location list}
2090 address selection entry,
2091 \addtoindexx{location list!base address selection entry}
2093 \addtoindexx{end-of-list entry!in location list}
2096 \subsubsubsection{Location List Entry}
2097 A location list entry has two forms:
2098 a normal location list entry and a default location list entry.
2101 \subsubsubsubsection{Normal Location List Entry}
2102 A\addtoindexx{location list!normal entry}
2103 \addtoindex{normal location list entry} consists of:
2104 \begin{enumerate}[1. ]
2105 \item A beginning address offset.
2106 This address offset has the \addtoindex{size of an address} and is
2107 relative to the applicable base address of the compilation
2108 unit referencing this location list. It marks the beginning
2110 \addtoindexi{range}{address range!in location list}
2111 over which the location is valid.
2113 \item An ending address offset. This address offset again
2114 has the \addtoindex{size of an address} and is relative to the applicable
2115 base address of the compilation unit referencing this location
2116 list. It marks the first address past the end of the address
2117 range over which the location is valid. The ending address
2118 must be greater than or equal to the beginning address.
2120 \textit{A location list entry (but not a base address selection or
2121 end-of-list entry) whose beginning
2122 and ending addresses are equal has no effect
2123 because the size of the range covered by such
2126 \item An unsigned 2-byte length describing the length of the location
2127 description that follows.
2129 \item A \addtoindex{single location description}
2130 describing the location of the object over the range specified by
2131 the beginning and end addresses.
2134 Address ranges defined by normal location list entries
2135 may overlap. When they do, they describe a
2136 situation in which an object exists simultaneously in more than
2137 one place. If all of the address ranges in a given location
2138 list do not collectively cover the entire range over which the
2139 object in question is defined, it is assumed that the object is
2140 not available for the portion of the range that is not covered.
2143 \subsubsubsubsection{Default Location List Entry}
2144 A \addtoindex{default location list entry} consists of:
2145 \addtoindexx{location list!default entry}
2146 \begin{enumerate}[1. ]
2148 \item The value of the largest representable address offset (for
2149 example, \wffffffff when the size of an address is 32 bits).
2150 \item A simple location description describing the location of the
2151 object when there is no prior normal location list entry
2152 that applies in the same location list.
2155 A default location list entry is independent of any applicable
2156 base address (except to the extent to which base addresses
2157 affect prior normal location list entries).
2159 A default location list entry must be the last location list
2160 entry of a location list except for the terminating end-of-list
2163 A \addtoindex{default location list entry} describes a simple
2164 location which applies to all addresses which are not included
2165 in any range defined earlier in the same location list.
2168 \subsubsubsection{Base Address Selection Entry}
2170 \addtoindexi{address}{address selection|see{base address selection}}
2171 \addtoindexx{location list!base address selection entry}
2173 \addtoindexi{entry}{base address selection entry!in location list}
2175 \begin{enumerate}[1. ]
2176 \item The value of the largest representable
2177 address offset (for example, \wffffffff when the size of
2178 an address is 32 bits).
2179 \item An address, which defines the
2180 appropriate base address for use in interpreting the beginning
2181 and ending address offsets of subsequent entries of the location list.
2184 \textit{A base address selection entry
2185 affects only the remainder of the list in which it is contained.}
2188 \subsubsubsection{End-of-List Entry}
2189 The end of any given location list is marked by an
2190 \addtoindexx{location list!end-of-list entry}
2191 end-of-list entry, which consists of a 0 for the beginning address
2192 offset and a 0 for the ending address offset. A location list
2194 \addtoindexx{end-of-list entry!in location list}
2195 end-of-list entry describes an object that
2196 exists in the source code but not in the executable program.
2198 Neither a base address selection entry nor an end-of-list
2199 entry includes a location description.
2202 \textit{When a DWARF consumer is parsing and decoding a location
2203 list, it must recognize the beginning and ending address
2204 offsets of (0, 0) for an end-of-list entry and
2205 \mbox{(0, \texttt{maximum-address})} for
2206 a default location list entry prior to applying any base
2207 address. Any other pair of offsets beginning with 0 is a
2208 valid normal location list entry. Next, it must recognize the
2209 beginning address offset of \texttt{maximum-address} for a base address selection
2210 entry prior to applying any base address. The current base
2211 address is not applied to the subsequent value (although there
2212 may be an underlying object language relocation that affects
2215 \textit{A base address selection entry and an end-of-list
2216 entry for a location list are identical to a base address
2217 selection entry and end-of-list entry, respectively, for a
2218 \addtoindex{range list}
2219 (see Section \refersec{chap:noncontiguousaddressranges})
2220 in interpretation and representation.}
2223 \subsubsection{Location Lists in Split Object Files}
2224 \label{chap:locationlistsinsplitobjectfiles}
2225 In a \splitDWARFobjectfile{} (see
2226 Section \refersec{datarep:splitdwarfobjectfiles}),
2227 location lists are contained in the \dotdebuglocdwo{} section.
2229 The \addtoindex{applicable base address} of a split
2230 location list entry (see following) is
2231 \addtoindexx{location list!base address selection entry}
2232 determined by the closest preceding base address selection
2233 entry (\DWLLEbaseaddressselectionentry) in the same location list. If there is
2234 no such selection entry, then the applicable base address
2235 defaults to the base address of the compilation unit (see
2236 Section \refersec{chap:normalandpartialcompilationunitentries}).
2238 Each entry in the split location list
2239 begins with a type code, which is a single unsigned byte that
2240 identifies the type of entry. There are five types of entries:
2242 \itembfnl{\DWLLEendoflistentryTARG}
2243 This entry indicates the end of a location list, and
2244 contains no further data.
2247 \itembfnl{\DWLLEbaseaddressselectionentryTARG}
2248 This entry contains an
2249 unsigned LEB128\addtoindexx{LEB128!unsigned} value immediately
2250 following the type code. This value is the index of an
2251 address in the \dotdebugaddr{} section, which is then used as
2252 the base address when interpreting offsets in subsequent
2253 location list entries of type \DWLLEoffsetpairentry.
2254 This index is relative to the value of the
2255 \DWATaddrbase{} attribute of the associated compilation unit.
2257 \itembfnl{\DWLLEstartendentryTARG}
2258 This entry contains two unsigned LEB128\addtoindexx{LEB128!unsigned}
2259 values immediately following the type code. These values are the
2260 indices of two addresses in the \dotdebugaddr{} section.
2261 These indices are relative to the value of the
2262 \DWATaddrbase{} attribute of the associated compilation unit
2263 (see Section \refersec{chap:unitentries}).
2264 These indicate the starting and ending addresses,
2265 respectively, that define the address range for which
2266 this location is valid. The starting and ending addresses
2267 given by this type of entry are not relative to the
2268 compilation unit base address. A single location
2269 description follows the fields that define the address range.
2271 \itembfnl{\DWLLEstartlengthentryTARG}
2272 This entry contains one unsigned LEB128\addtoindexx{LEB128!unsigned}
2274 unsigned value immediately following the type code. The
2275 first value is the index of an address in the \dotdebugaddr{}
2276 section, which marks the beginning of the address range
2277 over which the location is valid.
2278 This index is relative to the value of the
2279 \DWATaddrbase{} attribute of the associated compilation unit.
2280 The starting address given by this
2281 type of entry is not relative to the compilation unit
2282 base address. The second value is the
2283 length of the range. A single location
2284 description follows the fields that define the address range.
2286 \itembfnl{\DWLLEoffsetpairentryTARG}
2287 This entry contains two 4-byte unsigned values
2288 immediately following the type code. These values are the
2289 starting and ending offsets, respectively, relative to
2290 the applicable base address, that define the address
2291 range for which this location is valid. A single location
2292 description follows the fields that define the address range.
2295 \textit{The \DWLLEbaseaddressselectionentry, \DWLLEstartendentry{}
2296 and \DWLLEstartlengthentry entries obtain addresses within the
2297 target program indirectly using an index (not an offset) into an
2298 array of addresses. The base of that array is obtained using the
2299 \DWATaddrbase{} attribute of the containing compilation unit.
2300 The value of that attribute is the offset of the base of the array
2301 in the \dotdebugaddr{} section of the unit.}
2304 \section{Types of Program Entities}
2305 \label{chap:typesofprogramentities}
2306 \hypertarget{chap:DWATtypetypeofdeclaration}{}
2307 Any debugging information entry describing a declaration that
2309 \addtoindexx{type attribute}
2310 a \DWATtypeDEFN{} attribute, whose value is a
2311 reference to another debugging information entry. The entry
2312 referenced may describe a base type, that is, a type that is
2313 not defined in terms of other data types, or it may describe a
2314 user-defined type, such as an array, structure or enumeration.
2315 Alternatively, the entry referenced may describe a type
2316 modifier, such as constant, packed, pointer, reference or
2317 volatile, which in turn will reference another entry describing
2318 a type or type modifier (using
2319 \addtoindexx{type attribute}
2320 a \DWATtypeNAME{} attribute of its
2322 Section \referfol{chap:typeentries}
2323 for descriptions of the entries describing
2324 base types, user-defined types and type modifiers.
2328 \section{Accessibility of Declarations}
2329 \label{chap:accessibilityofdeclarations}
2330 \textit{Some languages, notably \addtoindex{C++} and
2331 \addtoindex{Ada}, have the concept of
2332 the accessibility of an object or of some other program
2333 entity. The accessibility specifies which classes of other
2334 program objects are permitted access to the object in question.}
2336 The accessibility of a declaration is
2337 \hypertarget{chap:DWATaccessibilitycandadadeclarations}{}
2339 \DWATaccessibilityDEFN{}
2341 \addtoindexx{accessibility attribute}
2342 value is a constant drawn from the set of codes listed in Table
2343 \refersec{tab:accessibilitycodes}.
2345 \begin{simplenametable}[1.9in]{Accessibility codes}{tab:accessibilitycodes}
2346 \DWACCESSpublicTARG{} \\
2347 \DWACCESSprivateTARG{} \\
2348 \DWACCESSprotectedTARG{} \\
2349 \end{simplenametable}
2352 \section{Visibility of Declarations}
2353 \label{chap:visibilityofdeclarations}
2355 \textit{Several languages (such as \addtoindex{Modula-2})
2356 have the concept of the visibility of a declaration. The
2357 visibility specifies which declarations are to be
2358 visible outside of the entity in which they are
2362 \hypertarget{chap:DWATvisibilityvisibilityofdeclaration}{}
2363 visibility of a declaration is represented
2364 by a \DWATvisibilityDEFN{}
2365 attribute\addtoindexx{visibility attribute}, whose value is a
2366 constant drawn from the set of codes listed in
2367 Table \refersec{tab:visibilitycodes}.
2369 \begin{simplenametable}[1.5in]{Visibility codes}{tab:visibilitycodes}
2370 \DWVISlocalTARG{} \\
2371 \DWVISexportedTARG{} \\
2372 \DWVISqualifiedTARG{} \\
2373 \end{simplenametable}
2376 \section{Virtuality of Declarations}
2377 \label{chap:virtualityofdeclarations}
2378 \textit{\addtoindex{C++} provides for virtual and pure virtual structure or class
2379 member functions and for virtual base classes.}
2382 \hypertarget{chap:DWATvirtualityvirtualityindication}{}
2383 virtuality of a declaration is represented by a
2384 \DWATvirtualityDEFN{}
2385 attribute\addtoindexx{virtuality attribute}, whose value is a constant drawn
2386 from the set of codes listed in
2387 Table \refersec{tab:virtualitycodes}.
2389 \begin{simplenametable}[2.5in]{Virtuality codes}{tab:virtualitycodes}
2390 \DWVIRTUALITYnoneTARG{} \\
2391 \DWVIRTUALITYvirtualTARG{} \\
2392 \DWVIRTUALITYpurevirtualTARG{} \\
2393 \end{simplenametable}
2396 \section{Artificial Entries}
2397 \label{chap:artificialentries}
2398 \textit{A compiler may wish to generate debugging information entries
2399 for objects or types that were not actually declared in the
2400 source of the application. An example is a formal parameter
2401 %FIXME: The word 'this' should be rendered like a variant italic,
2402 %FIXME: not as a quoted name. Changed to tt font--RB
2403 entry to represent the hidden
2404 \texttt{this} parameter\index{this parameter@\texttt{this} parameter}
2405 that most \addtoindex{C++} implementations pass as the first argument
2406 to non-static member functions.}
2408 Any debugging information entry representing the
2409 \addtoindexx{artificial attribute}
2410 declaration of an object or type artificially generated by
2411 a compiler and not explicitly declared by the source program
2412 \hypertarget{chap:DWATartificialobjectsortypesthat}{}
2414 \DWATartificialDEFN{} attribute,
2415 which is a \livelink{chap:classflag}{flag}.
2418 \section{Segmented Addresses}
2419 \label{chap:segmentedaddresses}
2420 \textit{In some systems, addresses are specified as offsets within a
2422 \addtoindexx{address space!segmented}
2424 \addtoindexx{segmented addressing|see{address space}}
2425 rather than as locations within a single flat
2426 \addtoindexx{address space!flat}
2429 Any debugging information entry that contains a description
2430 \hypertarget{chap:DWATsegmentaddressinginformation}{}
2431 of the location of an object or subroutine may have a
2432 \DWATsegmentDEFN{} attribute,
2433 \addtoindexx{segment attribute}
2434 whose value is a location
2435 description. The description evaluates to the segment selector
2436 of the item being described. If the entry containing the
2437 \DWATsegmentNAME{} attribute has a
2441 \DWATentrypc{} attribute,
2442 \addtoindexx{entry PC attribute}
2445 description that evaluates to an address, then those address
2446 values represent the offset portion of the address within
2447 the segment specified
2448 \addtoindexx{segment attribute}
2449 by \DWATsegmentNAME.
2452 \DWATsegmentNAME{} attribute, it inherits
2453 \addtoindexx{segment attribute}
2454 the segment value from its parent entry. If none of the
2455 entries in the chain of parents for this entry back to
2456 its containing compilation unit entry have
2457 \DWATsegmentNAME{} attributes,
2458 then the entry is assumed to exist within a flat
2460 Similarly, if the entry has a
2461 \DWATsegmentNAME{} attribute
2462 \addtoindexx{segment attribute}
2463 containing an empty location description, that
2464 entry is assumed to exist within a
2465 \addtoindexi{flat}{address space!flat}
2468 \textit{Some systems support different
2469 classes of addresses\addtoindexx{address class}.
2470 The address class may affect the way a pointer is dereferenced
2471 or the way a subroutine is called.}
2474 Any debugging information entry representing a pointer or
2475 reference type or a subroutine or subroutine type may
2478 attribute, whose value is an integer
2479 constant. The set of permissible values is specific to
2480 each target architecture. The value \DWADDRnoneTARG,
2482 is common to all encodings, and means that no address class
2486 \textit {For example, the Intel386 \texttrademark\ processor might use the following values:}
2489 \caption{Example address class codes}
2490 \label{tab:inteladdressclasstable}
2492 \begin{tabular}{l|c|l}
2494 Name&Value&Meaning \\
2496 \textit{DW\_ADDR\_none}& 0 & \textit{no class specified} \\
2497 \textit{DW\_ADDR\_near16}& 1 & \textit{16-bit offset, no segment} \\
2498 \textit{DW\_ADDR\_far16}& 2 & \textit{16-bit offset, 16-bit segment} \\
2499 \textit{DW\_ADDR\_huge16}& 3 & \textit{16-bit offset, 16-bit segment} \\
2500 \textit{DW\_ADDR\_near32}& 4 & \textit{32-bit offset, no segment} \\
2501 \textit{DW\_ADDR\_far32}& 5 & \textit{32-bit offset, 16-bit segment} \\
2507 \section{Non-Defining Declarations and Completions}
2508 \label{nondefiningdeclarationsandcompletions}
2509 A debugging information entry representing a program entity
2510 typically represents the defining declaration of that
2511 entity. In certain contexts, however, a debugger might need
2512 information about a declaration of an entity that is not
2513 \addtoindexx{incomplete declaration}
2514 also a definition, or is otherwise incomplete, to evaluate
2515 \hypertarget{chap:DWATdeclarationincompletenondefiningorseparateentitydeclaration}{}
2516 an expression correctly.
2519 \textit{As an example, consider the following fragment of \addtoindex{C} code:}
2533 \textit{\addtoindex{C} scoping rules require that the
2534 value of the variable \texttt{x} passed to the function
2535 \texttt{g} is the value of the global \texttt{float}
2536 variable \texttt{x} rather than of the local \texttt{int}
2537 variable \texttt{x}.}
2539 \subsection{Non-Defining Declarations}
2540 A debugging information entry that
2541 represents a non-defining
2542 \addtoindexx{non-defining declaration}
2544 \addtoindex{incomplete declaration}
2545 of a program entity has a
2546 \addtoindexx{declaration attribute}
2547 \DWATdeclarationDEFN{} attribute, which is a
2548 \livelink{chap:classflag}{flag}.
2550 \subsection{Declarations Completing Non-Defining Declarations}
2551 A debugging information entry that represents a
2552 declaration\hypertarget{chap:DWATspecificationincompletenondefiningorseparatedeclaration}{}
2553 that completes another (earlier) non-defining declaration may have a
2554 \DWATspecificationDEFN{}
2555 attribute whose value is a \livelink{chap:classreference}{reference} to
2556 the debugging information entry representing the non-defining declaration.
2557 A debugging information entry with a
2558 \DWATspecificationNAME{}
2559 attribute does not need to duplicate information provided by the
2560 debugging information entry referenced by that specification attribute.
2562 When the non-defining declaration is contained within a type that has
2563 been placed in a separate type unit (see Section \refersec{chap:typeunitentries}),
2564 the \DWATspecification{} attribute cannot refer directly to the entry in
2565 the type unit. Instead, the current compilation unit may contain a
2566 \doublequote{skeleton} declaration of the type, which contains only the relevant
2567 declaration and its ancestors as necessary to provide the context
2568 (including containing types and namespaces). The \DWATspecification{}
2569 attribute would then be a reference to the declaration entry within
2570 the skeleton declaration tree. The debugging information entry for the
2571 top-level type in the skeleton tree may contain a \DWATsignature{}
2572 attribute whose value is the type signature
2573 (see Section \refersec{datarep:typesignaturecomputation}).
2576 Not all attributes of the debugging information entry referenced by a
2577 \DWATspecification{} attribute
2578 apply to the referring debugging information entry.
2579 For\addtoindexx{declaration attribute}
2583 \addtoindexx{declaration attribute}
2585 \addtoindexx{declaration attribute}
2587 \addtoindexx{sibling attribute}
2591 \section{Declaration Coordinates}
2592 \label{chap:declarationcoordinates}
2593 \livetargi{chap:declarationcoordinates}{}{declaration coordinates}
2594 \textit{It is sometimes useful in a debugger to be able to associate
2595 a declaration with its occurrence in the program source.}
2597 Any debugging information
2598 \hypertarget{chap:DWATdeclfilefilecontainingsourcedeclaration}{}
2600 \hypertarget{chap:DWATdecllinelinenumberofsourcedeclaration}{}
2602 \hypertarget{chap:DWATdeclcolumncolumnpositionofsourcedeclaration}{}
2604 \addtoindexx{line number of declaration}
2605 declaration of an object, module, subprogram or
2606 \addtoindex{declaration column attribute}
2608 \addtoindex{declaration file attribute}
2610 \addtoindex{declaration line attribute}
2613 \DWATdecllineDEFN{} and
2614 \DWATdeclcolumnDEFN{}
2615 attributes each of whose value is an unsigned
2616 \livelink{chap:classconstant}{integer constant}.
2619 \addtoindexx{declaration file attribute}
2623 \addtoindexx{file containing declaration}
2625 a file number from the line number information table for the
2626 compilation unit containing the debugging information entry and
2627 represents the source file in which the declaration appeared
2628 (see Section \refersec{chap:linenumberinformation}).
2629 The value 0 indicates that no source file
2633 \addtoindexx{declaration line attribute}
2634 the \DWATdeclline{} attribute represents
2635 the source line number at which the first character of
2636 the identifier of the declared object appears. The value 0
2637 indicates that no source line has been specified.
2640 \addtoindexx{declaration column attribute}
2641 the \DWATdeclcolumn{} attribute represents
2642 the source column number at which the first character of
2643 the identifier of the declared object appears. The value 0
2644 indicates that no column has been specified.
2646 \section{Identifier Names}
2647 \label{chap:identifiernames}
2648 Any\hypertarget{chap:DWATnamenameofdeclaration}{}
2649 debugging information entry
2650 \addtoindexx{identifier names}
2652 \addtoindexx{names!identifier}
2653 a program entity that has been given a name may have a
2655 attribute\addtoindexx{name attribute}, whose value of
2656 \CLASSstring{} represents the name as it appears in
2657 the source program. A debugging information entry containing
2658 no name attribute, or containing a name attribute whose value
2659 consists of a name containing a single null byte, represents
2660 a program entity for which no name was given in the source.
2662 \textit{Because the names of program objects described by DWARF are
2663 the names as they appear in the source program, implementations
2664 of language translators that use some form of mangled name
2665 \addtoindexx{mangled names}
2666 (as do many implementations of \addtoindex{C++}) should use the
2667 unmangled form of the name in the
2668 \DWATname{} attribute,
2669 \addtoindexx{name attribute}
2670 including the keyword operator (in names such as \doublequote{operator +}),
2671 if present. See also
2672 Section \referfol{chap:linkagenames} regarding the use of
2673 \DWATlinkagename{} for
2674 \addtoindex{mangled names}.
2675 Sequences of multiple whitespace characters may be compressed.}
2677 \section{Data Locations and DWARF Procedures}
2678 Any debugging information entry describing a data object (which
2679 \hypertarget{chap:DWATlocationdataobjectlocation}{}
2680 includes variables and parameters) or
2681 \livelink{chap:commonblockentry}{common blocks}
2683 \addtoindexx{location attribute}
2685 \DWATlocationDEFN{} attribute,
2686 \addtoindexx{location attribute}
2687 whose value is a location description
2688 (see Section \refersec{chap:locationdescriptions}).
2692 \addtoindex{DWARF procedure}
2693 is represented by any
2694 kind of debugging information entry that has a
2695 \addtoindexx{location attribute}
2698 \addtoindexx{location attribute}
2699 If a suitable entry is not otherwise available,
2700 a DWARF procedure can be represented using a debugging
2701 \addtoindexx{DWARF procedure entry}
2702 information entry with the
2703 tag \DWTAGdwarfprocedureTARG{}
2705 \addtoindexx{location attribute}
2706 a \DWATlocationNAME{} attribute.
2709 is called by a \DWOPcalltwo,
2712 DWARF expression operator
2713 (see Section \refersec{chap:controlflowoperations}).
2716 \section{Code Addresses and Ranges}
2717 \label{chap:codeaddressesandranges}
2718 Any debugging information entry describing an entity that has
2719 a machine code address or range of machine code addresses,
2720 which includes compilation units, module initialization,
2721 subroutines, ordinary \nolink{blocks},
2722 try/catch \nolink{blocks} (see Section\refersec{chap:tryandcatchblockentries}),
2723 labels and the like, may have
2725 \item A \DWATlowpcDEFN{} attribute for
2726 \hypertarget{chap:DWATlowpccodeaddressorrangeofaddresses}{}
2729 \item A \DWATlowpcDEFN{}
2730 \addtoindexx{low PC attribute}
2733 \addtoindexx{high PC attribute}
2734 \hypertarget{chap:DWAThighpccontiguousrangeofcodeaddresses}{}
2735 pair of attributes for
2736 a single contiguous range of
2739 \item A \DWATrangesDEFN{} attribute
2740 \addtoindexx{ranges attribute}
2741 \hypertarget{chap:DWATrangesnoncontiguousrangeofcodeaddresses}{}
2742 for a non-contiguous range of addresses.
2745 In addition, a non-contiguous range of
2746 addresses may also be specified for the
2747 \DWATstartscope{} attribute.
2748 \addtoindexx{start scope attribute}
2750 If an entity has no associated machine code,
2751 none of these attributes are specified.
2753 \subsection{Single Address}
2754 When there is a single address associated with an entity,
2755 such as a label or alternate entry point of a subprogram,
2756 the entry has a \DWATlowpc{} attribute whose value is the
2757 relocated address for the entity.
2759 \textit{While the \DWATentrypc{}
2760 attribute might also seem appropriate for this purpose,
2761 historically the \DWATlowpc{} attribute was used before
2762 \DWATentrypc{} was introduced
2763 (in \addtoindex{DWARF Version 3}). There is
2764 insufficient reason to change this;
2765 \DWATlowpc{} serves as a default entry PC address as described
2766 in Section \refersec{chap:entryaddress}.}
2769 \subsection{Continuous Address Range}
2770 \label{chap:contiguousaddressranges}
2771 When the set of addresses of a debugging information entry can
2772 be described as a single contiguous range, the entry
2773 \addtoindexx{high PC attribute}
2775 \addtoindexx{low PC attribute}
2778 \DWAThighpc{} pair of attributes.
2781 \DWATlowpc{} attribute
2782 is the relocated address of the
2783 first instruction associated with the entity. If the value of
2784 the \DWAThighpc{} is of class address, it is the relocated
2785 address of the first location past the last instruction
2786 associated with the entity; if it is of class constant, the
2787 value is an unsigned integer offset which when added to the
2788 low PC gives the address of the first location past the last
2789 instruction associated with the entity.
2791 \textit{The high PC value
2792 may be beyond the last valid instruction in the executable.}
2795 The presence of low and high PC attributes for an entity
2796 implies that the code generated for the entity is contiguous
2797 and exists totally within the boundaries specified by those
2798 two attributes. If that is not the case, no low and high PC
2799 attributes should be produced.
2801 \subsection{Non-Contiguous Address Ranges}
2802 \label{chap:noncontiguousaddressranges}
2803 When the set of addresses of a debugging information entry
2804 \addtoindexx{non-contiguous address ranges}
2805 cannot be described as a single contiguous range, the entry has
2806 a \DWATranges{} attribute
2807 \addtoindexx{ranges attribute}
2808 whose value is of class \livelink{chap:classrangelistptr}{rangelistptr}
2809 and indicates the beginning of a \addtoindex{range list}.
2811 a \DWATstartscope{} attribute
2812 \addtoindexx{start scope attribute}
2813 may have a value of class
2814 \livelink{chap:classrangelistptr}{rangelistptr} for the same reason.
2816 Range lists are contained in a separate object file section called
2817 \dotdebugranges{}. A
2818 \addtoindex{range list} is indicated by a
2819 \DWATranges{} attribute whose
2820 \addtoindexx{ranges attribute}
2821 value is represented as an offset from the beginning of the
2822 \dotdebugranges{} section to the beginning of the
2823 \addtoindex{range list}.
2826 If the current compilation unit contains a \DWATrangesbase{}
2827 attribute, the value of that attribute establishes a base
2828 offset within the \dotdebugranges{} section for the compilation
2829 unit. The offset given by the \DWATranges{} attribute is
2830 relative to that base.
2832 \textit{The \DWATrangesbase{} attribute is new in \DWARFVersionV.
2833 The advantage of this attribute is that it reduces the number of
2834 object language relocations needed for references to the \dotdebugranges{}
2835 section from one for each range entry to a single relocation that
2836 applies for the entire compilation unit.}
2838 The \addtoindex{applicable base address} of a \addtoindex{range list}
2840 by the closest preceding base address selection entry (see
2841 below) in the same range list. If there is no such selection
2842 entry, then the applicable base address defaults to the base
2843 address of the compilation unit
2844 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2846 \textit{In the case of a compilation unit where all of the machine
2847 code is contained in a single contiguous section, no base
2848 address selection entry is needed.}
2850 Address range entries in a \addtoindex{range list} may not overlap.
2851 There is no requirement that the entries be ordered in any particular way.
2853 Each entry in a \addtoindex{range list} is either a
2854 \addtoindex{range list entry},
2855 \addtoindexx{base address selection entry!in range list}
2856 a base address selection entry, or an
2857 \addtoindexx{end-of-list entry!in range list}
2861 \subsubsection{Range List Entry}
2862 A \addtoindex{range list entry} consists of:
2863 \begin{enumerate}[1. ]
2864 \item A beginning address offset. This address offset has the
2865 \addtoindex{size of an address} and is relative to
2866 the \addtoindex{applicable base address} of the compilation unit referencing this
2867 \addtoindex{range list}.
2868 It marks the beginning of an
2869 \addtoindexi{address range}{address range!in range list}.
2871 \item An ending address offset. This address offset again has the
2872 \addtoindex{size of an address} and is relative
2873 to the \addtoindex{applicable base address} of the compilation unit referencing
2874 this \addtoindex{range list}.
2875 It marks the first address past the end of the address range.
2876 The ending address must be greater than or
2877 equal to the beginning address.
2880 \textit{A \addtoindex{range list} entry (but not a base address
2881 selection or end-of-list entry) whose beginning and
2882 ending addresses are equal has no effect because the size of the
2883 range covered by such an entry is zero.}
2887 \subsubsection{Base Address Selection Entry}
2888 A \addtoindex{base address selection entry} consists of:
2889 \begin{enumerate}[1. ]
2890 \item The value of the largest representable address offset
2891 (for example, \wffffffff when the size of an address is 32 bits).
2893 \item An address, which defines the appropriate base address
2894 for use in interpreting the beginning and ending address offsets
2895 of subsequent entries of the location list.
2898 \textit{A base address selection entry affects only the
2899 remainder of list in which it is contained.}
2901 \subsubsection{End-of-List Entry}
2902 The end of any given \addtoindex{range list} is marked by an
2903 \addtoindexx{end-of-list entry!in range list}
2905 which consists of a 0 for the beginning address
2906 offset and a 0 for the ending address offset.
2907 A \addtoindex{range list}
2908 containing only an end-of-list entry describes an empty scope
2909 (which contains no instructions).
2911 \textit{A base address selection entry and an
2912 \addtoindexx{end-of-list entry!in range list}
2913 end-of-list entry for
2914 a \addtoindex{range list}
2915 are identical to a base address selection entry
2916 and end-of-list entry, respectively, for a location list
2917 (see Section \refersec{chap:locationlists})
2918 in interpretation and representation.}
2921 \section{Entry Address}
2922 \label{chap:entryaddress}
2923 \textit{The entry or first executable instruction generated
2924 for an entity, if applicable, is often the lowest addressed
2925 instruction of a contiguous range of instructions. In other
2926 cases, the entry address needs to be specified explicitly.}
2928 Any debugging information entry describing an entity that has
2929 a range of code addresses, which includes compilation units,
2930 module initialization, subroutines,
2931 \livelink{chap:lexicalblock}{lexical \nolink{blocks}},
2932 \livelink{chap:tryandcatchblockentries}{try/catch \nolink{blocks}},
2933 and the like, may have a \DWATentrypcDEFN{} attribute
2934 \addtoindexx{entry PC address}
2935 to indicate the first executable instruction within that
2936 range\hypertarget{chap:entryaddressofscope}{}
2937 of addresses. The value of the \DWATentrypcNAME{} attribute is a
2938 relocated address if the
2939 value of \DWATentrypcNAME{} is of class \CLASSaddress; or if it is of class
2940 \CLASSconstant, the value is an unsigned integer offset which, when
2941 added to the base address of the function, gives the entry
2944 The base address of the containing scope is given by either the
2945 \DWATlowpc{} attribute, or the first range entry in the list of
2946 ranges given by the \DWATranges{} attribute.
2947 If no \DWATentrypcNAME{} attribute is present,
2948 then the entry address is assumed to be the same as the
2952 \section{Static and Dynamic Values of Attributes}
2953 \label{chap:staticanddynamicvaluesofattributes}
2955 Some attributes that apply to types specify a property (such
2956 as the lower bound of an array) that is an integer value,
2957 where the value may be known during compilation or may be
2958 computed dynamically during execution.
2962 attributes is determined based on the class as follows:
2964 \item For a \livelink{chap:classconstant}{constant}, the value of the constant is the value of
2967 \item For a \livelink{chap:classreference}{reference}, the
2968 value is a reference to another DIE. This DIE may:
2970 \renewcommand{\itemsep}{0cm}
2971 \item describe a constant which is the attribute value,
2972 \item describe a variable which contains the attribute value, or
2973 \item contain a DWARF expression which computes the attribute value
2974 (for example, be a \DWTAGdwarfprocedure{} entry).
2977 \item For an \livelink{chap:classexprloc}{exprloc}, the value is interpreted as a
2979 evaluation of the expression yields the value of
2983 \textit{Whether an attribute value can be dynamic depends on the
2984 rules of the applicable programming language.
2988 \section{Entity Descriptions}
2989 \textit{Some debugging information entries may describe entities
2990 in the program that are artificial, or which otherwise have a
2991 \doublequote{name} that is not a valid identifier in the
2992 programming language. For example, several languages may
2993 capture or freeze the value of a variable at a particular
2994 point in the program and hold that value in an artificial variable.
2995 \addtoindex{Ada} 95 has package elaboration routines,
2996 type descriptions of the form \texttt{typename\textquoteright Class}, and
2997 \doublequote{\texttt{access} typename} parameters.}
2999 Generally, any debugging information entry that
3000 \hypertarget{chap:DWATdescriptionartificialnameordescription}{}
3001 has, or may have, a \DWATname{} attribute, may
3003 \addtoindexx{description attribute}
3004 \DWATdescriptionDEFN{} attribute whose value is a
3005 null-terminated string providing a description of the entity.
3007 \textit{It is expected that a debugger will only display these
3008 descriptions as part of the description of other entities.}
3011 \section{Byte and Bit Sizes}
3012 \label{chap:byteandbitsizes}
3013 % Some trouble here with hbox full, so we try optional word breaks.
3014 Many debugging information entries allow either a
3015 \DWATbytesizeNAME{} attribute or a
3016 \DWATbitsizeNAME{} attribute,
3017 whose \livelink{chap:classconstant}{integer constant} value
3018 (see Section \ref{chap:staticanddynamicvaluesofattributes})
3020 amount of storage. The value of the
3021 \DWATbytesizeDEFN{} attribute
3022 is interpreted in bytes and the value of the
3024 attribute is interpreted in bits. The
3025 \DWATstringlengthbytesize{} and
3026 \DWATstringlengthbitsize{}
3027 attributes are similar.
3029 In addition, the \livelink{chap:classconstant}{integer constant}
3030 value of a \DWATbytestride{} attribute is interpreted
3031 in bytes and the \livelink{chap:classconstant}{integer constant} value of a
3033 attribute is interpreted in bits.
3035 \section{Linkage Names}
3036 \label{chap:linkagenames}
3037 \textit{Some language implementations, notably
3038 \addtoindex{C++} and similar
3039 languages, make use of implementation-defined names within
3040 object files that are different from the \addtoindex{identifier names}
3041 (see Section \refersec{chap:identifiernames}) of entities as they
3042 appear in the source. Such names, sometimes known as
3043 \addtoindex{mangled names}\addtoindexx{names!mangled},
3044 are used in various ways, such as: to encode additional
3045 information about an entity, to distinguish multiple entities
3046 that have the same name, and so on. When an entity has an
3047 associated distinct linkage name it may sometimes be useful
3048 for a producer to include this name in the DWARF description
3049 of the program to facilitate consumer access to and use of
3050 object file information about an entity and/or information
3051 \hypertarget{chap:DWATlinkagenameobjectfilelinkagenameofanentity}{}
3052 that is encoded in the linkage name itself.
3055 % Some trouble maybe with hbox full, so we try optional word breaks.
3056 A debugging information entry may have a
3057 \addtoindexx{linkage name attribute}
3058 \DWATlinkagenameDEFN{}
3059 attribute whose value is a null-terminated string containing the
3060 object file linkage name associated with the corresponding entity.
3063 \section{Template Parameters}
3064 \label{chap:templateparameters}
3065 \textit{In \addtoindex{C++}, a template is a generic definition
3066 of a class, function, member function, or typedef (alias).
3067 A template has formal parameters that
3068 can be types or constant values; the class, function,
3069 member function, or typedef is instantiated differently for each
3070 distinct combination of type or value actual parameters. DWARF does
3071 not represent the generic template definition, but does represent each
3074 A debugging information entry that represents a
3075 \addtoindex{template instantiation}
3076 will contain child entries describing the actual template parameters.
3077 The containing entry and each of its child entries reference a template
3078 parameter entry in any circumstance where the template definition
3079 referenced a formal template parameter.
3081 A template type parameter is represented by a debugging information
3083 \addtoindexx{template type parameter entry}
3084 \DWTAGtemplatetypeparameterTARG.
3085 A template value parameter is represented by a debugging information
3087 \addtoindexx{template value parameter entry}
3088 \DWTAGtemplatevalueparameterTARG.
3089 The actual template parameter entries appear in the same order as the
3090 corresponding template formal parameter declarations in the
3094 A type or value parameter entry may have a \DWATname{} attribute,
3095 \addtoindexx{name attribute}
3097 null\dash terminated string containing the name of the corresponding
3098 formal parameter as it appears in the source program.
3099 The entry may also have a
3100 \DWATdefaultvalue{} attribute, which is a flag indicating
3101 that the value corresponds to the default argument for the
3105 \addtoindexx{formal type parameter|see{template type parameter entry}}
3106 template type parameter entry has a
3107 \addtoindexx{type attribute}
3108 \DWATtype{} attribute
3109 describing the actual type by which the formal is replaced.
3111 A template value parameter entry has a \DWATtype{} attribute
3112 describing the type of the parameterized value.
3113 The entry also has an attribute giving the
3114 actual compile-time or run-time constant value
3115 of the value parameter for this instantiation.
3117 \DWATconstvalueDEFN{} attribute,
3118 \addtoindexx{constant value attribute}
3119 \livetarg{chap:DWATconstvaluetemplatevalueparameter}{}
3120 whose value is the compile-time constant value
3121 as represented on the target architecture, or a
3122 \DWATlocation{} attribute, whose value is a
3123 single location description for the run-time constant address.
3126 \label{chap:alignment}
3127 \livetarg{chap:DWATalignmentnondefault}{}
3128 A debugging information entry may have a
3129 \DWATalignmentDEFN{} attribute\addtoindexx{alignment attribute}
3130 that describes the (non-default) alignment requirements of the entry.
3131 \DWATalignment{} has a positive, non-zero, integer constant value
3132 describing the strictest specified (non-default) alignment of the entity.
3133 This constant describes the actual alignment used by the compiler.
3134 (If there are multiple alignments specified by the user, or if the
3135 user specified an alignment the compiler could not satisfy, then
3136 only the strictest alignment is added using this attribute.)
3138 \textit{For example, an alignment attribute whose value is 8 indicates
3139 that the entity to which it applies occurs at an address that is a
3140 multiple of eight (not a multiple of $2^8$ or 256).}