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}{P{6.2cm}|P{8.5cm}}
160 \caption{Attribute names} \label{tab:attributenames} \\
161 \hline \bfseries Attribute$^*$&\bfseries Identifies or Specifies \\ \hline
163 \bfseries Attribute$^*$&\bfseries Identifies or Specifies \\ \hline
168 \vspace{2mm}\emph{Continued on next page} \newline
169 $^*${\parbox[t]{15cm}{\tiny Links for attributes come to the left column of this table;
170 links in the right column "fan-out" to one or more descriptions.}} \newline
175 $^*${\parbox[t]{15cm}{\tiny Links for attributes come to the left column of this table;
176 links in the right column "fan-out" to one or more descriptions.}}}
179 \DWATabstractoriginTARG
180 &\livelinki{chap:DWATabstractorigininlineinstance}
181 {Inline instances of inline subprograms}
182 {inline instances of inline subprograms} \\
183 % Heren livelink we cannot use \dash or \dash{}.
184 &\livelinki{chap:DWATabstractoriginoutoflineinstance}
185 {Out-of-line instances of inline subprograms}
186 {out-of-line instances of inline subprograms} \\
187 \DWATaccessibilityTARG
188 &\livelink{chap:DWATaccessibilitycandadadeclarations}
189 {Accessibility of declarations} (\addtoindex{C++}, \addtoindex{Ada}) \\
190 &\livelink{chap:DWATaccessibilitycppbaseclasses}
191 {Accessibility of base classes} (\addtoindex{C++}) \\
192 &\livelink{chap:DWATaccessibilitycppinheritedmembers}
193 {Accessibility of inherited members} (\addtoindex{C++}) \\
194 \DWATaddressclassTARG
195 &\livelinki{chap:DWATadressclasspointerorreferencetypes}
196 {Pointer or reference types}
197 {pointer or reference types} \\
198 &\livelinki{chap:DWATaddressclasssubroutineorsubroutinetype}
199 {Subroutine or subroutine type}
200 {subroutine or subroutine type} \\
202 &\livelinki{chap:DWATaddrbaseforaddresstable}
203 {Base offset for address table}
206 &\livelinki{chap:DWATalignmentnondefault}
207 {Non-default alignment of type, subprogram or variable}
208 {non-default alignment} \addtoindexx{alignment!non-default} \\
210 &\livelinki{chap:DWATallocatedallocationstatusoftypes}
211 {Allocation status of types}
212 {allocation status of types} \\
214 &\livelinki{chap:DWATartificialobjectsortypesthat}
215 {Objects or types that are not actually declared in the source}
216 {objects or types that are not actually declared in the source} \\
217 \DWATassociatedTARG{}
218 &\livelinki{chap:DWATassociatedassociationstatusoftypes}
219 {Association status of types}
220 {association status of types} \\
222 &\livelinki{chap:DWATbasetypesprimitivedatatypesofcompilationunit}
223 {Primitive data types of compilation unit}
224 {primitive data types of compilation unit} \\
225 \DWATbinaryscaleTARG{}
226 &\livelinki{chap:DWATbinaryscalebinaryscalefactorforfixedpointtype}
227 {Binary scale factor for fixed-point type}
228 {binary scale factor for fixed-point type} \\
229 %\DWATbitoffsetTARG{}
230 %&\livelinki{chap:DWATbitoffsetbasetypebitlocation}{Base type bit location}{base type bit location} \\
231 %&\livelinki{chap:DWATbitoffsetdatamemberbitlocation}{Data member bit location}{data member bit location} \\
233 &\livelinki{chap:DWATbitsizebasetypebitsize}
234 {Size of a base type in bits}
235 {base type bit size} \\
236 &\livelinki{chap:DWATbitsizedatamemberbitsize}
237 {Size of a data member in bits}
238 {data member bit size} \\
240 &\livelinki{chap:DWATbitstridearrayelementstrideofarraytype}
241 {Array element stride (of array type)}
242 {array element stride (of array type)} \\
243 &\livelinki{chap:DWATbitstridesubrangestridedimensionofarraytype}
244 {Subrange stride (dimension of array type)}
245 {subrange stride (dimension of array type)} \\
246 &\livelinki{chap:DWATbitstrideenumerationstridedimensionofarraytype}
247 {Enumeration stride (dimension of array type)}
248 {enumeration stride (dimension of array type)} \\
250 &\livelinki{chap:DWATbytesizedataobjectordatatypesize}
251 {Size of a data object or data type in bytes}
252 {data object or data type size} \\
253 \DWATbytestrideTARG{}
254 &\livelinki{chap:DWATbytestridearrayelementstrideofarraytype}
255 {Array element stride (of array type)}
256 {array element stride (of array type)} \\
257 &\livelinki{chap:DWATbytestridesubrangestridedimensionofarraytype}
258 {Subrange stride (dimension of array type)}
259 {subrange stride (dimension of array type)} \\
260 &\livelinki{chap:DWATbytestrideenumerationstridedimensionofarraytype}
261 {Enumeration stride (dimension of array type)}
262 {enumeration stride (dimension of array type)} \\
263 \DWATcallallcallsTARG{}
264 &\livelinki{chap:DWATcallallcallsofasubprogram}
265 {All tail and normal calls in a subprogram are described by call site entries}
266 {all tail and normal calls are described}
267 \index{call site!summary!all tail and normal calls are described} \\
268 \DWATcallallsourcecallsTARG{}
269 &\livelinki{chap:DWATcallallsourcecallsofasubprogram}
270 {All tail, normal and inlined calls in a subprogram are described by call site and inlined subprogram entries}
271 {all tail, normal and inlined calls are described}
272 \index{call site!summary!all tail, normal and inlined calls are described} \\
273 \DWATcallalltailcallsTARG{}
274 &\livelinki{chap:DWATcallalltailcallsofasubprogram}
275 {All tail calls in a subprogram are described by call site entries}
276 {all tail calls are described}
277 \index{call site!summary!all tail calls are described} \\
278 \DWATcallcolumnTARG{}
279 &\livelinki{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}
280 {Column position of inlined subroutine call}
281 {column position of inlined subroutine call} \\
282 \DWATcalldatalocationTARG{}
283 &\livelinki{chap:DWATcalldatalocationofcallparameter}
284 {Address of the value pointed to by an argument passed in a call}
285 {address of the value pointed to by an argument}
286 \index{call site!address of the value pointed to by an argument} \\
287 \DWATcalldatavalueTARG{}
288 &\livelinki{chap:DWATcalldatavalueofcallparameter}
289 {Value pointed to by an argument passed in a call}
290 {value pointed to by an argument}
291 \index{call site!value pointed to by an argument} \\
293 &\livelinki{chap:DWATcallfilefilecontaininginlinedsubroutinecall}
294 {File containing inlined subroutine call}
295 {file containing inlined subroutine call} \\
297 &\livelinki{chap:DWATcalllinelinenumberofinlinedsubroutinecall}
298 {Line number of inlined subroutine call}
299 {line number of inlined subroutine call} \\
300 \DWATcallingconventionTARG{}
301 &\livelinki{chap:DWATcallingconventionforsubprograms}
302 {Calling convention for subprograms}
303 {Calling convention!for subprograms} \\
304 &\livelinki{chap:DWATcallingconventionfortypes}
305 {Calling convention for types}
306 {Calling convention!for types} \\
307 \DWATcalloriginTARG{}
308 &\livelinki{chap:DWATcalloriginofcallsite}
309 {Subprogram called in a call}
311 \index{call site!subprogram called} \\
312 \DWATcallparameterTARG{}
313 &\livelinki{chap:DWATcallparameterofcallparameter}
314 {Parameter entry in a call}
316 \index{call site!parameter entry} \\
318 &\livelinki{chap:DWATcallpcofcallsite}
319 {Address of the call instruction in a call}
320 {address of call instruction}
321 \index{call site!address of the call instruction} \\
322 \DWATcallreturnpcTARG{}
323 &\livelinki{chap:DWATcallreturnpcofcallsite}
324 {Return address from a call}
325 {return address from a call}
326 \index{call site!return address} \\
327 \DWATcalltailcallTARG{}
328 &\livelinki{chap:DWATcalltailcallofcallsite}
329 {Call is a tail call}
330 {call is a tail call}
331 \index{call site!tail call} \\
332 \DWATcalltargetTARG{}
333 &\livelinki{chap:DWATcalltargetofcallsite}
334 {Address of called routine in a call}
335 {address of called routine}
336 \index{call site!address of called routine} \\
337 \DWATcalltargetclobberedTARG{}
338 &\livelinki{chap:DWATcalltargetclobberedofcallsite}
339 {Address of called routine, which may be clobbered, in a call}
340 {address of called routine, which may be clobbered}
341 \index{call site!address of called routine, which may be clobbered} \\
343 &\livelinki{chap:DWATcallvalueofcallparameter}
344 {Argument value passed in a call}
345 {argument value passed}
346 \index{call site!argument value passed} \\
347 \DWATcommonreferenceTARG
348 &\livelinki{chap:commonreferencecommonblockusage}
350 {common block usage} \\
352 &\livelinki{chap:DWATcompdircompilationdirectory}
353 {Compilation directory}
354 {compilation directory} \\
356 &\livelinki{chap:DWATconstexprcompiletimeconstantobject}
357 {Compile-time constant object}
358 {compile-time constant object} \\
359 &\livelinki{chap:DWATconstexprcompiletimeconstantfunction}
360 {Compile-time constant function}
361 {compile-time constant function} \\
363 &\livelinki{chap:DWATconstvalueconstantobject}
366 &\livelinki{chap:DWATconstvalueenumerationliteralvalue}
367 {Enumeration literal value}
368 {enumeration literal value} \\
369 &\livelinki{chap:DWATconstvaluetemplatevalueparameter}
370 {Template value parameter}
371 {template value parameter} \\
372 \DWATcontainingtypeTARG
373 &\livelinki{chap:DWATcontainingtypecontainingtypeofpointertomembertype}
374 {Containing type of pointer to member type}
375 {containing type of pointer to member type} \\
377 &\livelinki{chap:DWATcountelementsofsubrangetype}
378 {Elements of subrange type}
379 {elements of breg subrange type} \\
380 \DWATdatabitoffsetTARG
381 &\livelinki{chap:DWATdatabitoffsetbasetypebitlocation}
382 {Base type bit location}
383 {base type bit location} \\
384 &\livelinki{chap:DWATdatabitoffsetdatamemberbitlocation}
385 {Data member bit location}
386 {data member bit location} \\
387 \DWATdatalocationTARG{}
388 &\livelinki{chap:DWATdatalocationindirectiontoactualdata}
389 {Indirection to actual data}
390 {indirection to actual data} \\
391 \DWATdatamemberlocationTARG
392 &\livelinki{chap:DWATdatamemberlocationdatamemberlocation}
393 {Data member location}
394 {data member location} \\
395 &\livelinki{chap:DWATdatamemberlocationinheritedmemberlocation}
396 {Inherited member location}
397 {inherited member location} \\
398 \DWATdecimalscaleTARG
399 &\livelinki{chap:DWATdecimalscaledecimalscalefactor}
400 {Decimal scale factor}
401 {decimal scale factor} \\
403 &\livelinki{chap:DWATdecimalsigndecimalsignrepresentation}
404 {Decimal sign representation}
405 {decimal sign representation} \\
407 &\livelinki{chap:DWATdeclcolumncolumnpositionofsourcedeclaration}
408 {Column position of source declaration}
409 {column position of source declaration} \\
411 &\livelinki{chap:DWATdeclfilefilecontainingsourcedeclaration}
412 {File containing source declaration}
413 {file containing source declaration} \\
415 &\livelinki{chap:DWATdecllinelinenumberofsourcedeclaration}
416 {Line number of source declaration}
417 {line number of source declaration} \\
419 &\livelinki{chap:DWATdeclarationincompletenondefiningorseparateentitydeclaration}
420 {Incomplete, non-defining, or separate entity declaration}
421 {incomplete, non-defining, or separate entity declaration} \\
423 &\livelinki{chap:DWATdefaulteddef}
424 {Whether a member function has been declared as default}
425 {defaulted attribute} \\
426 \DWATdefaultvalueTARG
427 &\livelinki{chap:DWATdefaultvaluedefaultvalueofparameter}
428 {Default value of parameter}
429 {default value of parameter} \\
431 &\livelinki{chap:DWATdeleteddef}
432 {Whether a member has been declared as deleted}
433 {Deletion of member function} \\
434 \DWATdescriptionTARG{}
435 &\livelinki{chap:DWATdescriptionartificialnameordescription}
436 {Artificial name or description}
437 {artificial name or description} \\
439 &\livelinki{chap:DWATdigitcountdigitcountforpackeddecimalornumericstringtype}
440 {Digit count for packed decimal or numeric string type}
441 {digit count for packed decimal or numeric string type} \\
443 &\livelinki{chap:DWATdiscrdiscriminantofvariantpart}
444 {Discriminant of variant part}
445 {discriminant of variant part} \\
447 &\livelinki{chap:DWATdiscrlistlistofdiscriminantvalues}
448 {List of discriminant values}
449 {list of discriminant values} \\
451 &\livelinki{chap:DWATdiscrvaluediscriminantvalue}
453 {discriminant value} \\
455 &\livelinki{chap:DWATdwoidforunit}
456 {Signature for compilation unit}
457 {split DWARF object file!unit signature} \\
459 &\livelinki{chap:DWATdwonameforunit}
460 {Name of split DWARF object file}
461 {split DWARF object file!object file name} \\
463 &\livelinki{chap:DWATelementalelementalpropertyofasubroutine}
464 {Elemental property of a subroutine}
465 {elemental property of a subroutine} \\
467 &\livelinki{chap:DWATencodingencodingofbasetype}
468 {Encoding of base type}
469 {encoding of base type} \\
471 &\livelinki{chap:DWATendianityendianityofdata}
473 {endianity of data} \\
475 &\livelinki{chap:entryaddressofscope}
476 {Entry address of a scope (compilation unit, \mbox{subprogram,} and so on)}
477 {entry address of a scope} \\
479 &\livelinki{chap:DWATenumclasstypesafeenumerationdefinition}
480 {Type safe enumeration definition}
481 {type safe enumeration definition}\\
483 &\livelinki{chap:DWATexplicitexplicitpropertyofmemberfunction}
484 {Explicit property of member function}
485 {explicit property of member function}\\
486 \DWATexportsymbolsTARG
487 &\livelinki{chap:DWATexportsymbolsofnamespace}
488 {Export (inline) symbols of namespace}
489 {export symbols of a namespace} \\
490 &\livelinki{chap:DWATexportsymbolsofstructunionclass}
491 {Export symbols of a structure, union or class}
492 {export symbols of a structure, union or class} \\
494 &\livelinki{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}
495 {Previous namespace extension or original namespace}
496 {previous namespace extension or original namespace}\\
498 &\livelinki{chap:DWATexternalexternalsubroutine}
499 {External subroutine}
500 {external subroutine} \\
501 &\livelinki{chap:DWATexternalexternalvariable}
503 {external variable} \\
505 &\livelinki{chap:DWATframebasesubroutineframebaseaddress}
506 {Subroutine frame base address}
507 {subroutine frame base address} \\
509 &\livelinki{chap:DWATfriendfriendrelationship}
510 {Friend relationship}
511 {friend relationship} \\
513 &\livelinki{chap:DWAThighpccontiguousrangeofcodeaddresses}
514 {Contiguous range of code addresses}
515 {contiguous range of code addresses} \\
516 \DWATidentifiercaseTARG
517 &\livelinki{chap:DWATidentifiercaseidentifiercaserule}
518 {Identifier case rule}
519 {identifier case rule} \\
521 &\livelinki{chap:DWATimportimporteddeclaration}
522 {Imported declaration}
523 {imported declaration} \\
524 &\livelinki{chap:DWATimportimportedunit}
527 &\livelinki{chap:DWATimportnamespacealias}
530 &\livelinki{chap:DWATimportnamespaceusingdeclaration}
531 {Namespace using declaration}
532 {namespace using declaration} \\
533 &\livelinki{chap:DWATimportnamespaceusingdirective}
534 {Namespace using directive}
535 {namespace using directive} \\
537 &\livelinki{chap:DWATinlineabstracttinstance}
539 {abstract instance} \\
540 &\livelinki{chap:DWATinlineinlinedsubroutine}
542 {inlined subroutine} \\
544 &\livelinki{chap:DWATisoptionaloptionalparameter}
546 {optional parameter} \\
548 &\livelinki{chap:DWATlanguageprogramminglanguage}
549 {Programming language}
550 {programming language} \\
552 &\livelinki{chap:DWATlinkagenameobjectfilelinkagenameofanentity}
553 {Object file linkage name of an entity}
554 {object file linkage name of an entity}\\
556 &\livelinki{chap:DWATlocationdataobjectlocation}
557 {Data object location}
558 {data object location}\\
560 &\livelinki{chap:DWATlowpccodeaddressorrangeofaddresses}
561 {Code address or range of addresses}
562 {code address or range of addresses}\\
564 &\livelinki{chap:DWATlowerboundlowerboundofsubrange}
565 {Lower bound of subrange}
566 {lower bound of subrange} \\
568 &\livelinki{chap:DWATmacroinfomacroinformation}
569 {Macro preprocessor information (legacy)}
570 {macro preprocessor information (legacy)} \\
571 & \textit{(reserved for coexistence with \DWARFVersionIV{} and earlier)} \\
573 &\livelinki{chap:DWATmacrosmacroinformation}
574 {Macro preprocessor information}
575 {macro preprocessor information} \\
576 & \textit{(\texttt{\#define}, \texttt{\#undef}, and so on in \addtoindex{C},
577 \addtoindex{C++} and similar languages)} \\
578 \DWATmainsubprogramTARG
579 &\livelinki{chap:DWATmainsubprogrammainorstartingsubprogram}
580 {Main or starting subprogram}
581 {main or starting subprogram} \\
582 &\livelinki{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}
583 {Unit containing main or starting subprogram}
584 {unit containing main or starting subprogram}\\
586 &\livelinki{chap:DWATmutablemutablepropertyofmemberdata}
587 {Mutable property of member data}
588 {mutable property of member data} \\
590 &\livelinki{chap:DWATnamenameofdeclaration}
591 {Name of declaration}
592 {name of declaration}\\
593 &\livelinki{chap:DWATnamepathnameofcompilationsource}
594 {Path name of compilation source}
595 {path name of compilation source} \\
596 \DWATnamelistitemTARG
597 &\livelinki{chap:DWATnamelistitemnamelistitem}
601 &\livelinki{chap:DWATnoreturnofsubprogram}
602 {\doublequote{no return} property of a subprogram}
603 {noreturn attribute} \\
604 \DWATobjectpointerTARG
605 &\livelinki{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}
606 {Object (\texttt{this}, \texttt{self}) pointer of member function}
607 {object (\texttt{this}, \texttt{self}) pointer of member function}\\
609 &\livelinki{chap:DWATorderingarrayrowcolumnordering}
610 {Array row/column ordering}
611 {array row/column ordering}\\
612 \DWATpicturestringTARG
613 &\livelinki{chap:DWATpicturestringpicturestringfornumericstringtype}
614 {Picture string for numeric string type}
615 {picture string for numeric string type} \\
617 &\livelinki{chap:DWATprioritymodulepriority}
621 &\livelinki{chap:DWATproducercompileridentification}
622 {Compiler identification}
623 {compiler identification}\\
625 &\livelinki{chap:DWATprototypedsubroutineprototype}
626 {Subroutine prototype}
627 {subroutine prototype}\\
629 &\livelinki{chap:DWATpurepurepropertyofasubroutine}
630 {Pure property of a subroutine}
631 {pure property of a subroutine} \\
633 &\livelinki{chap:DWATrangesnoncontiguousrangeofcodeaddresses}
634 {Non-contiguous range of code addresses}
635 {non-contiguous range of code addresses} \\
637 &\livelinki{chap:DWATrangesbaseforrangelists}
638 {Base offset for range lists}
641 &\livelinki{chap:DWATrankofdynamicarray}
642 {Dynamic number of array dimensions}
643 {dynamic number of array dimensions} \\
645 &\livelinki{chap:DWATrecursiverecursivepropertyofasubroutine}
646 {Recursive property of a subroutine}
647 {recursive property of a subroutine} \\
649 &\livelink{chap:DWATreferenceofnonstaticmember}
650 {\&-qualified non-static member function} \textit{(\addtoindex{C++})} \\
652 &\livelinki{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}
653 {Subroutine return address save location}
654 {subroutine return address save location} \\
655 \DWATrvaluereferenceTARG
656 &\livelink{chap:DWATrvaluereferenceofnonstaticmember}
657 {\&\&-qualified non-static member function} \textit{(\addtoindex{C++})} \\
660 &\livelinki{chap:DWATsegmentaddressinginformation}
661 {Addressing information}
662 {addressing information} \\
664 &\livelinki{chap:DWATsiblingdebugginginformationentryrelationship}
665 {Debugging information entry relationship}
666 {debugging information entry relationship} \\
668 &\livelinki{chap:DWATsmallscalefactorforfixedpointtype}
669 {Scale factor for fixed-point type}
670 {scale factor for fixed-point type} \\
672 &\livelinki{chap:DWATsignaturetypesignature}
675 \DWATspecificationTARG
676 &\livelinki{chap:DWATspecificationincompletenondefiningorseparatedeclaration}
677 {Incomplete, non-defining, or separate declaration corresponding to a declaration}
678 {incomplete, non-defining, or separate declaration corresponding to a declaration} \\
680 &\livelinki{chap:DWATstartscopeobjectdeclaration}
682 {object declaration}\\*
683 &\livelinki{chap:DWATstartscopetypedeclaration}
687 &\livelinki{chap:DWATstaticlinklocationofuplevelframe}
688 {Location of uplevel frame}
689 {location of uplevel frame} \\
691 &\livelinki{chap:DWATstmtlistlinenumberinformationforunit}
692 {Line number information for unit}
693 {line number information for unit}\\
694 \DWATstringlengthTARG
695 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
696 {String length of string type}
697 {string length of string type} \\
698 \DWATstringlengthbitsizeTARG
699 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
700 {Size of string length of string type}
701 {string length of string type!size of} \\
702 \DWATstringlengthbytesizeTARG
703 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
704 {Size of string length of string type}
705 {string length of string type!size of} \\
706 \DWATstroffsetsbaseTARG
707 &\livelinki{chap:DWATstroffsetbaseforindirectstringtable}
708 {Base of string offsets table}
709 {string offsets table} \\
710 \DWATthreadsscaledTARG
711 &\livelink{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}
712 {UPC array bound THREADS scale factor}\\
714 &\livelinki{chap:DWATtrampolinetargetsubroutine}
716 {target subroutine of trampoline} \\
718 &\livelinki{chap:DWATtypeofcallsite}
720 {type!of call site} \\
721 &\livelinki{char:DWAATtypeofstringtype}
722 {Type of string type components}
723 {type!of string type components} \\
724 &\livelinki{chap:DWATtypetypeofsubroutinereturn}
725 {Type of subroutine return}
726 {type!of subroutine return} \\
727 &\livelinki{chap:DWATtypetypeofdeclaration}
728 {Type of declaration}
729 {type!of declaration} \\
731 &\livelinki{chap:DWATupperboundupperboundofsubrange}
732 {Upper bound of subrange}
733 {upper bound of subrange} \\
735 &\livelinki{chap:DWATuselocationmemberlocationforpointertomembertype}
736 {Member location for pointer to member type}
737 {member location for pointer to member type} \\
738 \DWATuseUTFeightTARG\addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
739 &\livelinki{chap:DWATuseUTF8compilationunitusesutf8strings}
740 {Compilation unit uses UTF-8 strings}
741 {compilation unit uses UTF-8 strings} \\
742 \DWATvariableparameterTARG
743 &\livelinki{chap:DWATvariableparameternonconstantparameterflag}
744 {Non-constant parameter flag}
745 {non-constant parameter flag} \\
747 &\livelinki{chap:DWATvirtualityvirtualityindication}
748 {Virtuality indication}
749 {virtuality indication} \\
750 &\livelinki{chap:DWATvirtualityvirtualityofbaseclass}
751 {Virtuality of base class}
752 {virtuality of base class} \\
753 &\livelinki{chap:DWATvirtualityvirtualityoffunction}
754 {Virtuality of function}
755 {virtuality of function} \\
757 &\livelinki{chap:DWATvisibilityvisibilityofdeclaration}
758 {Visibility of declaration}
759 {visibility of declaration} \\
760 \DWATvtableelemlocationTARG
761 &\livelinki{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}
762 {Virtual function vtable slot}
763 {virtual function vtable slot}\\
766 \addtoindexx{address|see {\textit{also} address class}}
767 \addtoindexx{addrptr|see {\textit{also} addrptr class}}
768 \addtoindexx{block|see {\textit{also} block class}}
769 \addtoindexx{constant|see {\textit{also} constant class}}
770 \addtoindexx{exprloc|see {\textit{also} exprloc class}}
771 \addtoindexx{flag|see {\textit{also} flag class}}
772 \addtoindexx{lineptr|see {\textit{also} lineptr class}}
773 \addtoindexx{loclistptr|see {\textit{also} loclistptr class}}
774 \addtoindexx{macptr|see {\textit{also} macptr class}}
775 \addtoindexx{rangelistptr|see {\textit{also} rangelistptr class}}
776 \addtoindexx{reference|see {\textit{also} reference class}}
777 \addtoindexx{string|see {\textit{also} string class}}
778 \addtoindexx{stroffsetsptr|see {\textit{also} stroffsetsptr class}}
780 \addtoindexx{class of attribute value!address|see {address class}}
781 \addtoindexx{class of attribute value!addrptr|see {addrptr class}}
782 \addtoindexx{class of attribute value!block|see {block class}}
783 \addtoindexx{class of attribute value!constant|see {constant class}}
784 \addtoindexx{class of attribute value!exprloc|see {exprloc class}}
785 \addtoindexx{class of attribute value!flag|see {flag class}}
786 \addtoindexx{class of attribute value!lineptr|see {lineptr class}}
787 \addtoindexx{class of attribute value!loclistptr|see {loclistptr class}}
788 \addtoindexx{class of attribute value!macptr|see {macptr class}}
789 \addtoindexx{class of attribute value!rangelistptr|see {rangelistptr class}}
790 \addtoindexx{class of attribute value!reference|see {reference class}}
791 \addtoindexx{class of attribute value!string|see {string class}}
792 \addtoindexx{class of attribute value!stroffsetsptr|see {stroffsetsptr class}}
794 The permissible values
795 \addtoindexx{attribute value classes}
796 for an attribute belong to one or more classes of attribute
798 Each form class may be represented in one or more ways.
799 For example, some attribute values consist
800 of a single piece of constant data.
801 \doublequote{Constant data}
802 is the class of attribute value that those attributes may have.
803 There are several representations of constant data,
804 however (one, two, four, or eight bytes, and variable length
806 The particular representation for any given instance
807 of an attribute is encoded along with the attribute name as
808 part of the information that guides the interpretation of a
809 debugging information entry.
812 Attribute value forms belong
813 \addtoindexx{tag names!list of}
814 to one of the classes shown in Table \referfol{tab:classesofattributevalue}.
816 \begin{longtable}{l|P{11cm}}
817 \caption{Classes of attribute value}
818 \label{tab:classesofattributevalue} \\
819 \hline \bfseries Attribute Class & \bfseries General Use and Encoding \\ \hline
821 \bfseries Attribute Class & \bfseries General Use and Encoding \\ \hline
823 \hline \emph{Continued on next page}
828 \hypertarget{chap:classaddress}{}
829 \livelinki{datarep:classaddress}{address}{address class}
830 &Refers to some location in the address space of the \mbox{described} program.
833 \hypertarget{chap:classaddrptr}{}
834 \livelinki{datarep:classaddrptr}{addrptr}{addrptr class}
835 &Refers to a base location in the DWARF section that holds
836 a series of machine address values. Certain attributes \mbox{refer}
837 one of these addresses by indexing relative to this base
841 \hypertarget{chap:classblock}{}
842 \livelinki{datarep:classblock}{block}{block class}
843 & An arbitrary number of uninterpreted bytes of data.
846 \hypertarget{chap:classconstant}{}
847 \livelinki{datarep:classconstant}{constant}{constant class}
848 &One, two, four or eight bytes of uninterpreted data, or data
849 encoded in the variable length format known as LEB128
850 (see Section \refersec{datarep:variablelengthdata}).
852 \textit{Most constant values are integers of one kind or
853 another (codes, offsets, counts, and so on); these are
854 sometimes called \doublequote{integer constants} for emphasis.}
855 \addtoindexx{integer constant}
856 \addtoindexx{constant class!integer}
859 \hypertarget{chap:classexprloc}{}
860 \livelinki{datarep:classexprloc}{exprloc}{exprloc class}
861 &A DWARF expression for a value or a location in the \mbox{address} space of the described program.
864 \hypertarget{chap:classflag}{}
865 \livelinki{datarep:classflag}{flag}{flag class}
866 &A small constant that indicates the presence or absence of an attribute.
869 \hypertarget{chap:classlineptr}{}
870 \livelinki{datarep:classlineptr}{lineptr}{lineptr class}
871 &Refers to a location in the DWARF section that holds line number information.
874 \hypertarget{chap:classloclistptr}{}
875 \livelinki{datarep:classloclistptr}{loclistptr}{loclistptr class}
876 &Refers to a location in the DWARF section that holds \mbox{location} lists, which
877 describe objects whose location can change during their lifetime.
880 \hypertarget{chap:classmacptr}{}
881 \livelinki{datarep:classmacptr}{macptr}{macptr class}
882 & Refers to a location in the DWARF section that holds macro definition
886 \hypertarget{chap:classrangelistptr}{}
887 \livelinki{datarep:classrangelistptr}{rangelistptr}{rangelistptr class}
888 & Refers to a location in the DWARF section that holds non\dash contiguous address ranges.
891 \hypertarget{chap:classreference}{}
892 \livelinki{datarep:classreference}{reference}{reference class}
893 & Refers to one of the debugging information
894 entries that \mbox{describe} the program. There are four types of
895 \mbox{reference}. The first is an offset relative to the beginning
896 of the \mbox{compilation} unit in which the reference occurs and must
897 refer to an entry within that same compilation unit. The second
898 type of reference is the offset of a debugging \mbox{information}
899 entry in any compilation unit, including one different from
900 the unit containing the reference. The third type of reference
901 is an indirect reference to a
902 \addtoindexx{type signature}
903 type definition using a 64-bit \mbox{signature}
904 for that type. The fourth type of reference is a reference from within the
905 \dotdebuginfo{} section of the executable or shared object file to
906 a debugging information entry in the \dotdebuginfo{} section of
907 a \addtoindex{supplementary object file}.
910 \hypertarget{chap:classstring}{}
911 \livelinki{datarep:classstring}{string}{string class}
912 & A null\dash terminated sequence of zero or more
913 (non\dash null) bytes. Data in this class are generally
914 printable strings. Strings may be represented directly in
915 the debugging \mbox{information} entry or as an offset in a separate
919 \hypertarget{chap:classstroffsetsptr}{}
920 \livelinki{datarep:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class}
921 &Refers to a base location in the DWARF section that holds
922 a series of offsets in the DWARF section that holds strings.
923 Certain attributes refer to one of these offsets by indexing
924 \mbox{relative} to this base location. The resulting offset is then
925 used to index into the DWARF string section.
932 \section{Relationship of Debugging Information Entries}
933 \label{chap:relationshipofdebugginginformationentries}
935 A variety of needs can be met by permitting a single
936 \addtoindexx{debugging information entry!ownership relation}
937 debugging information entry to \doublequote{own} an arbitrary number
938 of other debugging entries and by permitting the same debugging
939 information entry to be one of many owned by another debugging
941 This makes it possible, for example, to
942 describe the static \livelink{chap:lexicalblock}{block} structure
943 within a source file,
944 to show the members of a structure, union, or class, and to
945 associate declarations with source files or source files
946 with shared object files.
950 The ownership relation
951 \addtoindexx{debugging information entry!ownership relation}
953 information entries is achieved naturally because the debugging
954 information is represented as a tree.
955 The nodes of the tree
956 are the debugging information entries themselves.
958 entries of any node are exactly those debugging information
959 entries owned by that node.
963 While the ownership relation
964 of the debugging information entries is represented as a
965 tree, other relations among the entries exist, for example,
966 a reference from an entry representing a variable to another
967 entry representing the type of that variable.
969 relations are taken into account, the debugging entries
970 form a graph, not a tree.
974 The tree itself is represented
975 by flattening it in prefix order.
976 Each debugging information
977 entry is defined either to have child entries or not to have
978 child entries (see Section \refersec{datarep:abbreviationstables}).
979 If an entry is defined not
980 to have children, the next physically succeeding entry is a
982 If an entry is defined to have children, the next
983 physically succeeding entry is its first child.
985 children are represented as siblings of the first child.
986 A chain of sibling entries is terminated by a null entry.
988 In cases where a producer of debugging information feels that
989 \hypertarget{chap:DWATsiblingdebugginginformationentryrelationship}{}
990 it will be important for consumers of that information to
991 quickly scan chains of sibling entries, while ignoring the
992 children of individual siblings, that producer may attach a
993 \addtoindexx{sibling attribute}
994 \DWATsiblingDEFN{} attribute
995 to any debugging information entry.
996 The value of this attribute is a reference to the sibling entry
997 of the entry to which the attribute is attached.
1000 \section{Target Addressable Units and Addresses}
1001 \label{chap:targetaddressableunitsandaddresses}
1002 The standard assumes that the smallest directly
1003 \addtoindex{addressable unit} of memory on the
1004 target architecture is a byte consisting of eight bits.
1006 \label{chap:targetaddresses}
1007 Many places in this document refer to the size of an
1008 \addtoindexx{size of an address|see{\textit{also} \texttt{address\_size}}}
1009 \addtoindexi{address}{size of an address}
1010 \addtoindexx{address size|see{size of an address}}
1011 \addtoindexx{address size|see{\textit{also} \texttt{address\_size}}}
1012 on the target architecture (or equivalently, target machine)
1013 to which a DWARF description applies. For processors which
1014 can be configured to have different address sizes or different
1015 instruction sets, the intent is to refer to the configuration
1016 which is either the default for that processor or which is
1017 specified by the object file or executable file which contains
1018 the DWARF information.
1021 For example, if a particular target architecture supports
1022 both 32-bit and 64-bit addresses, the compiler will generate
1023 an object file which specifies that it contains executable
1024 code generated for one or the other of these
1025 \addtoindexx{size of an address}
1027 that case, the DWARF debugging information contained in this
1028 object file will use the same address size.
1032 Architectures which have multiple instruction sets are
1033 supported by the \texttt{isa} entry in the line number information
1034 (see Section \refersec{chap:statemachineregisters}).
1038 \section{DWARF Expressions}
1039 \label{chap:dwarfexpressions}
1040 DWARF expressions describe how to compute a value or name a
1041 location during debugging of a program.
1042 They are expressed in
1043 terms of DWARF operations that operate on a stack of values.
1045 All DWARF operations are encoded as a stream of opcodes that
1046 are each followed by zero or more literal operands.
1048 of operands is determined by the opcode.
1051 general operations that are defined here, operations that are
1052 specific to location descriptions are defined in
1053 Section \refersec{chap:locationdescriptions}.
1055 \subsection{General Operations}
1056 \label{chap:generaloperations}
1057 Each general operation represents a postfix operation on
1058 a simple stack machine.
1059 Each element of the stack has a type and a value, and can represent
1060 a value of any supported base type of the target machine. Instead of
1061 a base type, elements can have a
1062 \livetarg{chap:specialaddresstype}{special address type},
1063 which is an integral type that has the
1064 \addtoindex{size of an address} on the target machine and
1065 unspecified signedness. The value on the top of the stack after
1066 \doublequote{executing} the
1067 \addtoindex{DWARF expression}
1069 \addtoindexx{DWARF expression|see{\textit{also} location description}}
1070 taken to be the result (the address of the object, the
1071 value of the array bound, the length of a dynamic string,
1072 the desired value itself, and so on).
1075 \textit{While the abstract definition of the stack calls for variable-size entries
1076 able to hold any supported base type, in practice it is expected that each
1077 element of the stack can be represented as a fixed-size element large enough
1078 to hold a value of any type supported by the DWARF consumer for that target,
1079 plus a small identifier sufficient to encode the type of that element.
1080 Support for base types other than what is required to do address arithmetic
1081 is intended only for debugging of optimized code, and the completeness of the
1082 DWARF consumer's support for the full set of base types is a
1083 quality-of-implementation issue. If a consumer encounters a DWARF expression
1084 that uses a type it does not support, it should ignore the entire expression
1085 and report its inability to provide the requested information.}
1087 \textit{It should also be noted that floating-point arithmetic is highly dependent
1088 on the computational environment. It is not the intention of this expression
1089 evaluation facility to produce identical results to those produced by the
1090 program being debugged while executing on the target machine. Floating-point
1091 computations in this stack machine will be done with precision control and
1092 rounding modes as defined by the implementation.}
1095 \subsubsection{Literal Encodings}
1096 \label{chap:literalencodings}
1098 \addtoindexx{DWARF expression!literal encodings}
1099 following operations all push a value onto the DWARF
1101 \addtoindexx{DWARF expression!stack operations}
1102 Operations other than \DWOPconsttype{} push a value with the
1103 \specialaddresstype, and if the value of a constant in one of these
1104 operations is larger than can be stored in a single stack element,
1105 the value is truncated to the element size and the low-order bits
1106 are pushed on the stack.
1107 \begin{enumerate}[1. ]
1108 \itembfnl{\DWOPlitzeroTARG, \DWOPlitoneTARG, \dots, \DWOPlitthirtyoneTARG}
1109 The \DWOPlitnTARG{} operations encode the unsigned literal values
1110 from 0 through 31, inclusive.
1112 \itembfnl{\DWOPaddrTARG}
1113 The \DWOPaddrNAME{} operation has a single operand that encodes
1114 a machine address and whose size is the \addtoindex{size of an address}
1115 on the target machine.
1117 \itembfnl{\DWOPconstoneuTARG, \DWOPconsttwouTARG, \DWOPconstfouruTARG, \DWOPconsteightuTARG}
1119 The single operand of a \DWOPconstnuNAME{} operation provides a 1,
1120 2, 4, or 8-byte unsigned integer constant, respectively.
1122 \itembfnl{\DWOPconstonesTARG, \DWOPconsttwosTARG, \DWOPconstfoursTARG, \DWOPconsteightsTARG}
1123 The single operand of a \DWOPconstnsNAME{} operation provides a 1,
1124 2, 4, or 8-byte signed integer constant, respectively.
1126 \itembfnl{\DWOPconstuTARG}
1127 The single operand of the \DWOPconstuNAME{} operation provides
1128 an unsigned LEB128\addtoindexx{LEB128!unsigned} integer constant.
1130 \itembfnl{\DWOPconstsTARG}
1131 The single operand of the \DWOPconstsNAME{} operation provides
1132 a signed LEB128\addtoindexx{LEB128!unsigned} integer constant.
1135 \itembfnl{\DWOPaddrxTARG}
1136 The \DWOPaddrxNAME{} operation has a single operand that
1137 encodes an unsigned LEB128\addtoindexx{LEB128!unsigned} value,
1138 which is a zero-based index into the \dotdebugaddr{} section,
1139 where a machine address is stored.
1140 This index is relative to the value of the
1141 \DWATaddrbase{} attribute of the associated compilation unit.
1143 \itembfnl{\DWOPconstxTARG}
1144 The \DWOPconstxNAME{} operation has a single operand that
1145 encodes an unsigned LEB128\addtoindexx{LEB128!unsigned} value,
1146 which is a zero-based
1147 index into the \dotdebugaddr{} section, where a constant, the
1148 size of a machine address, is stored.
1149 This index is relative to the value of the
1150 \DWATaddrbase{} attribute of the associated compilation unit.
1153 \textit{The \DWOPconstxNAME{} operation is provided for constants that
1154 require link-time relocation but should not be
1155 interpreted by the consumer as a relocatable address
1156 (for example, offsets to thread-local storage).}
1159 \itembfnl{\DWOPconsttypeTARG}
1160 The \DWOPconsttypeNAME{} operation takes three operands. The first operand
1161 is an unsigned LEB128 integer that represents the offset of a debugging
1162 information entry in the current compilation unit, which must be a
1163 \DWTAGbasetype{} entry that provides the type of the constant provided. The
1164 second operand is 1-byte unsigned integer that specifies the size of the
1165 constant value, which is the same as the size of the base type referenced
1166 by the first operand. The third operand is a block of specified
1167 size that is to be interpreted as a value of the referenced type.
1169 \textit{While the size of the constant can be inferred from the base type
1170 definition, it is encoded explicitly into the operation so that the
1171 operation can be parsed easily without reference to the \dotdebuginfo{}
1177 \subsubsection{Register Values}
1178 \label{chap:registervalues}
1179 The following operations push a value onto the stack that is either the
1180 contents of a register or the result of adding the contents of a register
1181 to a given signed offset.
1182 \addtoindexx{DWARF expression!register based addressing}
1183 \DWOPregvaltype{} pushes the contents
1184 of the register together with the given base type, while the other operations
1185 push the result of adding the contents of a register to a given
1186 signed offset together with the \specialaddresstype.
1189 \begin{enumerate}[1. ]
1190 \itembfnl{\DWOPfbregTARG}
1191 The \DWOPfbregNAME{} operation provides a
1192 signed LEB128\addtoindexx{LEB128!signed} offset
1193 from the address specified by the location description in the
1194 \DWATframebase{} attribute of the current function. (This
1195 is typically a \doublequote{stack pointer} register plus or minus
1196 some offset. On more sophisticated systems it might be a
1197 location list that adjusts the offset according to changes
1198 in the stack pointer as the PC changes.)
1200 \itembfnl{\DWOPbregzeroTARG, \DWOPbregoneTARG, \dots, \DWOPbregthirtyoneTARG}
1201 The single operand of the \DWOPbregnTARG{}
1203 a signed LEB128\addtoindexx{LEB128!signed} offset from
1204 the specified register.
1206 \itembfnl{\DWOPbregxTARG}
1207 The \DWOPbregxNAME{} operation provides the sum of two values specified
1208 by its two operands. The first operand is a register number
1209 which is specified by an unsigned LEB128\addtoindexx{LEB128!unsigned}
1210 number. The second operand is a signed LEB128\addtoindexx{LEB128!signed} offset.
1213 \itembfnl{\DWOPregvaltypeTARG}
1214 The \DWOPregvaltypeNAME{} operation provides the contents of
1215 a given register interpreted as a value of a given type. The first
1216 operand is an unsigned LEB128\addtoindexx{LEB128!unsigned} number,
1217 which identifies a register whose contents is to
1218 be pushed onto the stack. The second operand is an
1219 unsigned LEB128\addtoindexx{LEB128!unsigned} number
1220 that represents the offset of a debugging information entry in the current
1221 compilation unit, which must be a \DWTAGbasetype{} entry that provides the
1222 type of the value contained in the specified register.
1227 \subsubsection{Stack Operations}
1228 \label{chap:stackoperations}
1230 \addtoindexx{DWARF expression!stack operations}
1231 operations manipulate the DWARF stack. Operations
1232 that index the stack assume that the top of the stack (most
1233 recently added entry) has index 0.
1235 The \DWOPdup{}, \DWOPdrop{}, \DWOPpick{}, \DWOPover{}, \DWOPswap{}
1236 and \DWOProt{} operations manipulate the elements of the stack as pairs
1237 consisting of the value together with its type identifier.
1238 The \DWOPderef{}, \DWOPderefsize{}, \DWOPxderef{}, \DWOPxderefsize{}
1239 and \DWOPformtlsaddress{}
1240 operations require the popped values to have an integral type, either the
1241 \specialaddresstype{} or some other integral base type, and push a
1242 value with the \specialaddresstype.
1243 \DWOPdereftype{} and \DWOPxdereftype{} operations have the
1244 same requirement on the popped values, but push a value together
1245 with the same type as the popped values.
1246 All other operations push a value together with the \specialaddresstype.
1248 \begin{enumerate}[1. ]
1249 \itembfnl{\DWOPdupTARG}
1250 The \DWOPdupNAME{} operation duplicates the value (including its
1251 type identifier) at the top of the stack.
1253 \itembfnl{\DWOPdropTARG}
1254 The \DWOPdropNAME{} operation pops the value (including its type
1255 identifier) at the top of the stack.
1257 \itembfnl{\DWOPpickTARG}
1258 The single operand of the \DWOPpickNAME{} operation provides a
1259 1-byte index. A copy of the stack entry (including its
1260 type identifier) with the specified
1261 index (0 through 255, inclusive) is pushed onto the stack.
1263 \itembfnl{\DWOPoverTARG}
1264 The \DWOPoverNAME{} operation duplicates the entry currently second
1265 in the stack at the top of the stack.
1266 This is equivalent to a
1267 \DWOPpick{} operation, with index 1.
1270 \itembfnl{\DWOPswapTARG}
1271 The \DWOPswapNAME{} operation swaps the top two stack entries.
1272 The entry at the top of the stack (including its type identifier)
1273 becomes the second stack entry, and the second entry (including
1274 its type identifier) becomes the top of the stack.
1276 \itembfnl{\DWOProtTARG}
1277 The \DWOProtNAME{} operation rotates the first three stack
1278 entries. The entry at the top of the stack (including its
1279 type identifier) becomes the third stack entry, the second
1280 entry (including its type identifier) becomes the top of
1281 the stack, and the third entry (including its type identifier)
1282 becomes the second entry.
1284 \itembfnl{\DWOPderefTARG}
1285 The \DWOPderefNAME{} operation pops the top stack entry and
1286 treats it as an address. The popped value must have an integral type.
1287 The value retrieved from that address is pushed, together with the
1288 \specialaddresstype{} identifier.
1289 The size of the data retrieved from the
1290 \addtoindexi{dereferenced}{address!dereference operator}
1291 address is the \addtoindex{size of an address} on the target machine.
1294 \itembfnl{\DWOPderefsizeTARG}
1295 The \DWOPderefsizeNAME{} operation behaves like the
1297 operation: it pops the top stack entry and treats it as an
1298 address. The popped value must have an integral type.
1299 The value retrieved from that address is pushed, together with the
1300 \specialaddresstype{} identifier. In
1301 the \DWOPderefsizeNAME{} operation, however, the size in bytes
1302 of the data retrieved from the dereferenced address is
1303 specified by the single operand. This operand is a 1-byte
1304 unsigned integral constant whose value may not be larger
1305 than the size of the \specialaddresstype. The data
1306 retrieved is zero extended to the size of an address on the
1307 target machine before being pushed onto the expression stack.
1309 \itembfnl{\DWOPdereftypeTARG}
1310 The \DWOPdereftypeNAME{} operation behaves like the \DWOPderefsize{} operation:
1311 it pops the top stack entry and treats it as an address.
1312 The popped value must have an integral type.
1313 The value retrieved from that address is pushed together with a type identifier.
1314 In the \DWOPdereftypeNAME{} operation, the size in
1315 bytes of the data retrieved from the dereferenced address is specified by
1316 the first operand. This operand is a 1-byte unsigned integral constant whose
1317 value which is the same as the size of the base type referenced
1318 by the second operand.
1319 The second operand is an unsigned LEB128 integer that
1320 represents the offset of a debugging information entry in the current
1321 compilation unit, which must be a \DWTAGbasetype{} entry that provides the
1322 type of the data pushed.
1324 \textit{While the size of the pushed value could be inferred from the base
1325 type definition, it is encoded explicitly into the operation so that the
1326 operation can be parsed easily without reference to the \dotdebuginfo{}
1330 \itembfnl{\DWOPxderefTARG}
1331 The \DWOPxderefNAME{} operation provides an extended dereference
1332 mechanism. The entry at the top of the stack is treated as an
1333 address. The second stack entry is treated as an \doublequote{address
1334 space identifier} for those architectures that support
1335 \addtoindexi{multiple}{address space!multiple}
1337 Both of these entries must have integral type identifiers.
1338 The top two stack elements are popped,
1339 and a data item is retrieved through an implementation-defined
1340 address calculation and pushed as the new stack top together with the
1341 \specialaddresstype{} identifier.
1342 The size of the data retrieved from the
1343 \addtoindexi{dereferenced}{address!dereference operator}
1344 address is the size of the \specialaddresstype.
1346 \itembfnl{\DWOPxderefsizeTARG}
1347 The \DWOPxderefsizeNAME{} operation behaves like the
1348 \DWOPxderef{} operation. The entry at the top of the stack is
1349 treated as an address. The second stack entry is treated as
1350 an \doublequote{address space identifier} for those architectures
1352 \addtoindexi{multiple}{address space!multiple}
1354 Both of these entries must have integral type identifiers.
1356 elements are popped, and a data item is retrieved through an
1357 implementation\dash defined address calculation and pushed as the
1358 new stack top. In the \DWOPxderefsizeNAME{} operation, however,
1359 the size in bytes of the data retrieved from the
1360 \addtoindexi{dereferenced}{address!dereference operator}
1361 address is specified by the single operand. This operand is a
1362 1-byte unsigned integral constant whose value may not be larger
1363 than the \addtoindex{size of an address} on the target machine. The data
1364 retrieved is zero extended to the \addtoindex{size of an address} on the
1365 target machine before being pushed onto the expression stack together
1366 with the \specialaddresstype{} identifier.
1368 \itembfnl{\DWOPxdereftypeTARG}
1369 The \DWOPxdereftypeNAME{} operation behaves like the \DWOPxderefsize{}
1370 operation: it pops the top two stack entries, treats them as an address and
1371 an address space identifier, and pushes the value retrieved. In the
1372 \DWOPxdereftypeNAME{} operation, the size in bytes of the data retrieved from
1373 the dereferenced address is specified by the first operand. This operand is
1374 a 1-byte unsigned integral constant whose value
1375 value which is the same as the size of the base type referenced
1376 by the second operand. The second
1377 operand is an unsigned LEB128 integer that represents the offset of a
1378 debugging information entry in the current compilation unit, which must be a
1379 \DWTAGbasetype{} entry that provides the type of the data pushed.
1382 \itembfnl{\DWOPpushobjectaddressTARG}
1383 The \DWOPpushobjectaddressNAME{}
1384 operation pushes the address
1385 of the object currently being evaluated as part of evaluation
1386 of a user presented expression. This object may correspond
1387 to an independent variable described by its own debugging
1388 information entry or it may be a component of an array,
1389 structure, or class whose address has been dynamically
1390 determined by an earlier step during user expression
1393 \textit{This operator provides explicit functionality
1394 (especially for arrays involving descriptors) that is analogous
1395 to the implicit push of the base
1396 \addtoindexi{address}{address!implicit push of base}
1397 of a structure prior to evaluation of a
1398 \DWATdatamemberlocation{}
1399 to access a data member of a structure. For an example, see
1400 Appendix \refersec{app:aggregateexamples}.}
1403 \itembfnl{\DWOPformtlsaddressTARG}
1404 The \DWOPformtlsaddressNAME{}
1405 operation pops a value from the stack, which must have an
1406 integral type identifier, translates this
1407 value into an address in the
1408 \addtoindex{thread-local storage}
1409 for a thread, and pushes the address
1410 onto the stack together with the \specialaddresstype{} identifier.
1411 The meaning of the value on the top of the stack prior to this
1412 operation is defined by the run-time environment. If the run-time
1413 environment supports multiple thread-local storage
1414 \nolink{blocks} for a single thread, then the \nolink{block}
1415 corresponding to the executable or shared
1416 library containing this DWARF expression is used.
1418 \textit{Some implementations of
1419 \addtoindex{C}, \addtoindex{C++}, \addtoindex{Fortran}, and other
1420 languages, support a
1421 thread-local storage class. Variables with this storage class
1422 have distinct values and addresses in distinct threads, much
1423 as automatic variables have distinct values and addresses in
1424 each function invocation. Typically, there is a single \nolink{block}
1425 of storage containing all thread\dash local variables declared in
1426 the main executable, and a separate \nolink{block} for the variables
1427 declared in each shared library. Each
1428 thread\dash local variable can then be accessed in its block using an
1429 identifier. This identifier is typically an offset into the block and
1430 pushed onto the DWARF stack by one of the
1431 \DWOPconstnx{} operations prior to the
1432 \DWOPformtlsaddress{} operation.
1433 Computing the address of
1434 the appropriate \nolink{block} can be complex (in some cases, the
1435 compiler emits a function call to do it), and difficult
1436 to describe using ordinary DWARF location descriptions.
1437 Instead of forcing complex thread-local storage calculations into
1438 the DWARF expressions, the \DWOPformtlsaddress{} allows the consumer
1439 to perform the computation based on the run-time environment.}
1442 \itembfnl{\DWOPcallframecfaTARG}
1443 The \DWOPcallframecfaNAME{}
1444 operation pushes the value of the
1445 CFA, obtained from the Call Frame Information
1446 (see Section \refersec{chap:callframeinformation}).
1448 \textit{Although the value of \DWATframebase{}
1449 can be computed using other DWARF expression operators,
1450 in some cases this would require an extensive location list
1451 because the values of the registers used in computing the
1452 CFA change during a subroutine. If the
1453 Call Frame Information
1454 is present, then it already encodes such changes, and it is
1455 space efficient to reference that.}
1458 \textit{Examples illustrating many of these stack operations are
1459 found in Appendix \refersec{app:dwarfstackoperationexamples}.}
1461 \subsubsection{Arithmetic and Logical Operations}
1462 \addtoindexx{DWARF expression!arithmetic operations}
1463 \addtoindexx{DWARF expression!logical operations}
1464 The following provide arithmetic and logical operations. If an operation
1465 pops two values from the stack, both values must have the same type,
1466 either the same base type or both the \specialaddresstype.
1467 The result of the operation which is pushed back has the same type
1468 as the type of the operands.
1470 If the type of the operands is the \specialaddresstype,
1471 except as otherwise specified, the arithmetic operations
1472 perform addressing arithmetic, that is, unsigned arithmetic that is performed
1473 modulo one plus the largest representable address (for example, 0x100000000
1474 when the \addtoindex{size of an address} is 32 bits).
1476 Operations other than \DWOPabs{},
1477 \DWOPdiv{}, \DWOPminus{}, \DWOPmul{}, \DWOPneg{} and \DWOPplus{}
1478 require integral types of the operand (either integral base type
1479 or the \specialaddresstype). Operations do not cause an exception
1483 \begin{enumerate}[1. ]
1484 \itembfnl{\DWOPabsTARG}
1485 The \DWOPabsNAME{} operation pops the top stack entry, interprets
1486 it as a signed value and pushes its absolute value. If the
1487 absolute value cannot be represented, the result is undefined.
1490 \itembfnl{\DWOPandTARG}
1491 The \DWOPandNAME{} operation pops the top two stack values, performs
1492 a bitwise and operation on the two, and pushes the result.
1494 \itembfnl{\DWOPdivTARG}
1495 The \DWOPdivNAME{} operation pops the top two stack values, divides the former second entry by
1496 the former top of the stack using signed division, and pushes the result.
1498 \itembfnl{\DWOPminusTARG}
1499 The \DWOPminusNAME{} operation pops the top two stack values, subtracts the former top of the
1500 stack from the former second entry, and pushes the result.
1502 \itembfnl{\DWOPmodTARG}
1503 The \DWOPmodNAME{} operation pops the top two stack values and pushes the result of the
1504 calculation: former second stack entry modulo the former top of the stack.
1507 \itembfnl{\DWOPmulTARG}
1508 The \DWOPmulNAME{} operation pops the top two stack entries, multiplies them together, and
1511 \itembfnl{\DWOPnegTARG}
1512 The \DWOPnegNAME{} operation pops the top stack entry, interprets
1513 it as a signed value and pushes its negation. If the negation
1514 cannot be represented, the result is undefined.
1516 \itembfnl{\DWOPnotTARG}
1517 The \DWOPnotNAME{} operation pops the top stack entry, and pushes
1518 its bitwise complement.
1520 \itembfnl{\DWOPorTARG}
1521 The \DWOPorNAME{} operation pops the top two stack entries, performs
1522 a bitwise or operation on the two, and pushes the result.
1524 \itembfnl{\DWOPplusTARG}
1525 The \DWOPplusNAME{} operation pops the top two stack entries,
1526 adds them together, and pushes the result.
1529 \itembfnl{\DWOPplusuconstTARG}
1530 The \DWOPplusuconstNAME{} operation pops the top stack entry,
1531 adds it to the unsigned LEB128\addtoindexx{LEB128!unsigned}
1532 constant operand and pushes the result.
1534 \textit{This operation is supplied specifically to be
1535 able to encode more field offsets in two bytes than can be
1537 \doublequote{\DWOPlitn~\DWOPplus.}}
1540 \itembfnl{\DWOPshlTARG}
1541 The \DWOPshlNAME{} operation pops the top two stack entries,
1542 shifts the former second entry left (filling with zero bits)
1543 by the number of bits specified by the former top of the stack,
1544 and pushes the result.
1546 \itembfnl{\DWOPshrTARG}
1547 The \DWOPshrNAME{} operation pops the top two stack entries,
1548 shifts the former second entry right logically (filling with
1549 zero bits) by the number of bits specified by the former top
1550 of the stack, and pushes the result.
1553 \itembfnl{\DWOPshraTARG}
1554 The \DWOPshraNAME{} operation pops the top two stack entries,
1555 shifts the former second entry right arithmetically (divide
1556 the magnitude by 2, keep the same sign for the result) by
1557 the number of bits specified by the former top of the stack,
1558 and pushes the result.
1560 \itembfnl{\DWOPxorTARG}
1561 The \DWOPxorNAME{} operation pops the top two stack entries,
1562 performs a bitwise exclusive\dash or operation on the two, and
1567 \subsubsection{Control Flow Operations}
1568 \label{chap:controlflowoperations}
1570 \addtoindexx{DWARF expression!control flow operations}
1571 following operations provide simple control of the flow of a DWARF expression.
1572 \begin{enumerate}[1. ]
1573 \itembfnl{\DWOPleTARG, \DWOPgeTARG, \DWOPeqTARG, \DWOPltTARG, \DWOPgtTARG, \DWOPneTARG}
1574 The six relational operators each:
1576 \item pop the top two stack values, which should both have the same type,
1577 either the same base type or both the \specialaddresstype,
1579 \item compare the operands:
1581 \textless~former second entry~\textgreater \textless~relational operator~\textgreater \textless~former top entry~\textgreater
1583 \item push the constant value 1 onto the stack
1584 if the result of the operation is true or the
1585 constant value 0 if the result of the operation is false.
1586 The pushed value has the \specialaddresstype.
1589 If the operands have the \specialaddresstype, the comparisons
1590 are performed as signed operations.
1591 The six operators are \DWOPleNAME{} (less than or equal to), \DWOPgeNAME{}
1592 (greater than or equal to), \DWOPeqNAME{} (equal to), \DWOPltNAME{} (less
1593 than), \DWOPgtNAME{} (greater than) and \DWOPneNAME{} (not equal to).
1596 \itembfnl{\DWOPskipTARG}
1597 \DWOPskipNAME{} is an unconditional branch. Its single operand
1598 is a 2-byte signed integer constant. The 2-byte constant is
1599 the number of bytes of the DWARF expression to skip forward
1600 or backward from the current operation, beginning after the
1603 \itembfnl{\DWOPbraTARG}
1604 \DWOPbraNAME{} is a conditional branch. Its single operand is a
1605 2-byte signed integer constant. This operation pops the
1606 top of stack. If the value popped is not the constant 0,
1607 the 2-byte constant operand is the number of bytes of the
1608 DWARF expression to skip forward or backward from the current
1609 operation, beginning after the 2-byte constant.
1611 % The following item does not correctly hyphenate leading
1612 % to an overfull hbox and a visible artifact.
1613 % So we use \- to suggest hyphenation in this rare situation.
1614 \itembfnl{\DWOPcalltwoTARG, \DWOPcallfourTARG, \DWOPcallrefTARG}
1617 and \DWOPcallrefNAME{} perform
1618 DWARF procedure calls during evaluation of a DWARF expression or
1619 location description.
1620 For \DWOPcalltwoNAME{} and \DWOPcallfourNAME{},
1621 the operand is the 2\dash~ or 4-byte unsigned offset, respectively,
1622 of a debugging information entry in the current compilation
1623 unit. The \DWOPcallrefNAME{} operator has a single operand. In the
1624 \thirtytwobitdwarfformat,
1625 the operand is a 4-byte unsigned value;
1626 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1627 (see Section \referfol{datarep:32bitand64bitdwarfformats}).
1628 The operand is used as the offset of a
1629 debugging information entry in a
1631 section which may be contained in an executable or shared object file
1632 other than that containing the operator. For references from
1633 one executable or shared object file to another, the relocation
1634 must be performed by the consumer.
1636 \textit{Operand interpretation of
1637 \DWOPcalltwo, \DWOPcallfour{} and \DWOPcallref{} is exactly like
1638 that for \DWFORMreftwo, \DWFORMreffour{} and \DWFORMrefaddr,
1640 (see Section \refersec{datarep:attributeencodings}).
1643 These operations transfer
1644 control of DWARF expression evaluation to
1645 \addtoindexx{location attribute}
1648 attribute of the referenced debugging information entry. If
1649 there is no such attribute, then there is no effect. Execution
1650 of the DWARF expression of
1651 \addtoindexx{location attribute}
1653 \DWATlocation{} attribute may add
1654 to and/or remove from values on the stack. Execution returns
1655 to the point following the call when the end of the attribute
1656 is reached. Values on the stack at the time of the call may be
1657 used as parameters by the called expression and values left on
1658 the stack by the called expression may be used as return values
1659 by prior agreement between the calling and called expressions.
1662 \subsubsection{Type Conversions}
1663 \label{chap:typeconversions}
1664 The following operations provides for explicit type conversion.
1666 \begin{enumerate}[1. ]
1667 \itembfnl{\DWOPconvertTARG}
1668 The \DWOPconvertNAME{} operation pops the top stack entry, converts it to a
1669 different type, then pushes the result. It takes one operand, which is an
1670 unsigned LEB128 integer that represents the offset of a debugging
1671 information entry in the current compilation unit, or value 0 which
1672 represents the \specialaddresstype. If the operand is non-zero, the
1673 referenced entry must be a \DWTAGbasetype{} entry that provides the type
1674 to which the value is converted.
1676 \itembfnl{\DWOPreinterpretTARG}
1677 The \DWOPreinterpretNAME{} operation pops the top stack entry, reinterprets
1678 the bits in its value as a value of a different type, then pushes the
1679 result. It takes one operand, which is an unsigned LEB128 integer that
1680 represents the offset of a debugging information entry in the current
1681 compilation unit, or value 0 which represents the \specialaddresstype.
1682 If the operand is non-zero, the referenced entry must be a
1683 \DWTAGbasetype{} entry that provides the type to which the value is converted.
1684 The type of the operand and result type should have the same size in bits.
1689 \subsubsection{Special Operations}
1690 \label{chap:specialoperations}
1692 \addtoindexx{DWARF expression!special operations}
1693 are these special operations currently defined:
1694 \begin{enumerate}[1. ]
1695 \itembfnl{\DWOPnopNAME}
1696 The \DWOPnopTARG{} operation is a place holder. It has no effect
1697 on the location stack or any of its values.
1699 \itembfnl{\DWOPentryvalueNAME}
1700 The \DWOPentryvalueTARG{} operation pushes a value that had a known location
1701 upon entering the current subprogram. It has two operands: an
1702 unsigned LEB128\addtoindexx{LEB128!unsigned} length, followed by
1703 a block containing a DWARF expression or a register location description
1704 (see Section \refersec{chap:registerlocationdescriptions}).
1705 The length operand specifies the length
1706 in bytes of the block. If the block contains a register location
1707 description, \DWOPentryvalueNAME{} pushes the value that register had upon
1708 entering the current subprogram. If the block contains a DWARF expression,
1709 the DWARF expression is evaluated as if it has been evaluated upon entering
1710 the current subprogram. The DWARF expression should not assume any values
1711 being present on the DWARF stack initially and should result in exactly one
1712 value being pushed on the DWARF stack when completed. That value is the value
1713 being pushed by the \DWOPentryvalueNAME{} operation.
1715 \DWOPpushobjectaddress{} is not meaningful inside of this DWARF operation.
1717 \textit{The \DWOPentryvalueNAME{} operation can be used by consumers if they are able
1718 to find the call site in the caller function, can unwind to it, and the corresponding
1719 \DWTAGcallsiteparameter{} entry has \DWATcallvalue{} or
1720 \DWATcalldatavalue{} attributes that can be evaluated to find the
1721 value a function parameter had on the first instruction in the function.
1722 Non-interactive consumers which know what variables will need to be
1723 inspected in advance of running the debugged program could put breakpoints
1724 on the first instruction in functions where there is no way to find
1725 some variable's value other than by evaluating the \DWOPentryvalueNAME{}
1726 operation. The consumer can collect the value of registers or
1727 memory referenced in
1728 \DWOPentryvalueNAME{} operations, then continue to breakpoints where the values
1729 of variables or parameters need to be inspected and use the remembered
1730 register or memory values during \DWOPentryvalueNAME{} evaluation.}
1735 \section{Location Descriptions}
1736 \label{chap:locationdescriptions}
1737 \textit{Debugging information
1738 \addtoindexx{location description}
1740 \addtoindexx{location description|see{\textit{also} DWARF expression}}
1741 provide consumers a way to find
1742 the location of program variables, determine the bounds
1743 of dynamic arrays and strings, and possibly to find the
1744 base address of a subroutine\textquoteright s stack frame or the return
1745 address of a subroutine. Furthermore, to meet the needs of
1746 recent computer architectures and optimization techniques,
1747 debugging information must be able to describe the location of
1748 an object whose location changes over the object\textquoteright s lifetime.}
1750 Information about the location of program objects is provided
1751 by location descriptions. Location descriptions can be either
1753 \begin{enumerate}[1. ]
1754 \item \textit{Single location descriptions},
1756 \addtoindexx{location description!single}
1758 \addtoindexx{single location description}
1759 a language independent representation of
1760 addressing rules of arbitrary complexity built from
1761 DWARF expressions (See Section \refersec{chap:dwarfexpressions})
1763 DWARF operations specific to describing locations. They are
1764 sufficient for describing the location of any object as long
1765 as its lifetime is either static or the same as the
1766 \livelink{chap:lexicalblock}{lexical block} that owns it,
1767 and it does not move during its lifetime.
1769 Single location descriptions are of two kinds:
1770 \begin{enumerate}[a) ]
1771 \item Simple location descriptions, which describe the location
1772 \addtoindexx{location description!simple}
1773 of one contiguous piece (usually all) of an object. A simple
1774 location description may describe a location in addressable
1775 memory, or in a register, or the lack of a location (with or
1776 without a known value).
1778 \item Composite location descriptions, which describe an
1779 \addtoindexx{location description!composite}
1780 object in terms of pieces each of which may be contained in
1781 part of a register or stored in a memory location unrelated
1787 \item \textit{Location lists}, which are used to
1788 \addtoindexx{location list}
1790 \addtoindexx{location description!use in location list}
1791 objects that have a limited lifetime or change their location
1792 during their lifetime. Location lists are described in
1793 Section \refersec{chap:locationlists} below.
1797 Location descriptions are distinguished in a context sensitive
1798 manner. As the value of an attribute, a location description
1800 \addtoindexx{exprloc class}
1801 class \livelink{chap:classexprloc}{exprloc}
1802 and a location list is encoded
1803 using class \livelink{chap:classloclistptr}{loclistptr}
1805 \addtoindex{loclistptr}
1806 serves as an offset into a
1808 \addtoindexx{location list}
1809 location list table).
1812 \subsection{Single Location Descriptions}
1813 A single location description is either:
1814 \begin{enumerate}[1. ]
1815 \item A simple location description, representing an object
1816 \addtoindexx{location description!simple}
1818 \addtoindexx{simple location description}
1819 exists in one contiguous piece at the given location, or
1820 \item A composite location description consisting of one or more
1821 \addtoindexx{location description!composite}
1822 simple location descriptions, each of which is followed by
1823 one composition operation. Each simple location description
1824 describes the location of one piece of the object; each
1825 composition operation describes which part of the object is
1826 located there. Each simple location description that is a
1827 DWARF expression is evaluated independently of any others
1828 (as though on its own separate stack, if any).
1833 \subsubsection{Simple Location Descriptions}
1835 \addtoindexx{location description!simple}
1836 simple location description consists of one
1837 contiguous piece or all of an object or value.
1840 \subsubsubsection{Memory Location Descriptions}
1842 \addtoindexx{location description!memory}
1843 memory location description
1844 \addtoindexx{memory location description}
1845 consists of a non\dash empty DWARF
1847 Section \refersec{chap:dwarfexpressions}
1848 ), whose value is the address of
1849 a piece or all of an object or other entity in memory.
1851 \subsubsubsection{Register Location Descriptions}
1852 \label{chap:registerlocationdescriptions}
1853 A register location description consists of a register name
1854 operation, which represents a piece or all of an object
1855 located in a given register.
1857 \textit{Register location descriptions describe an object
1858 (or a piece of an object) that resides in a register, while
1859 the opcodes listed in
1860 Section \refersec{chap:registervalues}
1861 are used to describe an object (or a piece of
1862 an object) that is located in memory at an address that is
1863 contained in a register (possibly offset by some constant). A
1864 register location description must stand alone as the entire
1865 description of an object or a piece of an object.
1868 The following DWARF operations can be used to name a register.
1871 \textit{Note that the register number represents a DWARF specific
1872 mapping of numbers onto the actual registers of a given
1873 architecture. The mapping should be chosen to gain optimal
1874 density and should be shared by all users of a given
1875 architecture. It is recommended that this mapping be defined
1876 by the ABI authoring committee for each architecture.
1878 \begin{enumerate}[1. ]
1879 \itembfnl{\DWOPregzeroTARG, \DWOPregoneTARG, ..., \DWOPregthirtyoneTARG}
1880 The \DWOPregnTARG{} operations encode the names of up to 32
1881 registers, numbered from 0 through 31, inclusive. The object
1882 addressed is in register \textit{n}.
1885 \itembfnl{\DWOPregxTARG}
1886 The \DWOPregxNAME{} operation has a single
1887 unsigned LEB128\addtoindexx{LEB128!unsigned} literal
1888 operand that encodes the name of a register.
1892 \textit{These operations name a register location. To
1893 fetch the contents of a register, it is necessary to use
1894 one of the register based addressing operations, such as
1896 (Section \refersec{chap:registervalues})}.
1898 \subsubsubsection{Implicit Location Descriptions}
1899 An \addtoindex{implicit location description}
1900 represents a piece or all
1901 \addtoindexx{location description!implicit}
1902 of an object which has no actual location but whose contents
1903 are nonetheless either known or known to be undefined.
1905 The following DWARF operations may be used to specify a value
1906 that has no location in the program but is a known constant
1907 or is computed from other locations and values in the program.
1908 \begin{enumerate}[1. ]
1909 \itembfnl{\DWOPimplicitvalueTARG}
1910 The \DWOPimplicitvalueNAME{}
1911 operation specifies an immediate value
1912 using two operands: an unsigned LEB128\addtoindexx{LEB128!unsigned}
1914 %FIXME: should this block be a reference? To what?
1915 a \nolink{block} representing the value in the memory representation
1916 of the target machine. The length operand gives the length
1917 in bytes of the \nolink{block}.
1919 \itembfnl{\DWOPstackvalueTARG}
1920 The \DWOPstackvalueNAME{}
1921 operation specifies that the object
1922 does not exist in memory but its value is nonetheless known
1923 and is at the top of the DWARF expression stack. In this form
1924 of location description, the DWARF expression represents the
1925 actual value of the object, rather than its location. The
1926 \DWOPstackvalueNAME{} operation terminates the expression.
1929 \itembfnl{\DWOPimplicitpointerTARG}
1930 The \DWOPimplicitpointerNAME{} operation specifies that the object
1931 is a pointer that cannot be represented as a real pointer,
1932 even though the value it would point to can be described. In
1933 this form of location description, the DWARF expression refers
1934 to a debugging information entry that represents the actual
1935 value of the object to which the pointer would point. Thus, a
1936 consumer of the debug information would be able to show the
1937 value of the dereferenced pointer, even when it cannot show
1938 the value of the pointer itself.
1941 The \DWOPimplicitpointerNAME{} operation has two operands: a
1942 reference to a debugging information entry that describes
1943 the dereferenced object's value, and a signed number that
1944 is treated as a byte offset from the start of that value.
1945 The first operand is a 4-byte unsigned value in the 32-bit
1946 DWARF format, or an 8-byte unsigned value in the 64-bit
1947 DWARF format (see Section
1948 \refersec{datarep:32bitand64bitdwarfformats}).
1949 The second operand is a
1950 signed LEB128\addtoindexx{LEB128!signed} number.
1952 The first operand is used as the offset of a debugging
1953 information entry in a \dotdebuginfo{} section, which may be
1954 contained in an executable or shared object file other than that
1955 containing the operator. For references from one executable or
1956 shared object file to another, the relocation must be performed
1959 \textit{The debugging information entry referenced by a
1960 \DWOPimplicitpointerNAME{} operation is typically a
1961 \DWTAGvariable{} or \DWTAGformalparameter{} entry whose
1962 \DWATlocation{} attribute gives a second DWARF expression or a
1963 location list that describes the value of the object, but the
1964 referenced entry may be any entry that contains a \DWATlocation{}
1965 or \DWATconstvalue{} attribute (for example, \DWTAGdwarfprocedure).
1966 By using the second DWARF expression, a consumer can
1967 reconstruct the value of the object when asked to dereference
1968 the pointer described by the original DWARF expression
1969 containing the \DWOPimplicitpointer{} operation.}
1973 \textit{DWARF location expressions are intended to yield the \textbf{location}
1974 of a value rather than the value itself. An optimizing compiler
1975 may perform a number of code transformations where it becomes
1976 impossible to give a location for a value, but it remains possible
1977 to describe the value itself.
1978 Section \refersec{chap:registerlocationdescriptions}
1979 describes operators that can be used to
1980 describe the location of a value when that value exists in a
1981 register but not in memory. The operations in this section are
1982 used to describe values that exist neither in memory nor in a
1985 \subsubsubsection{Empty Location Descriptions}
1986 An \addtoindex{empty location description}
1987 consists of a DWARF expression
1988 \addtoindexx{location description!empty}
1989 containing no operations. It represents a piece or all of an
1990 object that is present in the source but not in the object code
1991 (perhaps due to optimization).
1994 \subsubsection{Composite Location Descriptions}
1995 A composite location description describes an object or
1996 value which may be contained in part of a register or stored
1997 in more than one location. Each piece is described by a
1998 composition operation, which does not compute a value nor
1999 store any result on the DWARF stack. There may be one or
2000 more composition operations in a single composite location
2001 description. A series of such operations describes the parts
2002 of a value in memory address order.
2004 Each composition operation is immediately preceded by a simple
2005 location description which describes the location where part
2006 of the resultant value is contained.
2007 \begin{enumerate}[1. ]
2008 \itembfnl{\DWOPpieceTARG}
2009 The \DWOPpieceNAME{} operation takes a
2010 single operand, which is an
2011 unsigned LEB128\addtoindexx{LEB128!unsigned} number.
2012 The number describes the size in bytes
2013 of the piece of the object referenced by the preceding simple
2014 location description. If the piece is located in a register,
2015 but does not occupy the entire register, the placement of
2016 the piece within that register is defined by the ABI.
2018 \textit{Many compilers store a single variable in sets of registers,
2019 or store a variable partially in memory and partially in
2020 registers. \DWOPpieceNAME{} provides a way of describing how large
2021 a part of a variable a particular DWARF location description
2024 \itembfnl{\DWOPbitpieceTARG}
2025 The \DWOPbitpieceNAME{}
2026 operation takes two operands. The first
2027 is an unsigned LEB128\addtoindexx{LEB128!unsigned}
2028 number that gives the size in bits
2029 of the piece. The second is an
2030 unsigned LEB128\addtoindexx{LEB128!unsigned} number that
2031 gives the offset in bits from the location defined by the
2032 preceding DWARF location description.
2034 Interpretation of the
2035 offset depends on the kind of location description. If the
2036 location description is empty, the offset doesn\textquoteright t matter and
2037 the \DWOPbitpieceNAME{} operation describes a piece consisting
2038 of the given number of bits whose values are undefined. If
2039 the location is a register, the offset is from the least
2040 significant bit end of the register. If the location is a
2041 memory address, the \DWOPbitpieceNAME{} operation describes a
2042 sequence of bits relative to the location whose address is
2043 on the top of the DWARF stack using the bit numbering and
2044 direction conventions that are appropriate to the current
2045 language on the target system. If the location is any implicit
2046 value or stack value, the \DWOPbitpieceNAME{} operation describes
2047 a sequence of bits using the least significant bits of that
2051 \textit{\DWOPbitpieceNAME{} is
2052 used instead of \DWOPpieceNAME{} when
2053 the piece to be assembled into a value or assigned to is not
2054 byte-sized or is not at the start of a register or addressable
2058 \subsection{Location Lists}
2059 \label{chap:locationlists}
2060 There are two forms of location lists. The first form
2061 is intended for use in other than a \splitDWARFobjectfile,
2062 while the second is intended for use in a \splitDWARFobjectfile{}
2063 (see Section \refersec{datarep:splitdwarfobjectfiles}). The two
2064 forms are otherwise equivalent.
2066 \textit{The form for \splitDWARFobjectfile{s} is new in \DWARFVersionV.}
2068 \subsubsection{Location Lists in Non-split Objects}
2069 \label{chap:locationlistsinnonsplitobjects}
2071 \addtoindexx{location list}
2072 are used in place of location expressions
2073 whenever the object whose location is being described
2074 can change location during its lifetime.
2076 \addtoindexx{location list}
2077 are contained in a separate object file section called
2078 \dotdebugloc{}. A location list is indicated by a location
2079 attribute whose value is an offset from the beginning of
2080 the \dotdebugloc{} section to the first byte of the list for the
2083 The \addtoindex{applicable base address} of a normal
2084 location list entry (see following) is
2085 \addtoindexx{location list!base address selection entry}
2086 determined by the closest preceding base address selection
2087 entry in the same location list. If there is
2088 no such selection entry, then the applicable base address
2089 defaults to the base address of the compilation unit (see
2090 Section \refersec{chap:normalandpartialcompilationunitentries}).
2092 \textit{In the case of a compilation unit where all of
2093 the machine code is contained in a single contiguous section,
2094 no base address selection entry is needed.}
2096 Each entry in a location list is either a location
2097 \addtoindexi{list}{address selection|see{base address selection}}
2100 \addtoindexi{base}{base address selection entry!in location list}
2101 address selection entry,
2102 \addtoindexx{location list!base address selection entry}
2104 \addtoindexx{end-of-list entry!in location list}
2107 \subsubsubsection{Location List Entry}
2108 A location list entry has two forms:
2109 a normal location list entry and a default location list entry.
2112 \subsubsubsubsection{Normal Location List Entry}
2113 A\addtoindexx{location list!normal entry}
2114 \addtoindex{normal location list entry} consists of:
2115 \begin{enumerate}[1. ]
2116 \item A beginning address offset.
2117 This address offset has the \addtoindex{size of an address} and is
2118 relative to the applicable base address of the compilation
2119 unit referencing this location list. It marks the beginning
2121 \addtoindexi{range}{address range!in location list}
2122 over which the location is valid.
2124 \item An ending address offset. This address offset again
2125 has the \addtoindex{size of an address} and is relative to the applicable
2126 base address of the compilation unit referencing this location
2127 list. It marks the first address past the end of the address
2128 range over which the location is valid. The ending address
2129 must be greater than or equal to the beginning address.
2131 \textit{A location list entry (but not a base address selection or
2132 end-of-list entry) whose beginning
2133 and ending addresses are equal has no effect
2134 because the size of the range covered by such
2137 \item An unsigned 2-byte length describing the length of the location
2138 description that follows.
2140 \item A \addtoindex{single location description}
2141 describing the location of the object over the range specified by
2142 the beginning and end addresses.
2145 Address ranges defined by normal location list entries
2146 may overlap. When they do, they describe a
2147 situation in which an object exists simultaneously in more than
2148 one place. If all of the address ranges in a given location
2149 list do not collectively cover the entire range over which the
2150 object in question is defined, it is assumed that the object is
2151 not available for the portion of the range that is not covered.
2154 \subsubsubsubsection{Default Location List Entry}
2155 A \addtoindex{default location list entry} consists of:
2156 \addtoindexx{location list!default entry}
2157 \begin{enumerate}[1. ]
2159 \item The value of the largest representable address offset (for
2160 example, \wffffffff when the size of an address is 32 bits).
2161 \item A simple location description describing the location of the
2162 object when there is no prior normal location list entry
2163 that applies in the same location list.
2166 A default location list entry is independent of any applicable
2167 base address (except to the extent to which base addresses
2168 affect prior normal location list entries).
2170 A default location list entry must be the last location list
2171 entry of a location list except for the terminating end-of-list
2174 A \addtoindex{default location list entry} describes a simple
2175 location which applies to all addresses which are not included
2176 in any range defined earlier in the same location list.
2179 \subsubsubsection{Base Address Selection Entry}
2181 \addtoindexi{address}{address selection|see{base address selection}}
2182 \addtoindexx{location list!base address selection entry}
2184 \addtoindexi{entry}{base address selection entry!in location list}
2186 \begin{enumerate}[1. ]
2187 \item The value of the largest representable
2188 address offset (for example, \wffffffff when the size of
2189 an address is 32 bits).
2190 \item An address, which defines the
2191 appropriate base address for use in interpreting the beginning
2192 and ending address offsets of subsequent entries of the location list.
2195 \textit{A base address selection entry
2196 affects only the remainder of the list in which it is contained.}
2199 \subsubsubsection{End-of-List Entry}
2200 The end of any given location list is marked by an
2201 \addtoindexx{location list!end-of-list entry}
2202 end-of-list entry, which consists of a 0 for the beginning address
2203 offset and a 0 for the ending address offset. A location list
2205 \addtoindexx{end-of-list entry!in location list}
2206 end-of-list entry describes an object that
2207 exists in the source code but not in the executable program.
2209 Neither a base address selection entry nor an end-of-list
2210 entry includes a location description.
2213 \textit{When a DWARF consumer is parsing and decoding a location
2214 list, it must recognize the beginning and ending address
2215 offsets of (0, 0) for an end-of-list entry and
2216 \mbox{(0, \texttt{maximum-address})} for
2217 a default location list entry prior to applying any base
2218 address. Any other pair of offsets beginning with 0 is a
2219 valid normal location list entry. Next, it must recognize the
2220 beginning address offset of \texttt{maximum-address} for a base address selection
2221 entry prior to applying any base address. The current base
2222 address is not applied to the subsequent value (although there
2223 may be an underlying object language relocation that affects
2226 \textit{A base address selection entry and an end-of-list
2227 entry for a location list are identical to a base address
2228 selection entry and end-of-list entry, respectively, for a
2229 \addtoindex{range list}
2230 (see Section \refersec{chap:noncontiguousaddressranges})
2231 in interpretation and representation.}
2234 \subsubsection{Location Lists in Split Object Files}
2235 \label{chap:locationlistsinsplitobjectfiles}
2236 In a \splitDWARFobjectfile{} (see
2237 Section \refersec{datarep:splitdwarfobjectfiles}),
2238 location lists are contained in the \dotdebuglocdwo{} section.
2240 The \addtoindex{applicable base address} of a split
2241 location list entry (see following) is
2242 \addtoindexx{location list!base address selection entry}
2243 determined by the closest preceding base address selection
2244 entry (\DWLLEbaseaddressselectionentry) in the same location list. If there is
2245 no such selection entry, then the applicable base address
2246 defaults to the base address of the compilation unit (see
2247 Section \refersec{chap:normalandpartialcompilationunitentries}).
2249 Each entry in the split location list
2250 begins with a type code, which is a single unsigned byte that
2251 identifies the type of entry. There are five types of entries:
2253 \itembfnl{\DWLLEendoflistentryTARG}
2254 This entry indicates the end of a location list, and
2255 contains no further data.
2258 \itembfnl{\DWLLEbaseaddressselectionentryTARG}
2259 This entry contains an
2260 unsigned LEB128\addtoindexx{LEB128!unsigned} value immediately
2261 following the type code. This value is the index of an
2262 address in the \dotdebugaddr{} section, which is then used as
2263 the base address when interpreting offsets in subsequent
2264 location list entries of type \DWLLEoffsetpairentry.
2265 This index is relative to the value of the
2266 \DWATaddrbase{} attribute of the associated compilation unit.
2268 \itembfnl{\DWLLEstartendentryTARG}
2269 This entry contains two unsigned LEB128\addtoindexx{LEB128!unsigned}
2270 values immediately following the type code. These values are the
2271 indices of two addresses in the \dotdebugaddr{} section.
2272 These indices are relative to the value of the
2273 \DWATaddrbase{} attribute of the associated compilation unit
2274 (see Section \refersec{chap:unitentries}).
2275 These indicate the starting and ending addresses,
2276 respectively, that define the address range for which
2277 this location is valid. The starting and ending addresses
2278 given by this type of entry are not relative to the
2279 compilation unit base address. A single location
2280 description follows the fields that define the address range.
2282 \itembfnl{\DWLLEstartlengthentryTARG}
2283 This entry contains one unsigned LEB128\addtoindexx{LEB128!unsigned}
2285 unsigned value immediately following the type code. The
2286 first value is the index of an address in the \dotdebugaddr{}
2287 section, which marks the beginning of the address range
2288 over which the location is valid.
2289 This index is relative to the value of the
2290 \DWATaddrbase{} attribute of the associated compilation unit.
2291 The starting address given by this
2292 type of entry is not relative to the compilation unit
2293 base address. The second value is the
2294 length of the range. A single location
2295 description follows the fields that define the address range.
2297 \itembfnl{\DWLLEoffsetpairentryTARG}
2298 This entry contains two 4-byte unsigned values
2299 immediately following the type code. These values are the
2300 starting and ending offsets, respectively, relative to
2301 the applicable base address, that define the address
2302 range for which this location is valid. A single location
2303 description follows the fields that define the address range.
2306 \textit{The \DWLLEbaseaddressselectionentry, \DWLLEstartendentry{}
2307 and \DWLLEstartlengthentry entries obtain addresses within the
2308 target program indirectly using an index (not an offset) into an
2309 array of addresses. The base of that array is obtained using the
2310 \DWATaddrbase{} attribute of the containing compilation unit.
2311 The value of that attribute is the offset of the base of the array
2312 in the \dotdebugaddr{} section of the unit.}
2315 \section{Types of Program Entities}
2316 \label{chap:typesofprogramentities}
2317 \hypertarget{chap:DWATtypetypeofdeclaration}{}
2318 Any debugging information entry describing a declaration that
2320 \addtoindexx{type attribute}
2321 a \DWATtypeDEFN{} attribute, whose value is a
2322 reference to another debugging information entry. The entry
2323 referenced may describe a base type, that is, a type that is
2324 not defined in terms of other data types, or it may describe a
2325 user-defined type, such as an array, structure or enumeration.
2326 Alternatively, the entry referenced may describe a type
2327 modifier, such as constant, packed, pointer, reference or
2328 volatile, which in turn will reference another entry describing
2329 a type or type modifier (using
2330 \addtoindexx{type attribute}
2331 a \DWATtypeNAME{} attribute of its
2333 Section \referfol{chap:typeentries}
2334 for descriptions of the entries describing
2335 base types, user-defined types and type modifiers.
2339 \section{Accessibility of Declarations}
2340 \label{chap:accessibilityofdeclarations}
2341 \textit{Some languages, notably \addtoindex{C++} and
2342 \addtoindex{Ada}, have the concept of
2343 the accessibility of an object or of some other program
2344 entity. The accessibility specifies which classes of other
2345 program objects are permitted access to the object in question.}
2347 The accessibility of a declaration is
2348 \hypertarget{chap:DWATaccessibilitycandadadeclarations}{}
2350 \DWATaccessibilityDEFN{}
2352 \addtoindexx{accessibility attribute}
2353 value is a constant drawn from the set of codes listed in Table
2354 \refersec{tab:accessibilitycodes}.
2356 \begin{simplenametable}[1.9in]{Accessibility codes}{tab:accessibilitycodes}
2357 \DWACCESSpublicTARG{} \\
2358 \DWACCESSprivateTARG{} \\
2359 \DWACCESSprotectedTARG{} \\
2360 \end{simplenametable}
2363 \section{Visibility of Declarations}
2364 \label{chap:visibilityofdeclarations}
2366 \textit{Several languages (such as \addtoindex{Modula-2})
2367 have the concept of the visibility of a declaration. The
2368 visibility specifies which declarations are to be
2369 visible outside of the entity in which they are
2373 \hypertarget{chap:DWATvisibilityvisibilityofdeclaration}{}
2374 visibility of a declaration is represented
2375 by a \DWATvisibilityDEFN{}
2376 attribute\addtoindexx{visibility attribute}, whose value is a
2377 constant drawn from the set of codes listed in
2378 Table \refersec{tab:visibilitycodes}.
2380 \begin{simplenametable}[1.5in]{Visibility codes}{tab:visibilitycodes}
2381 \DWVISlocalTARG{} \\
2382 \DWVISexportedTARG{} \\
2383 \DWVISqualifiedTARG{} \\
2384 \end{simplenametable}
2387 \section{Virtuality of Declarations}
2388 \label{chap:virtualityofdeclarations}
2389 \textit{\addtoindex{C++} provides for virtual and pure virtual structure or class
2390 member functions and for virtual base classes.}
2393 \hypertarget{chap:DWATvirtualityvirtualityindication}{}
2394 virtuality of a declaration is represented by a
2395 \DWATvirtualityDEFN{}
2396 attribute\addtoindexx{virtuality attribute}, whose value is a constant drawn
2397 from the set of codes listed in
2398 Table \refersec{tab:virtualitycodes}.
2400 \begin{simplenametable}[2.5in]{Virtuality codes}{tab:virtualitycodes}
2401 \DWVIRTUALITYnoneTARG{} \\
2402 \DWVIRTUALITYvirtualTARG{} \\
2403 \DWVIRTUALITYpurevirtualTARG{} \\
2404 \end{simplenametable}
2407 \section{Artificial Entries}
2408 \label{chap:artificialentries}
2409 \textit{A compiler may wish to generate debugging information entries
2410 for objects or types that were not actually declared in the
2411 source of the application. An example is a formal parameter
2412 %FIXME: The word 'this' should be rendered like a variant italic,
2413 %FIXME: not as a quoted name. Changed to tt font--RB
2414 entry to represent the hidden
2415 \texttt{this} parameter\index{this parameter@\texttt{this} parameter}
2416 that most \addtoindex{C++} implementations pass as the first argument
2417 to non-static member functions.}
2419 Any debugging information entry representing the
2420 \addtoindexx{artificial attribute}
2421 declaration of an object or type artificially generated by
2422 a compiler and not explicitly declared by the source program
2423 \hypertarget{chap:DWATartificialobjectsortypesthat}{}
2425 \DWATartificialDEFN{} attribute,
2426 which is a \livelink{chap:classflag}{flag}.
2429 \section{Segmented Addresses}
2430 \label{chap:segmentedaddresses}
2431 \textit{In some systems, addresses are specified as offsets within a
2433 \addtoindexx{address space!segmented}
2435 \addtoindexx{segmented addressing|see{address space}}
2436 rather than as locations within a single flat
2437 \addtoindexx{address space!flat}
2440 Any debugging information entry that contains a description
2441 \hypertarget{chap:DWATsegmentaddressinginformation}{}
2442 of the location of an object or subroutine may have a
2443 \DWATsegmentDEFN{} attribute,
2444 \addtoindexx{segment attribute}
2445 whose value is a location
2446 description. The description evaluates to the segment selector
2447 of the item being described. If the entry containing the
2448 \DWATsegmentNAME{} attribute has a
2452 \DWATentrypc{} attribute,
2453 \addtoindexx{entry PC attribute}
2456 description that evaluates to an address, then those address
2457 values represent the offset portion of the address within
2458 the segment specified
2459 \addtoindexx{segment attribute}
2460 by \DWATsegmentNAME.
2463 \DWATsegmentNAME{} attribute, it inherits
2464 \addtoindexx{segment attribute}
2465 the segment value from its parent entry. If none of the
2466 entries in the chain of parents for this entry back to
2467 its containing compilation unit entry have
2468 \DWATsegmentNAME{} attributes,
2469 then the entry is assumed to exist within a flat
2471 Similarly, if the entry has a
2472 \DWATsegmentNAME{} attribute
2473 \addtoindexx{segment attribute}
2474 containing an empty location description, that
2475 entry is assumed to exist within a
2476 \addtoindexi{flat}{address space!flat}
2479 \textit{Some systems support different
2480 classes of addresses\addtoindexx{address class}.
2481 The address class may affect the way a pointer is dereferenced
2482 or the way a subroutine is called.}
2485 Any debugging information entry representing a pointer or
2486 reference type or a subroutine or subroutine type may
2489 attribute, whose value is an integer
2490 constant. The set of permissible values is specific to
2491 each target architecture. The value \DWADDRnoneTARG,
2493 is common to all encodings, and means that no address class
2497 \textit {For example, the Intel386 \texttrademark\ processor might use the following values:}
2500 \caption{Example address class codes}
2501 \label{tab:inteladdressclasstable}
2503 \begin{tabular}{l|c|l}
2505 Name&Value&Meaning \\
2507 \textit{DW\_ADDR\_none}& 0 & \textit{no class specified} \\
2508 \textit{DW\_ADDR\_near16}& 1 & \textit{16-bit offset, no segment} \\
2509 \textit{DW\_ADDR\_far16}& 2 & \textit{16-bit offset, 16-bit segment} \\
2510 \textit{DW\_ADDR\_huge16}& 3 & \textit{16-bit offset, 16-bit segment} \\
2511 \textit{DW\_ADDR\_near32}& 4 & \textit{32-bit offset, no segment} \\
2512 \textit{DW\_ADDR\_far32}& 5 & \textit{32-bit offset, 16-bit segment} \\
2518 \section{Non-Defining Declarations and Completions}
2519 \label{nondefiningdeclarationsandcompletions}
2520 A debugging information entry representing a program entity
2521 typically represents the defining declaration of that
2522 entity. In certain contexts, however, a debugger might need
2523 information about a declaration of an entity that is not
2524 \addtoindexx{incomplete declaration}
2525 also a definition, or is otherwise incomplete, to evaluate
2526 \hypertarget{chap:DWATdeclarationincompletenondefiningorseparateentitydeclaration}{}
2527 an expression correctly.
2530 \textit{As an example, consider the following fragment of \addtoindex{C} code:}
2544 \textit{\addtoindex{C} scoping rules require that the
2545 value of the variable \texttt{x} passed to the function
2546 \texttt{g} is the value of the global \texttt{float}
2547 variable \texttt{x} rather than of the local \texttt{int}
2548 variable \texttt{x}.}
2550 \subsection{Non-Defining Declarations}
2551 A debugging information entry that
2552 represents a non-defining
2553 \addtoindexx{non-defining declaration}
2555 \addtoindex{incomplete declaration}
2556 of a program entity has a
2557 \addtoindexx{declaration attribute}
2558 \DWATdeclarationDEFN{} attribute, which is a
2559 \livelink{chap:classflag}{flag}.
2561 \subsection{Declarations Completing Non-Defining Declarations}
2562 A debugging information entry that represents a
2563 declaration\hypertarget{chap:DWATspecificationincompletenondefiningorseparatedeclaration}{}
2564 that completes another (earlier) non-defining declaration may have a
2565 \DWATspecificationDEFN{}
2566 attribute whose value is a \livelink{chap:classreference}{reference} to
2567 the debugging information entry representing the non-defining declaration.
2568 A debugging information entry with a
2569 \DWATspecificationNAME{}
2570 attribute does not need to duplicate information provided by the
2571 debugging information entry referenced by that specification attribute.
2573 When the non-defining declaration is contained within a type that has
2574 been placed in a separate type unit (see Section \refersec{chap:typeunitentries}),
2575 the \DWATspecification{} attribute cannot refer directly to the entry in
2576 the type unit. Instead, the current compilation unit may contain a
2577 \doublequote{skeleton} declaration of the type, which contains only the relevant
2578 declaration and its ancestors as necessary to provide the context
2579 (including containing types and namespaces). The \DWATspecification{}
2580 attribute would then be a reference to the declaration entry within
2581 the skeleton declaration tree. The debugging information entry for the
2582 top-level type in the skeleton tree may contain a \DWATsignature{}
2583 attribute whose value is the type signature
2584 (see Section \refersec{datarep:typesignaturecomputation}).
2587 Not all attributes of the debugging information entry referenced by a
2588 \DWATspecification{} attribute
2589 apply to the referring debugging information entry.
2590 For\addtoindexx{declaration attribute}
2594 \addtoindexx{declaration attribute}
2596 \addtoindexx{declaration attribute}
2598 \addtoindexx{sibling attribute}
2602 \section{Declaration Coordinates}
2603 \label{chap:declarationcoordinates}
2604 \livetargi{chap:declarationcoordinates}{}{declaration coordinates}
2605 \textit{It is sometimes useful in a debugger to be able to associate
2606 a declaration with its occurrence in the program source.}
2608 Any debugging information
2609 \hypertarget{chap:DWATdeclfilefilecontainingsourcedeclaration}{}
2611 \hypertarget{chap:DWATdecllinelinenumberofsourcedeclaration}{}
2613 \hypertarget{chap:DWATdeclcolumncolumnpositionofsourcedeclaration}{}
2615 \addtoindexx{line number of declaration}
2616 declaration of an object, module, subprogram or
2617 \addtoindex{declaration column attribute}
2619 \addtoindex{declaration file attribute}
2621 \addtoindex{declaration line attribute}
2624 \DWATdecllineDEFN{} and
2625 \DWATdeclcolumnDEFN{}
2626 attributes each of whose value is an unsigned
2627 \livelink{chap:classconstant}{integer constant}.
2630 \addtoindexx{declaration file attribute}
2634 \addtoindexx{file containing declaration}
2636 a file number from the line number information table for the
2637 compilation unit containing the debugging information entry and
2638 represents the source file in which the declaration appeared
2639 (see Section \refersec{chap:linenumberinformation}).
2640 The value 0 indicates that no source file
2644 \addtoindexx{declaration line attribute}
2645 the \DWATdeclline{} attribute represents
2646 the source line number at which the first character of
2647 the identifier of the declared object appears. The value 0
2648 indicates that no source line has been specified.
2651 \addtoindexx{declaration column attribute}
2652 the \DWATdeclcolumn{} attribute represents
2653 the source column number at which the first character of
2654 the identifier of the declared object appears. The value 0
2655 indicates that no column has been specified.
2657 \section{Identifier Names}
2658 \label{chap:identifiernames}
2659 Any\hypertarget{chap:DWATnamenameofdeclaration}{}
2660 debugging information entry
2661 \addtoindexx{identifier names}
2663 \addtoindexx{names!identifier}
2664 a program entity that has been given a name may have a
2666 attribute\addtoindexx{name attribute}, whose value of
2667 \CLASSstring{} represents the name as it appears in
2668 the source program. A debugging information entry containing
2669 no name attribute, or containing a name attribute whose value
2670 consists of a name containing a single null byte, represents
2671 a program entity for which no name was given in the source.
2673 \textit{Because the names of program objects described by DWARF are
2674 the names as they appear in the source program, implementations
2675 of language translators that use some form of mangled name
2676 \addtoindexx{mangled names}
2677 (as do many implementations of \addtoindex{C++}) should use the
2678 unmangled form of the name in the
2679 \DWATname{} attribute,
2680 \addtoindexx{name attribute}
2681 including the keyword operator (in names such as \doublequote{operator +}),
2682 if present. See also
2683 Section \referfol{chap:linkagenames} regarding the use of
2684 \DWATlinkagename{} for
2685 \addtoindex{mangled names}.
2686 Sequences of multiple whitespace characters may be compressed.}
2688 \section{Data Locations and DWARF Procedures}
2689 Any debugging information entry describing a data object (which
2690 \hypertarget{chap:DWATlocationdataobjectlocation}{}
2691 includes variables and parameters) or
2692 \livelink{chap:commonblockentry}{common blocks}
2694 \addtoindexx{location attribute}
2696 \DWATlocationDEFN{} attribute,
2697 \addtoindexx{location attribute}
2698 whose value is a location description
2699 (see Section \refersec{chap:locationdescriptions}).
2703 \addtoindex{DWARF procedure}
2704 is represented by any
2705 kind of debugging information entry that has a
2706 \addtoindexx{location attribute}
2709 \addtoindexx{location attribute}
2710 If a suitable entry is not otherwise available,
2711 a DWARF procedure can be represented using a debugging
2712 \addtoindexx{DWARF procedure entry}
2713 information entry with the
2714 tag \DWTAGdwarfprocedureTARG{}
2716 \addtoindexx{location attribute}
2717 a \DWATlocationNAME{} attribute.
2720 is called by a \DWOPcalltwo,
2723 DWARF expression operator
2724 (see Section \refersec{chap:controlflowoperations}).
2727 \section{Code Addresses and Ranges}
2728 \label{chap:codeaddressesandranges}
2729 Any debugging information entry describing an entity that has
2730 a machine code address or range of machine code addresses,
2731 which includes compilation units, module initialization,
2732 subroutines, ordinary \nolink{blocks},
2733 try/catch \nolink{blocks} (see Section\refersec{chap:tryandcatchblockentries}),
2734 labels and the like, may have
2736 \item A \DWATlowpcDEFN{} attribute for
2737 \hypertarget{chap:DWATlowpccodeaddressorrangeofaddresses}{}
2740 \item A \DWATlowpcDEFN{}
2741 \addtoindexx{low PC attribute}
2744 \addtoindexx{high PC attribute}
2745 \hypertarget{chap:DWAThighpccontiguousrangeofcodeaddresses}{}
2746 pair of attributes for
2747 a single contiguous range of
2750 \item A \DWATrangesDEFN{} attribute
2751 \addtoindexx{ranges attribute}
2752 \hypertarget{chap:DWATrangesnoncontiguousrangeofcodeaddresses}{}
2753 for a non-contiguous range of addresses.
2756 In addition, a non-contiguous range of
2757 addresses may also be specified for the
2758 \DWATstartscope{} attribute.
2759 \addtoindexx{start scope attribute}
2761 If an entity has no associated machine code,
2762 none of these attributes are specified.
2764 \subsection{Single Address}
2765 When there is a single address associated with an entity,
2766 such as a label or alternate entry point of a subprogram,
2767 the entry has a \DWATlowpc{} attribute whose value is the
2768 relocated address for the entity.
2770 \textit{While the \DWATentrypc{}
2771 attribute might also seem appropriate for this purpose,
2772 historically the \DWATlowpc{} attribute was used before
2773 \DWATentrypc{} was introduced
2774 (in \addtoindex{DWARF Version 3}). There is
2775 insufficient reason to change this;
2776 \DWATlowpc{} serves as a default entry PC address as described
2777 in Section \refersec{chap:entryaddress}.}
2780 \subsection{Continuous Address Range}
2781 \label{chap:contiguousaddressranges}
2782 When the set of addresses of a debugging information entry can
2783 be described as a single contiguous range, the entry
2784 \addtoindexx{high PC attribute}
2786 \addtoindexx{low PC attribute}
2789 \DWAThighpc{} pair of attributes.
2792 \DWATlowpc{} attribute
2793 is the relocated address of the
2794 first instruction associated with the entity. If the value of
2795 the \DWAThighpc{} is of class address, it is the relocated
2796 address of the first location past the last instruction
2797 associated with the entity; if it is of class constant, the
2798 value is an unsigned integer offset which when added to the
2799 low PC gives the address of the first location past the last
2800 instruction associated with the entity.
2802 \textit{The high PC value
2803 may be beyond the last valid instruction in the executable.}
2806 The presence of low and high PC attributes for an entity
2807 implies that the code generated for the entity is contiguous
2808 and exists totally within the boundaries specified by those
2809 two attributes. If that is not the case, no low and high PC
2810 attributes should be produced.
2812 \subsection{Non-Contiguous Address Ranges}
2813 \label{chap:noncontiguousaddressranges}
2814 When the set of addresses of a debugging information entry
2815 \addtoindexx{non-contiguous address ranges}
2816 cannot be described as a single contiguous range, the entry has
2817 a \DWATranges{} attribute
2818 \addtoindexx{ranges attribute}
2819 whose value is of class \livelink{chap:classrangelistptr}{rangelistptr}
2820 and indicates the beginning of a \addtoindex{range list}.
2822 a \DWATstartscope{} attribute
2823 \addtoindexx{start scope attribute}
2824 may have a value of class
2825 \livelink{chap:classrangelistptr}{rangelistptr} for the same reason.
2827 Range lists are contained in a separate object file section called
2828 \dotdebugranges{}. A
2829 \addtoindex{range list} is indicated by a
2830 \DWATranges{} attribute whose
2831 \addtoindexx{ranges attribute}
2832 value is represented as an offset from the beginning of the
2833 \dotdebugranges{} section to the beginning of the
2834 \addtoindex{range list}.
2837 If the current compilation unit contains a \DWATrangesbase{}
2838 attribute, the value of that attribute establishes a base
2839 offset within the \dotdebugranges{} section for the compilation
2840 unit. The offset given by the \DWATranges{} attribute is
2841 relative to that base.
2843 \textit{The \DWATrangesbase{} attribute is new in \DWARFVersionV.
2844 The advantage of this attribute is that it reduces the number of
2845 object language relocations needed for references to the \dotdebugranges{}
2846 section from one for each range entry to a single relocation that
2847 applies for the entire compilation unit.}
2849 The \addtoindex{applicable base address} of a \addtoindex{range list}
2851 by the closest preceding base address selection entry (see
2852 below) in the same range list. If there is no such selection
2853 entry, then the applicable base address defaults to the base
2854 address of the compilation unit
2855 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2857 \textit{In the case of a compilation unit where all of the machine
2858 code is contained in a single contiguous section, no base
2859 address selection entry is needed.}
2861 Address range entries in a \addtoindex{range list} may not overlap.
2862 There is no requirement that the entries be ordered in any particular way.
2864 Each entry in a \addtoindex{range list} is either a
2865 \addtoindex{range list entry},
2866 \addtoindexx{base address selection entry!in range list}
2867 a base address selection entry, or an
2868 \addtoindexx{end-of-list entry!in range list}
2872 \subsubsection{Range List Entry}
2873 A \addtoindex{range list entry} consists of:
2874 \begin{enumerate}[1. ]
2875 \item A beginning address offset. This address offset has the
2876 \addtoindex{size of an address} and is relative to
2877 the \addtoindex{applicable base address} of the compilation unit referencing this
2878 \addtoindex{range list}.
2879 It marks the beginning of an
2880 \addtoindexi{address range}{address range!in range list}.
2882 \item An ending address offset. This address offset again has the
2883 \addtoindex{size of an address} and is relative
2884 to the \addtoindex{applicable base address} of the compilation unit referencing
2885 this \addtoindex{range list}.
2886 It marks the first address past the end of the address range.
2887 The ending address must be greater than or
2888 equal to the beginning address.
2891 \textit{A \addtoindex{range list} entry (but not a base address
2892 selection or end-of-list entry) whose beginning and
2893 ending addresses are equal has no effect because the size of the
2894 range covered by such an entry is zero.}
2898 \subsubsection{Base Address Selection Entry}
2899 A \addtoindex{base address selection entry} consists of:
2900 \begin{enumerate}[1. ]
2901 \item The value of the largest representable address offset
2902 (for example, \wffffffff when the size of an address is 32 bits).
2904 \item An address, which defines the appropriate base address
2905 for use in interpreting the beginning and ending address offsets
2906 of subsequent entries of the location list.
2909 \textit{A base address selection entry affects only the
2910 remainder of list in which it is contained.}
2912 \subsubsection{End-of-List Entry}
2913 The end of any given \addtoindex{range list} is marked by an
2914 \addtoindexx{end-of-list entry!in range list}
2916 which consists of a 0 for the beginning address
2917 offset and a 0 for the ending address offset.
2918 A \addtoindex{range list}
2919 containing only an end-of-list entry describes an empty scope
2920 (which contains no instructions).
2922 \textit{A base address selection entry and an
2923 \addtoindexx{end-of-list entry!in range list}
2924 end-of-list entry for
2925 a \addtoindex{range list}
2926 are identical to a base address selection entry
2927 and end-of-list entry, respectively, for a location list
2928 (see Section \refersec{chap:locationlists})
2929 in interpretation and representation.}
2932 \section{Entry Address}
2933 \label{chap:entryaddress}
2934 \textit{The entry or first executable instruction generated
2935 for an entity, if applicable, is often the lowest addressed
2936 instruction of a contiguous range of instructions. In other
2937 cases, the entry address needs to be specified explicitly.}
2939 Any debugging information entry describing an entity that has
2940 a range of code addresses, which includes compilation units,
2941 module initialization, subroutines,
2942 \livelink{chap:lexicalblock}{lexical \nolink{blocks}},
2943 \livelink{chap:tryandcatchblockentries}{try/catch \nolink{blocks}},
2944 and the like, may have a \DWATentrypcDEFN{} attribute
2945 \addtoindexx{entry PC address}
2946 to indicate the first executable instruction within that
2947 range\hypertarget{chap:entryaddressofscope}{}
2948 of addresses. The value of the \DWATentrypcNAME{} attribute is a
2949 relocated address if the
2950 value of \DWATentrypcNAME{} is of class \CLASSaddress; or if it is of class
2951 \CLASSconstant, the value is an unsigned integer offset which, when
2952 added to the base address of the function, gives the entry
2955 The base address of the containing scope is given by either the
2956 \DWATlowpc{} attribute, or the first range entry in the list of
2957 ranges given by the \DWATranges{} attribute.
2958 If no \DWATentrypcNAME{} attribute is present,
2959 then the entry address is assumed to be the same as the
2963 \section{Static and Dynamic Values of Attributes}
2964 \label{chap:staticanddynamicvaluesofattributes}
2966 Some attributes that apply to types specify a property (such
2967 as the lower bound of an array) that is an integer value,
2968 where the value may be known during compilation or may be
2969 computed dynamically during execution.
2973 attributes is determined based on the class as follows:
2975 \item For a \livelink{chap:classconstant}{constant}, the value of the constant is the value of
2978 \item For a \livelink{chap:classreference}{reference}, the
2979 value is a reference to another DIE. This DIE may:
2981 \renewcommand{\itemsep}{0cm}
2982 \item describe a constant which is the attribute value,
2983 \item describe a variable which contains the attribute value, or
2984 \item contain a DWARF expression which computes the attribute value
2985 (for example, be a \DWTAGdwarfprocedure{} entry).
2988 \item For an \livelink{chap:classexprloc}{exprloc}, the value is interpreted as a
2990 evaluation of the expression yields the value of
2994 \textit{Whether an attribute value can be dynamic depends on the
2995 rules of the applicable programming language.
2999 \section{Entity Descriptions}
3000 \textit{Some debugging information entries may describe entities
3001 in the program that are artificial, or which otherwise have a
3002 \doublequote{name} that is not a valid identifier in the
3003 programming language. For example, several languages may
3004 capture or freeze the value of a variable at a particular
3005 point in the program and hold that value in an artificial variable.
3006 \addtoindex{Ada} 95 has package elaboration routines,
3007 type descriptions of the form \texttt{typename\textquoteright Class}, and
3008 \doublequote{\texttt{access} typename} parameters.}
3010 Generally, any debugging information entry that
3011 \hypertarget{chap:DWATdescriptionartificialnameordescription}{}
3012 has, or may have, a \DWATname{} attribute, may
3014 \addtoindexx{description attribute}
3015 \DWATdescriptionDEFN{} attribute whose value is a
3016 null-terminated string providing a description of the entity.
3018 \textit{It is expected that a debugger will only display these
3019 descriptions as part of the description of other entities.}
3022 \section{Byte and Bit Sizes}
3023 \label{chap:byteandbitsizes}
3024 % Some trouble here with hbox full, so we try optional word breaks.
3025 Many debugging information entries allow either a
3026 \DWATbytesizeNAME{} attribute or a
3027 \DWATbitsizeNAME{} attribute,
3028 whose \livelink{chap:classconstant}{integer constant} value
3029 (see Section \ref{chap:staticanddynamicvaluesofattributes})
3031 amount of storage. The value of the
3032 \DWATbytesizeDEFN{} attribute
3033 is interpreted in bytes and the value of the
3035 attribute is interpreted in bits. The
3036 \DWATstringlengthbytesize{} and
3037 \DWATstringlengthbitsize{}
3038 attributes are similar.
3040 In addition, the \livelink{chap:classconstant}{integer constant}
3041 value of a \DWATbytestride{} attribute is interpreted
3042 in bytes and the \livelink{chap:classconstant}{integer constant} value of a
3044 attribute is interpreted in bits.
3046 \section{Linkage Names}
3047 \label{chap:linkagenames}
3048 \textit{Some language implementations, notably
3049 \addtoindex{C++} and similar
3050 languages, make use of implementation-defined names within
3051 object files that are different from the \addtoindex{identifier names}
3052 (see Section \refersec{chap:identifiernames}) of entities as they
3053 appear in the source. Such names, sometimes known as
3054 \addtoindex{mangled names}\addtoindexx{names!mangled},
3055 are used in various ways, such as: to encode additional
3056 information about an entity, to distinguish multiple entities
3057 that have the same name, and so on. When an entity has an
3058 associated distinct linkage name it may sometimes be useful
3059 for a producer to include this name in the DWARF description
3060 of the program to facilitate consumer access to and use of
3061 object file information about an entity and/or information
3062 \hypertarget{chap:DWATlinkagenameobjectfilelinkagenameofanentity}{}
3063 that is encoded in the linkage name itself.
3066 % Some trouble maybe with hbox full, so we try optional word breaks.
3067 A debugging information entry may have a
3068 \addtoindexx{linkage name attribute}
3069 \DWATlinkagenameDEFN{}
3070 attribute whose value is a null-terminated string containing the
3071 object file linkage name associated with the corresponding entity.
3074 \section{Template Parameters}
3075 \label{chap:templateparameters}
3076 \textit{In \addtoindex{C++}, a template is a generic definition
3077 of a class, function, member function, or typedef (alias).
3078 A template has formal parameters that
3079 can be types or constant values; the class, function,
3080 member function, or typedef is instantiated differently for each
3081 distinct combination of type or value actual parameters. DWARF does
3082 not represent the generic template definition, but does represent each
3085 A debugging information entry that represents a
3086 \addtoindex{template instantiation}
3087 will contain child entries describing the actual template parameters.
3088 The containing entry and each of its child entries reference a template
3089 parameter entry in any circumstance where the template definition
3090 referenced a formal template parameter.
3092 A template type parameter is represented by a debugging information
3094 \addtoindexx{template type parameter entry}
3095 \DWTAGtemplatetypeparameterTARG.
3096 A template value parameter is represented by a debugging information
3098 \addtoindexx{template value parameter entry}
3099 \DWTAGtemplatevalueparameterTARG.
3100 The actual template parameter entries appear in the same order as the
3101 corresponding template formal parameter declarations in the
3105 A type or value parameter entry may have a \DWATname{} attribute,
3106 \addtoindexx{name attribute}
3108 null\dash terminated string containing the name of the corresponding
3109 formal parameter as it appears in the source program.
3110 The entry may also have a
3111 \DWATdefaultvalue{} attribute, which is a flag indicating
3112 that the value corresponds to the default argument for the
3116 \addtoindexx{formal type parameter|see{template type parameter entry}}
3117 template type parameter entry has a
3118 \addtoindexx{type attribute}
3119 \DWATtype{} attribute
3120 describing the actual type by which the formal is replaced.
3122 A template value parameter entry has a \DWATtype{} attribute
3123 describing the type of the parameterized value.
3124 The entry also has an attribute giving the
3125 actual compile-time or run-time constant value
3126 of the value parameter for this instantiation.
3128 \DWATconstvalueDEFN{} attribute,
3129 \addtoindexx{constant value attribute}
3130 \livetarg{chap:DWATconstvaluetemplatevalueparameter}{}
3131 whose value is the compile-time constant value
3132 as represented on the target architecture, or a
3133 \DWATlocation{} attribute, whose value is a
3134 single location description for the run-time constant address.
3137 \label{chap:alignment}
3138 \livetarg{chap:DWATalignmentnondefault}{}
3139 A debugging information entry may have a
3140 \DWATalignmentDEFN{} attribute\addtoindexx{alignment attribute}
3141 that describes the (non-default) alignment requirements of the entry.
3142 \DWATalignment{} has a positive, non-zero, integer constant value
3143 describing the strictest specified (non-default) alignment of the entity.
3144 This constant describes the actual alignment used by the compiler.
3145 (If there are multiple alignments specified by the user, or if the
3146 user specified an alignment the compiler could not satisfy, then
3147 only the strictest alignment is added using this attribute.)
3149 \textit{For example, an alignment attribute whose value is 8 indicates
3150 that the entity to which it applies occurs at an address that is a
3151 multiple of eight (not a multiple of $2^8$ or 256).}