1 \chapter{General Description}
2 \label{chap:generaldescription}
3 \section{The Debugging Information Entry (DIE)}
4 \label{chap:thedebuggingentrydie}
6 \addtoindexx{debugging information entry}
7 uses a series of debugging information entries
8 (DIEs)\addtoindexx{DIE|see{debugging information entry}}
9 to define a low-level representation of a source program.
10 Each debugging information entry consists of an identifying
11 \addtoindex{tag} and a series of
12 \addtoindex{attributes}.
13 An entry, or group of entries together, provide a description of a
15 \addtoindex{entity} in the source program.
16 The tag specifies the class to which an entry belongs
17 and the attributes define the specific characteristics of the entry.
20 \addtoindexx{tag names|see{debugging information entry}}
21 is listed in Table \refersec{tab:tagnames}.
22 The debugging information entries they identify are
23 described in Chapters 3, 4 and 5.
29 \autocols[0pt]{c}{2}{l}{
30 \DWTAGaccessdeclaration,
35 \DWTAGcallsiteparameter,
40 \DWTAGcommoninclusion,
48 \DWTAGenumerationtype,
51 \DWTAGformalparameter,
53 \DWTAGgenericsubrange,
54 \bb\eb\DWTAGimmutabletype,
55 \DWTAGimporteddeclaration,
59 \DWTAGinlinedsubroutine,
71 \DWTAGptrtomembertype,
74 \DWTAGrvaluereferencetype,
84 \DWTAGtemplatetypeparameter,
85 \DWTAGtemplatevalueparameter,
91 \DWTAGunspecifiedparameters,
92 \DWTAGunspecifiedtype,
103 \textit{The debugging information entry descriptions in
104 Chapters 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. See Section \refersec{datarep:splitdwarfobjectfiles} and
126 Appendix \refersec{app:splitdwarfobjectsinformative} for details.
129 As a further option, debugging information entries and other debugging
130 information that are the same in multiple executable or shared object files
131 may be found in a separate \addtoindex{supplementary object file} that
132 contains supplementary debug sections.
133 See Section \refersec{datarep:dwarfsupplemetaryobjectfiles} for
136 \section{Attribute Types}
137 \label{chap:attributetypes}
138 Each attribute value is characterized by an attribute name.
139 \addtoindexx{attribute duplication}
140 No more than one attribute with a given name may appear in any
141 debugging information entry.
142 There are no limitations on the
143 \addtoindexx{attribute ordering}
144 ordering of attributes within a debugging information entry.
146 The attributes are listed in Table \referfol{tab:attributenames}.
148 \setlength{\extrarowheight}{0.1cm}
149 \addtoindexx{attributes!list of}
150 \begin{longtable}{P{6.2cm}|P{8.5cm}}
151 \caption{Attribute names} \label{tab:attributenames} \\
152 \hline \bfseries Attribute$^*$&\bfseries Usage \\ \hline
154 \bfseries Attribute$^*$&\bfseries Identifies or Specifies \\ \hline
159 \vspace{2mm}\emph{Continued on next page} \newline
160 $^*${\parbox[t]{15cm}{\tiny Links for attributes come to the left column of this table;
161 links in the right column "fan-out" to one or more descriptions.}} \newline
166 $^*${\parbox[t]{15cm}{\tiny Links for attributes come to the left column of this table;
167 links in the right column "fan-out" to one or more descriptions.}}}
170 \DWATabstractoriginTARG
171 &\livelinki{chap:DWATabstractorigininlineinstance}
172 {Inline instances of inline subprograms}
173 {inline instances of inline subprograms} \\
174 % Heren livelink we cannot use \dash or \dash{}.
175 &\livelinki{chap:DWATabstractoriginoutoflineinstance}
176 {Out-of-line instances of inline subprograms}
177 {out-of-line instances of inline subprograms} \\
178 \DWATaccessibilityTARG
179 &\livelink{chap:DWATaccessdeclaration}
180 {Access declaration} (\addtoindex{C++}, \addtoindex{Ada}) \\
181 &\livelink{chap:DWATaccessibilitycppinheritedmembers}
182 {Accessibility of base or inherited class} (\addtoindex{C++}) \\
183 &\livelinki{chap:DWATaccessibilityattribute}
184 {Accessibility of data member or member function}
185 {accessibility attribute}
187 \DWATaddressclassTARG
188 &\livelinki{chap:DWATadressclasspointerorreferencetypes}
189 {Pointer or reference types}
190 {pointer or reference types} \\
191 &\livelinki{chap:DWATaddressclasssubroutineorsubroutinetype}
192 {Subroutine or subroutine type}
193 {subroutine or subroutine type} \\
195 &\livelinki{chap:DWATaddrbaseforaddresstable}
196 {Base offset for address table}
199 &\livelinki{chap:DWATalignmentnondefault}
200 {Non-default alignment of type, subprogram or variable}
201 {non-default alignment} \addtoindexx{alignment!non-default} \\
203 &\livelinki{chap:DWATallocatedallocationstatusoftypes}
204 {Allocation status of types}
205 {allocation status of types} \\
207 &\livelinki{chap:DWATartificialobjectsortypesthat}
208 {Objects or types that are not actually declared in the source}
209 {objects or types that are not actually declared in the source} \\
210 \DWATassociatedTARG{}
211 &\livelinki{chap:DWATassociatedassociationstatusoftypes}
212 {Association status of types}
213 {association status of types} \\
215 &\livelinki{chap:DWATbasetypesprimitivedatatypesofcompilationunit}
216 {Primitive data types of compilation unit}
217 {primitive data types of compilation unit} \\
218 \DWATbinaryscaleTARG{}
219 &\livelinki{chap:DWATbinaryscalebinaryscalefactorforfixedpointtype}
220 {Binary scale factor for fixed-point type}
221 {binary scale factor for fixed-point type} \\
222 %\DWATbitoffsetTARG{}
223 %&\livelinki{chap:DWATbitoffsetbasetypebitlocation}{Base type bit location}{base type bit location} \\
224 %&\livelinki{chap:DWATbitoffsetdatamemberbitlocation}{Data member bit location}{data member bit location} \\
226 &\livelinki{chap:DWATbitsizebasetypebitsize}
227 {Size of a base type in bits}
228 {base type bit size} \\
229 &\livelinki{chap:DWATbitsizedatamemberbitsize}
230 {Size of a data member in bits}
231 {data member bit size} \\
233 &\livelinki{chap:DWATbitstridearrayelementstrideofarraytype}
234 {Array element stride (of array type)}
235 {array element stride (of array type)} \\*
236 &\livelinki{chap:DWATbitstridesubrangestridedimensionofarraytype}
237 {Subrange stride (dimension of array type)}
238 {subrange stride (dimension of array type)} \\*
239 &\livelinki{chap:DWATbitstrideenumerationstridedimensionofarraytype}
240 {Enumeration stride (dimension of array type)}
241 {enumeration stride (dimension of array type)} \\
243 &\livelinki{chap:DWATbytesizedataobjectordatatypesize}
244 {Size of a data object or data type in bytes}
245 {data object or data type size} \\
246 \DWATbytestrideTARG{}
247 &\livelinki{chap:DWATbytestridearrayelementstrideofarraytype}
248 {Array element stride (of array type)}
249 {array element stride (of array type)} \\
250 &\livelinki{chap:DWATbytestridesubrangestridedimensionofarraytype}
251 {Subrange stride (dimension of array type)}
252 {subrange stride (dimension of array type)} \\
253 &\livelinki{chap:DWATbytestrideenumerationstridedimensionofarraytype}
254 {Enumeration stride (dimension of array type)}
255 {enumeration stride (dimension of array type)} \\
256 \DWATcallallcallsTARG{}
257 &\livelinki{chap:DWATcallallcallsofasubprogram}
258 {All tail and normal calls in a subprogram are described by call site entries}
259 {all tail and normal calls are described}
260 \index{call site!summary!all tail and normal calls are described} \\
261 \DWATcallallsourcecallsTARG{}
262 &\livelinki{chap:DWATcallallsourcecallsofasubprogram}
263 {All tail, normal and inlined calls in a subprogram are described by call site and inlined subprogram entries}
264 {all tail, normal and inlined calls are described}
265 \index{call site!summary!all tail, normal and inlined calls are described} \\
266 \DWATcallalltailcallsTARG{}
267 &\livelinki{chap:DWATcallalltailcallsofasubprogram}
268 {All tail calls in a subprogram are described by call site entries}
269 {all tail calls are described}
270 \index{call site!summary!all tail calls are described} \\
271 \DWATcallcolumnTARG{}
272 &\livelinki{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}
273 {Column position of inlined subroutine call}
274 {column position of inlined subroutine call} \\
275 &\livelinki{chap:DWATcallcolumnofcallsite}
276 {Column position of call site of non-inlined call}
277 {column position of call site of non-inlined call} \\
278 \DWATcalldatalocationTARG{}
279 &\livelinki{chap:DWATcalldatalocationofcallparameter}
280 {Address of the value pointed to by an argument passed in a call}
281 {address of the value pointed to by an argument}
282 \index{call site!address of the value pointed to by an argument} \\
283 \DWATcalldatavalueTARG{}
284 &\livelinki{chap:DWATcalldatavalueofcallparameter}
285 {Value pointed to by an argument passed in a call}
286 {value pointed to by an argument}
287 \index{call site!value pointed to by an argument} \\
289 &\livelinki{chap:DWATcallfilefilecontaininginlinedsubroutinecall}
290 {File containing inlined subroutine call}
291 {file containing inlined subroutine call} \\
292 &\livelinki{chap:DWATcallfileofcallsite}
293 {File containing call site of non-inlined call}
294 {file containing call site of non-inlined call} \\
296 &\livelinki{chap:DWATcalllinelinenumberofinlinedsubroutinecall}
297 {Line number of inlined subroutine call}
298 {line number of inlined subroutine call} \\
299 &\livelinki{chap:DWATcalllineofcallsite}
300 {Line containing call site of non-inlined call}
301 {line containing call site of non-inlined call} \\
303 \DWATcalloriginTARG{}
304 &\livelinki{chap:DWATcalloriginofcallsite}
305 {Subprogram called in a call}
307 \index{call site!subprogram called} \\
308 \DWATcallparameterTARG{}
309 &\livelinki{chap:DWATcallparameterofcallparameter}
310 {Parameter entry in a call}
312 \index{call site!parameter entry} \\
314 &\livelinki{chap:DWATcallpcofcallsite}
315 {Address of the call instruction in a call}
316 {address of call instruction}
317 \index{call site!address of the call instruction} \\
318 \DWATcallreturnpcTARG{}
319 &\livelinki{chap:DWATcallreturnpcofcallsite}
320 {Return address from a call}
321 {return address from a call}
322 \index{call site!return address} \\
323 \DWATcalltailcallTARG{}
324 &\livelinki{chap:DWATcalltailcallofcallsite}
325 {Call is a tail call}
326 {call is a tail call}
327 \index{call site!tail call} \\
328 \DWATcalltargetTARG{}
329 &\livelinki{chap:DWATcalltargetofcallsite}
330 {Address of called routine in a call}
331 {address of called routine}
332 \index{call site!address of called routine} \\
333 \DWATcalltargetclobberedTARG{}
334 &\livelinki{chap:DWATcalltargetclobberedofcallsite}
335 {Address of called routine, which may be clobbered, in a call}
336 {address of called routine, which may be clobbered}
337 \index{call site!address of called routine, which may be clobbered} \\
339 &\livelinki{chap:DWATcallvalueofcallparameter}
340 {Argument value passed in a call}
341 {argument value passed}
342 \index{call site!argument value passed} \\
344 \DWATcallingconventionTARG{}
345 &\livelinki{chap:DWATcallingconventionforsubprograms}
346 {Calling convention for subprograms}
347 {Calling convention!for subprograms} \\
348 &\livelinki{chap:DWATcallingconventionfortypes}
349 {Calling convention for types}
350 {Calling convention!for types}
353 \DWATcommonreferenceTARG
354 &\livelinki{chap:commonreferencecommonblockusage}
356 {common block usage} \\
358 &\livelinki{chap:DWATcompdircompilationdirectory}
359 {Compilation directory}
360 {compilation directory} \\
362 &\livelinki{chap:DWATconstexprcompiletimeconstantobject}
363 {Compile-time constant object}
364 {compile-time constant object} \\
365 &\livelinki{chap:DWATconstexprcompiletimeconstantfunction}
366 {Compile-time constant function}
367 {compile-time constant function} \\
369 &\livelinki{chap:DWATconstvalueconstantobject}
372 &\livelinki{chap:DWATconstvalueenumerationliteralvalue}
373 {Enumeration literal value}
374 {enumeration literal value} \\
375 &\livelinki{chap:DWATconstvaluetemplatevalueparameter}
376 {Template value parameter}
377 {template value parameter} \\
378 \DWATcontainingtypeTARG
379 &\livelinki{chap:DWATcontainingtypecontainingtypeofpointertomembertype}
380 {Containing type of pointer to member type}
381 {containing type of pointer to member type} \\
383 &\livelinki{chap:DWATcountelementsofsubrangetype}
384 {Elements of subrange type}
385 {elements of breg subrange type} \\
386 \DWATdatabitoffsetTARG
387 &\livelinki{chap:DWATdatabitoffsetbasetypebitlocation}
388 {Base type bit location}
389 {base type bit location} \\
390 &\livelinki{chap:DWATdatabitoffsetdatamemberbitlocation}
391 {Data member bit location}
392 {data member bit location} \\
393 \DWATdatalocationTARG{}
394 &\livelinki{chap:DWATdatalocationindirectiontoactualdata}
395 {Indirection to actual data}
396 {indirection to actual data} \\
397 \DWATdatamemberlocationTARG
398 &\livelinki{chap:DWATdatamemberlocationdatamemberlocation}
399 {Data member location}
400 {data member location} \\
401 &\livelinki{chap:DWATdatamemberlocationinheritedmemberlocation}
402 {Inherited member location}
403 {inherited member location} \\
404 \DWATdecimalscaleTARG
405 &\livelinki{chap:DWATdecimalscaledecimalscalefactor}
406 {Decimal scale factor}
407 {decimal scale factor} \\
409 &\livelinki{chap:DWATdecimalsigndecimalsignrepresentation}
410 {Decimal sign representation}
411 {decimal sign representation} \\
413 &\livelinki{chap:DWATdeclcolumncolumnpositionofsourcedeclaration}
414 {Column position of source declaration}
415 {column position of source declaration} \\
417 &\livelinki{chap:DWATdeclfilefilecontainingsourcedeclaration}
418 {File containing source declaration}
419 {file containing source declaration} \\
421 &\livelinki{chap:DWATdecllinelinenumberofsourcedeclaration}
422 {Line number of source declaration}
423 {line number of source declaration} \\
425 &\livelinki{chap:DWATdeclarationincompletenondefiningorseparateentitydeclaration}
426 {Incomplete, non-defining, or separate entity declaration}
427 {incomplete, non-defining, or separate entity declaration} \\
429 &\livelinki{chap:DWATdefaulteddef}
430 {Whether a member function has been declared as default}
431 {defaulted attribute} \\
432 \DWATdefaultvalueTARG
433 &\livelinki{chap:DWATdefaultvaluedefaultvalueofparameter}
434 {Default value of parameter}
435 {default value of parameter} \\
437 &\livelinki{chap:DWATdeleteddef}
438 {Whether a member has been declared as deleted}
439 {Deletion of member function} \\
440 \DWATdescriptionTARG{}
441 &\livelinki{chap:DWATdescriptionartificialnameordescription}
442 {Artificial name or description}
443 {artificial name or description} \\
445 &\livelinki{chap:DWATdigitcountdigitcountforpackeddecimalornumericstringtype}
446 {Digit count for packed decimal or numeric string type}
447 {digit count for packed decimal or numeric string type} \\
449 &\livelinki{chap:DWATdiscrdiscriminantofvariantpart}
450 {Discriminant of variant part}
451 {discriminant of variant part} \\
453 &\livelinki{chap:DWATdiscrlistlistofdiscriminantvalues}
454 {List of discriminant values}
455 {list of discriminant values} \\
457 &\livelinki{chap:DWATdiscrvaluediscriminantvalue}
459 {discriminant value} \\
461 &\livelinki{chap:DWATdwonameforunit}
462 {Name of split DWARF object file}
463 {split DWARF object file!object file name} \\
465 &\livelinki{chap:DWATelementalelementalpropertyofasubroutine}
466 {Elemental property of a subroutine}
467 {elemental property of a subroutine} \\
469 &\livelinki{chap:DWATencodingencodingofbasetype}
470 {Encoding of base type}
471 {encoding of base type} \\
473 &\livelinki{chap:DWATendianityendianityofdata}
475 {endianity of data} \\
477 &\livelinki{chap:entryaddressofscope}
478 {Entry address of a scope (compilation unit, \mbox{subprogram,} and so on)}
479 {entry address of a scope} \\
481 &\livelinki{chap:DWATenumclasstypesafeenumerationdefinition}
482 {Type safe enumeration definition}
483 {type safe enumeration definition}\\
485 &\livelinki{chap:DWATexplicitexplicitpropertyofmemberfunction}
486 {Explicit property of member function}
487 {explicit property of member function}\\
488 \DWATexportsymbolsTARG
489 &\livelinki{chap:DWATexportsymbolsofnamespace}
490 {Export (inline) symbols of namespace}
491 {export symbols of a namespace} \\
492 &\livelinki{chap:DWATexportsymbolsofstructunionclass}
493 {Export symbols of a structure, union or class}
494 {export symbols of a structure, union or class} \\
496 &\livelinki{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}
497 {Previous namespace extension or original namespace}
498 {previous namespace extension or original namespace}\\
500 &\livelinki{chap:DWATexternalexternalsubroutine}
501 {External subroutine}
502 {external subroutine} \\
503 &\livelinki{chap:DWATexternalexternalvariable}
505 {external variable} \\
507 &\livelinki{chap:DWATframebasesubroutineframebaseaddress}
508 {Subroutine frame base address}
509 {subroutine frame base address} \\
511 &\livelinki{chap:DWATfriendfriendrelationship}
512 {Friend relationship}
513 {friend relationship} \\
515 &\livelinki{chap:DWAThighpccontiguousrangeofcodeaddresses}
516 {Contiguous range of code addresses}
517 {contiguous range of code addresses} \\
518 \DWATidentifiercaseTARG
519 &\livelinki{chap:DWATidentifiercaseidentifiercaserule}
520 {Identifier case rule}
521 {identifier case rule} \\
523 &\livelinki{chap:DWATimportimporteddeclaration}
524 {Imported declaration}
525 {imported declaration} \\*
526 &\livelinki{chap:DWATimportimportedunit}
529 &\livelinki{chap:DWATimportnamespacealias}
531 {namespace alias} \\*
532 &\livelinki{chap:DWATimportnamespaceusingdeclaration}
533 {Namespace using declaration}
534 {namespace using declaration} \\*
535 &\livelinki{chap:DWATimportnamespaceusingdirective}
536 {Namespace using directive}
537 {namespace using directive} \\
539 &\livelinki{chap:DWATinlineabstracttinstance}
541 {abstract instance} \\
542 &\livelinki{chap:DWATinlineinlinedsubroutine}
544 {inlined subroutine} \\
546 &\livelinki{chap:DWATisoptionaloptionalparameter}
548 {optional parameter} \\
550 &\livelinki{chap:DWATlanguageprogramminglanguage}
551 {Programming language}
552 {programming language} \\
554 &\livelinki{chap:DWATlinkagenameobjectfilelinkagenameofanentity}
555 {Object file linkage name of an entity}
556 {object file linkage name of an entity} \\
558 &\livelinki{chap:DWATlocationdataobjectlocation}
559 {Data object location}
560 {data object location} \\
561 \DWATloclistsbaseTARG
562 &\livelinki{chap:DWATloclistsbaseinlocationlist}
563 {Location lists base}
564 {location lists base} \\
566 &\livelinki{chap:DWATlowpccodeaddressorrangeofaddresses}
567 {Code address or range of addresses}
568 {code address or range of addresses} \\*
569 &\livelinki{chap:DWATlowpcbaseaddressofscope}
570 {Base address of scope}
571 {base address of scope} \\
573 &\livelinki{chap:DWATlowerboundlowerboundofsubrange}
574 {Lower bound of subrange}
575 {lower bound of subrange} \\
577 &\livelinki{chap:DWATmacroinfomacroinformation}
578 {Macro preprocessor information (legacy)}
579 {macro preprocessor information (legacy)} \\
580 & \textit{(reserved for coexistence with \DWARFVersionIV{} and earlier)} \\
582 &\livelinki{chap:DWATmacrosmacroinformation}
583 {Macro preprocessor information}
584 {macro preprocessor information} \\
585 & \textit{(\texttt{\#define}, \texttt{\#undef}, and so on in \addtoindex{C},
586 \addtoindex{C++} and similar languages)} \\
587 \DWATmainsubprogramTARG
588 &\livelinki{chap:DWATmainsubprogrammainorstartingsubprogram}
589 {Main or starting subprogram}
590 {main or starting subprogram} \\
591 &\livelinki{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}
592 {Unit containing main or starting subprogram}
593 {unit containing main or starting subprogram}\\
595 &\livelinki{chap:DWATmutablemutablepropertyofmemberdata}
596 {Mutable property of member data}
597 {mutable property of member data} \\
599 &\livelinki{chap:DWATnamenameofdeclaration}
600 {Name of declaration}
601 {name of declaration}\\
602 &\livelinki{chap:DWATnamepathnameofcompilationsource}
603 {Path name of compilation source}
604 {path name of compilation source} \\
605 \DWATnamelistitemTARG
606 &\livelinki{chap:DWATnamelistitemnamelistitem}
610 &\livelinki{chap:DWATnoreturnofsubprogram}
611 {\doublequote{no return} property of a subprogram}
612 {noreturn attribute} \\
613 \DWATobjectpointerTARG
614 &\livelinki{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}
615 {Object (\texttt{this}, \texttt{self}) pointer of member function}
616 {object (\texttt{this}, \texttt{self}) pointer of member function}\\
618 &\livelinki{chap:DWATorderingarrayrowcolumnordering}
619 {Array row/column ordering}
620 {array row/column ordering}\\
621 \DWATpicturestringTARG
622 &\livelinki{chap:DWATpicturestringpicturestringfornumericstringtype}
623 {Picture string for numeric string type}
624 {picture string for numeric string type} \\
626 &\livelinki{chap:DWATprioritymodulepriority}
630 &\livelinki{chap:DWATproducercompileridentification}
631 {Compiler identification}
632 {compiler identification}\\
634 &\livelinki{chap:DWATprototypedsubroutineprototype}
635 {Subroutine prototype}
636 {subroutine prototype}\\
638 &\livelinki{chap:DWATpurepurepropertyofasubroutine}
639 {Pure property of a subroutine}
640 {pure property of a subroutine} \\
642 &\livelinki{chap:DWATrangesnoncontiguousrangeofcodeaddresses}
643 {Non-contiguous range of code addresses}
644 {non-contiguous range of code addresses} \\
647 &\livelinki{chap:DWATrankofdynamicarray}
648 {Dynamic number of array dimensions}
649 {dynamic number of array dimensions} \\
651 &\livelinki{chap:DWATrecursiverecursivepropertyofasubroutine}
652 {Recursive property of a subroutine}
653 {recursive property of a subroutine} \\
655 &\livelink{chap:DWATreferenceofnonstaticmember}
656 {\&-qualified non-static member function} \textit{(\addtoindex{C++})} \\
658 &\livelinki{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}
659 {Subroutine return address save location}
660 {subroutine return address save location} \\
662 \DWATrnglistsbaseTARG
663 &\livelinki{chap:DWATrnglistsbaseforrnglists}
664 {Base offset for range lists}
668 \DWATrvaluereferenceTARG
669 &\livelink{chap:DWATrvaluereferenceofnonstaticmember}
670 {\&\&-qualified non-static member function} \textit{(\addtoindex{C++})} \\
673 &\livelinki{chap:DWATsegmentaddressinginformation}
674 {Addressing information}
675 {addressing information} \\
677 &\livelinki{chap:DWATsiblingdebugginginformationentryrelationship}
678 {Debugging information entry relationship}
679 {debugging information entry relationship} \\
681 &\livelinki{chap:DWATsmallscalefactorforfixedpointtype}
682 {Scale factor for fixed-point type}
683 {scale factor for fixed-point type} \\
685 &\livelinki{chap:DWATsignaturetypesignature}
688 \DWATspecificationTARG
689 &\livelinki{chap:DWATspecificationincompletenondefiningorseparatedeclaration}
690 {Incomplete, non-defining, or separate declaration corresponding to a declaration}
691 {incomplete, non-defining, or separate declaration corresponding to a declaration} \\
693 &\livelinki{chap:DWATstartscopeofdeclaration}
694 {Reduced scope of declaration}
695 {reduced scope of declaration} \\*
697 &\livelinki{chap:DWATstaticlinklocationofuplevelframe}
698 {Location of uplevel frame}
699 {location of uplevel frame} \\
701 &\livelinki{chap:DWATstmtlistlinenumberinformationforunit}
702 {Line number information for unit}
703 {line number information for unit}\\
704 \DWATstringlengthTARG
705 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
706 {String length of string type}
707 {string length of string type} \\
708 \DWATstringlengthbitsizeTARG
709 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
710 {Size of string length of string type}
711 {string length of string type!size of} \\
712 \DWATstringlengthbytesizeTARG
713 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
714 {Size of string length of string type}
715 {string length of string type!size of} \\
716 \DWATstroffsetsbaseTARG
717 &\livelinki{chap:DWATstroffsetbaseforindirectstringtable}
718 {Base of string offsets table}
719 {string offsets table} \\
720 \DWATthreadsscaledTARG
721 &\livelink{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}
722 {Array bound THREADS scale factor}
723 (\addtoindex{UPC}) \\
725 &\livelinki{chap:DWATtrampolinetargetsubroutine}
727 {target subroutine of trampoline} \\
729 &\livelinki{chap:DWATtypeofcallsite}
731 {type!of call site} \\
732 &\livelinki{chap:DWAATtypeofstringtype}
733 {Type of string type components}
734 {type!of string type components} \\
735 &\livelinki{chap:DWATtypetypeofsubroutinereturn}
736 {Type of subroutine return}
737 {type!of subroutine return} \\
738 &\livelinki{chap:DWATtypetypeofdeclaration}
739 {Type of declaration}
740 {type!of declaration} \\
742 &\livelinki{chap:DWATupperboundupperboundofsubrange}
743 {Upper bound of subrange}
744 {upper bound of subrange} \\
746 &\livelinki{chap:DWATuselocationmemberlocationforpointertomembertype}
747 {Member location for pointer to member type}
748 {member location for pointer to member type} \\
749 \DWATuseUTFeightTARG\addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
750 &\livelinki{chap:DWATuseUTF8compilationunitusesutf8strings}
751 {Compilation unit uses UTF-8 strings}
752 {compilation unit uses UTF-8 strings} \\
753 \DWATvariableparameterTARG
754 &\livelinki{chap:DWATvariableparameternonconstantparameterflag}
755 {Non-constant parameter flag}
756 {non-constant parameter flag} \\
758 &\livelinki{chap:DWATvirtualityvirtualityindication}
759 {virtuality attribute}
760 {Virtuality of member function or base class} \\
762 &\livelinki{chap:DWATvisibilityvisibilityofdeclaration}
763 {Visibility of declaration}
764 {visibility of declaration} \\
765 \DWATvtableelemlocationTARG
766 &\livelinki{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}
767 {Virtual function vtable slot}
768 {virtual function vtable slot}\\
771 \addtoindexx{address|see {\textit{also} address class}}
772 \addtoindexx{addrptr|see {\textit{also} addrptr class}}
773 \addtoindexx{block|see {\textit{also} block class}}
774 \addtoindexx{constant|see {\textit{also} constant class}}
775 \addtoindexx{exprloc|see {\textit{also} exprloc class}}
776 \addtoindexx{flag|see {\textit{also} flag class}}
777 \addtoindexx{lineptr|see {\textit{also} lineptr class}}
778 \addtoindexx{loclistsptr|see {\textit{also} loclistsptr class}}
779 \addtoindexx{loclist|see {\textit{also} loclist class}}
780 \addtoindexx{macptr|see {\textit{also} macptr class}}
781 \addtoindexx{reference|see {\textit{also} reference class}}
782 \addtoindexx{rnglistsptr|see {\textit{also} rnglistsptr class}}
783 \addtoindexx{rnglist|see {\textit{also} rnglist class}}
784 \addtoindexx{string|see {\textit{also} string class}}
785 \addtoindexx{stroffsetsptr|see {\textit{also} stroffsetsptr class}}
787 \addtoindexx{class of attribute value!address|see {address class}}
788 \addtoindexx{class of attribute value!addrptr|see {addrptr class}}
789 \addtoindexx{class of attribute value!block|see {block class}}
790 \addtoindexx{class of attribute value!constant|see {constant class}}
791 \addtoindexx{class of attribute value!exprloc|see {exprloc class}}
792 \addtoindexx{class of attribute value!flag|see {flag class}}
793 \addtoindexx{class of attribute value!lineptr|see {lineptr class}}
794 \addtoindexx{class of attribute value!loclistsptr|see {loclistsptr class}}
795 \addtoindexx{class of attribute value!loclist|see {loclist class}}
796 \addtoindexx{class of attribute value!macptr|see {macptr class}}
797 \addtoindexx{class of attribute value!rnglistsptr|see {rnglistsptr class}}
798 \addtoindexx{class of attribute value!rnglist|see {rnglist class}}
799 \addtoindexx{class of attribute value!reference|see {reference class}}
800 \addtoindexx{class of attribute value!string|see {string class}}
801 \addtoindexx{class of attribute value!stroffsetsptr|see {stroffsetsptr class}}
804 The permissible values
805 \addtoindexx{attribute value classes}
806 for an attribute belong to one or more classes of attribute
808 Each form class may be represented in one or more ways.
809 For example, some attribute values consist
810 of a single piece of constant data.
811 \doublequote{Constant data}
812 is the class of attribute value that those attributes may have.
813 There are several representations of constant data,
814 including fixed length data of one, two, four, eight or 16 bytes
815 in size, and variable length data).
816 The particular representation for any given instance
817 of an attribute is encoded along with the attribute name as
818 part of the information that guides the interpretation of a
819 debugging information entry.
822 Attribute value forms belong
823 \addtoindexx{tag names!list of}
824 to one of the classes shown in Table \referfol{tab:classesofattributevalue}.
826 \begin{longtable}{l|P{11cm}}
827 \caption{Classes of attribute value}
828 \label{tab:classesofattributevalue} \\
829 \hline \bfseries Attribute Class & \bfseries General Use and Encoding \\ \hline
831 \bfseries Attribute Class & \bfseries General Use and Encoding \\ \hline
833 \hline \emph{Continued on next page}
838 \hypertarget{chap:classaddress}{}
839 \livelinki{datarep:classaddress}{address}{address class}
840 &Refers to some location in the address space of the \mbox{described} program.
843 \hypertarget{chap:classaddrptr}{}
844 \livelinki{datarep:classaddrptr}{addrptr}{addrptr class}
846 Specifies a location in the DWARF section that holds
847 a series of machine address values. Certain attributes use
848 one of these addresses by indexing relative to this location.
851 \hypertarget{chap:classblock}{}
852 \livelinki{datarep:classblock}{block}{block class}
853 & An arbitrary number of uninterpreted bytes of data.
854 The number of data bytes may be implicit from context
855 or explicitly specified by an initial unsigned LEB128 value
856 (see Section \refersec{datarep:variablelengthdata})
857 that precedes that number of data bytes.
860 \hypertarget{chap:classconstant}{}
861 \livelinki{datarep:classconstant}{constant}{constant class}
862 &One, two, four, eight or sixteen
863 bytes of uninterpreted data, or data
864 encoded in the variable length format known as LEB128
865 (see Section \refersec{datarep:variablelengthdata}).
868 \hypertarget{chap:classexprloc}{}
869 \livelinki{datarep:classexprloc}{exprloc}{exprloc class}
870 &A DWARF expression for a value or a location in the
871 address space of the described program.
872 A leading unsigned LEB128 value
873 (see Section \refersec{datarep:variablelengthdata})
874 specifies the number of bytes in the expression.
877 \hypertarget{chap:classflag}{}
878 \livelinki{datarep:classflag}{flag}{flag class}
879 &A small constant that indicates the presence or absence
883 \hypertarget{chap:classlineptr}{}
884 \livelinki{datarep:classlineptr}{lineptr}{lineptr class}
885 &Specifies a location in the DWARF section that holds line
889 \hypertarget{chap:classloclist}{}
890 \livelinki{datarep:classloclist}{loclist}{loclist class},
891 \hypertarget{chap:classloclistsptr}{}
892 \livelinki{datarep:classloclistsptr}{loclistsptr}{loclistsptr class}
893 &Specifies a location in the DWARF section that holds location
894 lists, which describe objects whose location can change during
898 \hypertarget{chap:classmacptr}{}
899 \livelinki{datarep:classmacptr}{macptr}{macptr class}
901 a location in the DWARF section that holds macro definition
905 \hypertarget{chap:classreference}{}
906 \livelinki{datarep:classreference}{reference}{reference class}
908 Refers to one of the debugging information
909 entries that \mbox{describe} the program. There are four types of
910 \mbox{reference}. The first is an offset relative to the beginning
911 of the \mbox{compilation} unit in which the reference occurs and must
912 refer to an entry within that same compilation unit. The second
913 type of reference is the offset of a debugging \mbox{information}
914 entry in any compilation unit, including one different from
915 the unit containing the reference. The third type of reference
916 is an indirect reference to a
917 \addtoindexx{type signature}
918 type definition using an 8-byte signature
919 for that type. The fourth type of reference is a reference from within the
920 \dotdebuginfo{} section of the executable or shared object file to
921 a debugging information entry in the \dotdebuginfo{} section of
922 a \addtoindex{supplementary object file}.
926 \hypertarget{chap:classrnglist}{}
927 \livelinki{datarep:classrnglist}{rnglist}{rnglist class},
928 \hypertarget{chap:classrnglistsptr}{}
929 \livelinki{datarep:classrnglistsptr}{rnglistsptr}{rnglistsptr class}
930 &Specifies a location in the DWARF section that holds
931 non-contiguous address ranges.
935 \hypertarget{chap:classstring}{}
936 \livelinki{datarep:classstring}{string}{string class}
937 & A null-terminated sequence of zero or more
938 (non-null) bytes. Data in this class are generally
939 printable strings. Strings may be represented directly in
940 the debugging \mbox{information} entry or as an offset in a separate
944 \hypertarget{chap:classstroffsetsptr}{}
945 \livelinki{datarep:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class}
946 &Specifies a location in the DWARF section that holds
947 a series of offsets into the DWARF section that holds strings.
948 Certain attributes use one of these offsets by indexing
949 relative to this location. The resulting offset is then
950 used to index into the DWARF string section.
957 \section{Relationship of Debugging Information Entries}
958 \label{chap:relationshipofdebugginginformationentries}
960 A variety of needs can be met by permitting a single
961 \addtoindexx{debugging information entry!ownership relation}
962 debugging information entry to \doublequote{own} an arbitrary number
963 of other debugging entries and by permitting the same debugging
964 information entry to be one of many owned by another debugging
966 This makes it possible, for example, to
967 describe the static \livelink{chap:lexicalblock}{block} structure
968 within a source file,
969 to show the members of a structure, union, or class, and to
970 associate declarations with source files or source files
971 with shared object files.
975 The ownership relationship
976 \addtoindexx{debugging information entry!ownership relation}
978 information entries is achieved naturally because the debugging
979 information is represented as a tree. The nodes of the tree
980 are the debugging information entries themselves.
981 The child entries of any node are exactly those debugging information
982 entries owned by that node.
985 While the ownership relation
986 of the debugging information entries is represented as a
987 tree, other relations among the entries exist, for example,
988 a reference from an entry representing a variable to another
989 entry representing the type of that variable.
991 relations are taken into account, the debugging entries
992 form a graph, not a tree.
996 The tree itself is represented
997 by flattening it in prefix order.
998 Each debugging information
999 entry is defined either to have child entries or not to have
1000 child entries (see Section \refersec{datarep:abbreviationstables}).
1001 If an entry is defined not
1002 to have children, the next physically succeeding entry is a
1004 If an entry is defined to have children, the next
1005 physically succeeding entry is its first child.
1007 children are represented as siblings of the first child.
1008 A chain of sibling entries is terminated by a null entry.
1010 In cases where a producer of debugging information feels that
1011 it\hypertarget{chap:DWATsiblingdebugginginformationentryrelationship}{}
1012 will be important for consumers of that information to
1013 quickly scan chains of sibling entries, while ignoring the
1014 children of individual siblings, that producer may attach a
1015 \addtoindexx{sibling attribute}
1016 \DWATsiblingDEFN{} attribute
1017 to any debugging information entry.
1018 The value of this attribute is a reference to the sibling entry
1019 of the entry to which the attribute is attached.
1021 \section{Target Addresses}
1022 \label{chap:targetaddressableunitsandaddresses}
1023 \label{chap:targetaddresses}
1024 \addtoindexx{size of an address}
1025 \addtoindexx{size of an address|see{\textit{also} \texttt{address\_size}}}
1026 \addtoindexx{address size|see{size of an address}}
1027 \addtoindexx{address size|see{\textit{also} \texttt{address\_size}}}
1029 Addresses, bytes and bits in DWARF use the numbering and direction
1030 conventions that are appropriate to the current language on
1033 Many places in this document refer to the size of an address
1034 on the target architecture (or equivalently, target machine)
1035 to which a DWARF description applies. For processors which
1036 can be configured to have different address sizes or different
1037 instruction sets, the intent is to refer to the configuration
1038 which is either the default for that processor or which is
1039 specified by the object file or executable file which contains
1040 the DWARF information.
1043 For example, if a particular target architecture supports
1044 both 32-bit and 64-bit addresses, the compiler will generate
1045 an object file which specifies that it contains executable
1046 code generated for one or the other of these
1047 \addtoindexx{size of an address}
1049 that case, the DWARF debugging information contained in this
1050 object file will use the same address size.}
1053 \section{DWARF Expressions}
1054 \label{chap:dwarfexpressions}
1055 DWARF expressions describe how to compute a value or
1056 specify a location. They are expressed in
1057 terms of DWARF operations that operate on a stack of values.
1059 A DWARF expression is encoded as a stream of operations,
1060 each consisting of an opcode followed by zero or more literal
1061 operands. The number of operands is implied by the opcode.
1064 general operations that are defined here, operations that are
1065 specific to location descriptions are defined in
1066 Section \refersec{chap:locationdescriptions}.
1068 \subsection{General Operations}
1069 \label{chap:generaloperations}
1070 Each general operation represents a postfix operation on
1071 a simple stack machine.
1072 Each element of the stack has a type and a value, and can represent
1073 a value of any supported base type of the target machine. Instead of
1074 a base type, elements can have a
1075 \definitionx{generic type}\livetarg{chap:generictype}{},
1076 which is an integral type that has the
1077 \addtoindex{size of an address} on the target machine and
1078 unspecified signedness. The value on the top of the stack after
1079 \doublequote{executing} the
1080 \addtoindex{DWARF expression}
1082 \addtoindexx{DWARF expression|see{\textit{also} location description}}
1083 taken to be the result (the address of the object, the
1084 value of the array bound, the length of a dynamic string,
1085 the desired value itself, and so on).
1088 \generictype{} is the same as the unspecified type used for stack operations
1089 defined in \DWARFVersionIV{} and before.
1093 \subsubsection{Literal Encodings}
1094 \label{chap:literalencodings}
1096 \addtoindexx{DWARF expression!literal encodings}
1097 following operations all push a value onto the DWARF
1099 \addtoindexx{DWARF expression!stack operations}
1100 Operations other than \DWOPconsttype{} push a value with the
1101 \generictype, and if the value of a constant in one of these
1102 operations is larger than can be stored in a single stack element,
1103 the value is truncated to the element size and the low-order bits
1104 are pushed on the stack.
1105 \begin{enumerate}[1. ]
1106 \itembfnl{\DWOPlitzeroTARG, \DWOPlitoneTARG, \dots, \DWOPlitthirtyoneTARG}
1107 The \DWOPlitnTARG{} operations encode the unsigned literal values
1108 from 0 through 31, inclusive.
1110 \itembfnl{\DWOPaddrTARG}
1111 The \DWOPaddrNAME{} operation has a single operand that encodes
1112 a machine address and whose size is the \addtoindex{size of an address}
1113 on the target machine.
1115 \itembfnl{\DWOPconstoneuTARG, \DWOPconsttwouTARG, \DWOPconstfouruTARG, \DWOPconsteightuTARG}
1117 The single operand of a \DWOPconstnuNAME{} operation provides a 1,
1118 2, 4, or 8-byte unsigned integer constant, respectively.
1120 \itembfnl{\DWOPconstonesTARG, \DWOPconsttwosTARG, \DWOPconstfoursTARG, \DWOPconsteightsTARG}
1121 The single operand of a \DWOPconstnsNAME{} operation provides a 1,
1122 2, 4, or 8-byte signed integer constant, respectively.
1125 \itembfnl{\DWOPconstuTARG}
1126 The single operand of the \DWOPconstuNAME{} operation provides
1127 an unsigned LEB128\addtoindexx{LEB128!unsigned} integer constant.
1129 \itembfnl{\DWOPconstsTARG}
1130 The single operand of the \DWOPconstsNAME{} operation provides
1131 a signed LEB128\addtoindexx{LEB128!unsigned} integer constant.
1134 \itembfnl{\DWOPaddrxTARG}
1135 The \DWOPaddrxNAME{} operation has a single operand that
1136 encodes an unsigned LEB128\addtoindexx{LEB128!unsigned} value,
1137 which is a zero-based index into the \dotdebugaddr{} section,
1138 where a machine address is stored.
1139 This index is relative to the value of the
1140 \DWATaddrbase{} attribute of the associated compilation unit.
1142 \itembfnl{\DWOPconstxTARG}
1143 The \DWOPconstxNAME{} operation has a single operand that
1144 encodes an unsigned LEB128\addtoindexx{LEB128!unsigned} value,
1145 which is a zero-based
1146 index into the \dotdebugaddr{} section, where a constant, the
1147 size of a machine address, is stored.
1148 This index is relative to the value of the
1149 \DWATaddrbase{} attribute of the associated compilation unit.
1152 \textit{The \DWOPconstxNAME{} operation is provided for constants that
1153 require link-time relocation but should not be
1154 interpreted by the consumer as a relocatable address
1155 (for example, offsets to thread-local storage).}
1158 \itembfnl{\DWOPconsttypeTARG}
1159 The \DWOPconsttypeNAME{} operation takes three operands. The first operand
1160 is an unsigned LEB128 integer that represents the offset of a debugging
1161 information entry in the current compilation unit, which must be a
1162 \DWTAGbasetype{} entry that provides the type of the constant provided. The
1163 second operand is 1-byte unsigned integer that specifies the size of the
1164 constant value, which is the same as the size of the base type referenced
1165 by the first operand. The third operand is a
1166 sequence of bytes of the given size that is
1167 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 \generictype.
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.
1196 \textit{This is typically a stack pointer register plus or minus some offset.}
1198 \itembfnl{\DWOPbregzeroTARG, \DWOPbregoneTARG, \dots, \DWOPbregthirtyoneTARG}
1199 The single operand of the \DWOPbregnTARG{}
1201 a signed LEB128\addtoindexx{LEB128!signed} offset from
1202 the contents of the specified register.
1204 \itembfnl{\DWOPbregxTARG}
1205 The \DWOPbregxNAME{} operation provides the sum of two values specified
1206 by its two operands. The first operand is a register number
1207 which is specified by an unsigned LEB128\addtoindexx{LEB128!unsigned}
1208 number. The second operand is a signed LEB128\addtoindexx{LEB128!signed} offset.
1211 \itembfnl{\DWOPregvaltypeTARG}
1212 The \DWOPregvaltypeNAME{} operation provides the contents of
1213 a given register interpreted as a value of a given type. The first
1214 operand is an unsigned LEB128\addtoindexx{LEB128!unsigned} number,
1215 which identifies a register whose contents is to
1216 be pushed onto the stack. The second operand is an
1217 unsigned LEB128\addtoindexx{LEB128!unsigned} number
1218 that represents the offset of a debugging information entry in the current
1219 compilation unit, which must be a \DWTAGbasetype{} entry that provides the
1220 type of the value contained in the specified register.
1225 \subsubsection{Stack Operations}
1226 \label{chap:stackoperations}
1228 \addtoindexx{DWARF expression!stack operations}
1229 operations manipulate the DWARF stack. Operations
1230 that index the stack assume that the top of the stack (most
1231 recently added entry) has index 0.
1233 Each entry on the stack has an associated type.
1236 \begin{enumerate}[1. ]
1237 \itembfnl{\DWOPdupTARG}
1238 The \DWOPdupNAME{} operation duplicates the value (including its
1239 type identifier) at the top of the stack.
1241 \itembfnl{\DWOPdropTARG}
1242 The \DWOPdropNAME{} operation pops the value (including its type
1243 identifier) at the top of the stack.
1245 \itembfnl{\DWOPpickTARG}
1246 The single operand of the \DWOPpickNAME{} operation provides a
1247 1-byte index. A copy of the stack entry (including its
1248 type identifier) with the specified
1249 index (0 through 255, inclusive) is pushed onto the stack.
1251 \itembfnl{\DWOPoverTARG}
1252 The \DWOPoverNAME{} operation duplicates the entry currently second
1253 in the stack at the top of the stack.
1254 This is equivalent to a
1255 \DWOPpick{} operation, with index 1.
1258 \itembfnl{\DWOPswapTARG}
1259 The \DWOPswapNAME{} operation swaps the top two stack entries.
1260 The entry at the top of the stack (including its type identifier)
1261 becomes the second stack entry, and the second entry (including
1262 its type identifier) becomes the top of the stack.
1264 \itembfnl{\DWOProtTARG}
1265 The \DWOProtNAME{} operation rotates the first three stack
1266 entries. The entry at the top of the stack (including its
1267 type identifier) becomes the third stack entry, the second
1268 entry (including its type identifier) becomes the top of
1269 the stack, and the third entry (including its type identifier)
1270 becomes the second entry.
1272 \itembfnl{\DWOPderefTARG}
1273 The \DWOPderefNAME{} operation pops the top stack entry and
1274 treats it as an address. The popped value must have an integral type.
1275 The value retrieved from that address is pushed,
1276 and has the \generictype{}.
1277 The size of the data retrieved from the
1278 \addtoindexi{dereferenced}{address!dereference operator}
1279 address is the \addtoindex{size of an address} on the target machine.
1282 \itembfnl{\DWOPderefsizeTARG}
1283 The \DWOPderefsizeNAME{} operation behaves like the
1285 operation: it pops the top stack entry and treats it as an
1286 address. The popped value must have an integral type.
1287 The value retrieved from that address is pushed,
1288 and has the \generictype{}.
1289 In the \DWOPderefsizeNAME{} operation, however, the size in bytes
1290 of the data retrieved from the dereferenced address is
1291 specified by the single operand. This operand is a 1-byte
1292 unsigned integral constant whose value may not be larger
1293 than the size of the \generictype. The data
1294 retrieved is zero extended to the size of an address on the
1295 target machine before being pushed onto the expression stack.
1297 \itembfnl{\DWOPdereftypeTARG}
1298 The \DWOPdereftypeNAME{} operation behaves like the \DWOPderefsize{} operation:
1299 it pops the top stack entry and treats it as an address.
1300 The popped value must have an integral type.
1301 The value retrieved from that address is pushed together with a type identifier.
1302 In the \DWOPdereftypeNAME{} operation, the size in
1303 bytes of the data retrieved from the dereferenced address is specified by
1304 the first operand. This operand is a 1-byte unsigned integral constant whose
1305 value which is the same as the size of the base type referenced
1306 by the second operand.
1307 The second operand is an unsigned LEB128 integer that
1308 represents the offset of a debugging information entry in the current
1309 compilation unit, which must be a \DWTAGbasetype{} entry that provides the
1310 type of the data pushed.
1312 \textit{While the size of the pushed value could be inferred from the base
1313 type definition, it is encoded explicitly into the operation so that the
1314 operation can be parsed easily without reference to the \dotdebuginfo{}
1318 \itembfnl{\DWOPxderefTARG}
1319 The \DWOPxderefNAME{} operation provides an extended dereference
1320 mechanism. The entry at the top of the stack is treated as an
1321 address. The second stack entry is treated as an \doublequote{address
1322 space identifier} for those architectures that support
1323 \addtoindexi{multiple}{address space!multiple}
1325 Both of these entries must have integral type identifiers.
1326 The top two stack elements are popped,
1327 and a data item is retrieved through an implementation-defined
1328 address calculation and pushed as the new stack top together with the
1329 \generictype{} identifier.
1330 The size of the data retrieved from the
1331 \addtoindexi{dereferenced}{address!dereference operator}
1332 address is the size of the \generictype.
1335 \itembfnl{\DWOPxderefsizeTARG}
1336 The \DWOPxderefsizeNAME{} operation behaves like the
1337 \DWOPxderef{} operation. The entry at the top of the stack is
1338 treated as an address. The second stack entry is treated as
1339 an \doublequote{address space identifier} for those architectures
1341 \addtoindexi{multiple}{address space!multiple}
1343 Both of these entries must have integral type identifiers.
1345 elements are popped, and a data item is retrieved through an
1346 implementation\dash defined address calculation and pushed as the
1347 new stack top. In the \DWOPxderefsizeNAME{} operation, however,
1348 the size in bytes of the data retrieved from the
1349 \addtoindexi{dereferenced}{address!dereference operator}
1350 address is specified by the single operand. This operand is a
1351 1-byte unsigned integral constant whose value may not be larger
1352 than the \addtoindex{size of an address} on the target machine. The data
1353 retrieved is zero extended to the \addtoindex{size of an address} on the
1354 target machine before being pushed onto the expression stack together
1355 with the \generictype{} identifier.
1357 \itembfnl{\DWOPxdereftypeTARG}
1358 The \DWOPxdereftypeNAME{} operation behaves like the \DWOPxderefsize{}
1359 operation: it pops the top two stack entries, treats them as an address and
1360 an address space identifier, and pushes the value retrieved. In the
1361 \DWOPxdereftypeNAME{} operation, the size in bytes of the data retrieved from
1362 the dereferenced address is specified by the first operand. This operand is
1363 a 1-byte unsigned integral constant whose value
1364 value which is the same as the size of the base type referenced
1365 by the second operand. The second
1366 operand is an unsigned LEB128 integer that represents the offset of a
1367 debugging information entry in the current compilation unit, which must be a
1368 \DWTAGbasetype{} entry that provides the type of the data pushed.
1371 \itembfnl{\DWOPpushobjectaddressTARG}
1372 The \DWOPpushobjectaddressNAME{}
1373 operation pushes the address
1374 of the object currently being evaluated as part of evaluation
1375 of a user presented expression. This object may correspond
1376 to an independent variable described by its own debugging
1377 information entry or it may be a component of an array,
1378 structure, or class whose address has been dynamically
1379 determined by an earlier step during user expression
1382 \textit{This operator provides explicit functionality
1383 (especially for arrays involving descriptors) that is analogous
1384 to the implicit push of the base
1385 \addtoindexi{address}{address!implicit push of base}
1386 of a structure prior to evaluation of a
1387 \DWATdatamemberlocation{}
1388 to access a data member of a structure. For an example, see
1389 Appendix \refersec{app:aggregateexamples}.}
1392 \itembfnl{\DWOPformtlsaddressTARG}
1393 The \DWOPformtlsaddressNAME{}
1394 operation pops a value from the stack, which must have an
1395 integral type identifier, translates this
1396 value into an address in the
1397 \addtoindex{thread-local storage}
1398 for a thread, and pushes the address
1399 onto the stack together with the \generictype{} identifier.
1400 The meaning of the value on the top of the stack prior to this
1401 operation is defined by the run-time environment. If the run-time
1402 environment supports multiple thread-local storage
1403 \nolink{blocks} for a single thread, then the \nolink{block}
1404 corresponding to the executable or shared
1405 library containing this DWARF expression is used.
1407 \textit{Some implementations of
1408 \addtoindex{C}, \addtoindex{C++}, \addtoindex{Fortran}, and other
1409 languages, support a
1410 thread-local storage class. Variables with this storage class
1411 have distinct values and addresses in distinct threads, much
1412 as automatic variables have distinct values and addresses in
1413 each function invocation. Typically, there is a single \nolink{block}
1414 of storage containing all thread\dash local variables declared in
1415 the main executable, and a separate \nolink{block} for the variables
1416 declared in each shared library. Each
1417 thread\dash local variable can then be accessed in its block using an
1418 identifier. This identifier is typically an offset into the block and
1419 pushed onto the DWARF stack by one of the
1420 \DWOPconstnx{} operations prior to the
1421 \DWOPformtlsaddress{} operation.
1422 Computing the address of
1423 the appropriate \nolink{block} can be complex (in some cases, the
1424 compiler emits a function call to do it), and difficult
1425 to describe using ordinary DWARF location descriptions.
1426 Instead of forcing complex thread-local storage calculations into
1427 the DWARF expressions, the \DWOPformtlsaddress{} allows the consumer
1428 to perform the computation based on the run-time environment.}
1431 \itembfnl{\DWOPcallframecfaTARG}
1432 The \DWOPcallframecfaNAME{}
1433 operation pushes the value of the
1434 CFA, obtained from the Call Frame Information
1435 (see Section \refersec{chap:callframeinformation}).
1437 \textit{Although the value of \DWATframebase{}
1438 can be computed using other DWARF expression operators,
1439 in some cases this would require an extensive location list
1440 because the values of the registers used in computing the
1441 CFA change during a subroutine. If the
1442 Call Frame Information
1443 is present, then it already encodes such changes, and it is
1444 space efficient to reference that.}
1447 \textit{Examples illustrating many of these stack operations are
1448 found in Appendix \refersec{app:dwarfstackoperationexamples}.}
1451 \subsubsection{Arithmetic and Logical Operations}
1452 \addtoindexx{DWARF expression!arithmetic operations}
1453 \addtoindexx{DWARF expression!logical operations}
1454 The following provide arithmetic and logical operations.
1455 Operands of an operation with two operands
1456 must have the same type,
1457 either the same base type or the \generictype.
1458 The result of the operation which is pushed back has the same type
1459 as the type of the operand(s).
1461 If the type of the operands is the \generictype,
1462 except as otherwise specified, the arithmetic operations
1463 perform addressing arithmetic, that is, unsigned arithmetic that is performed
1464 modulo one plus the largest representable address.
1466 Operations other than \DWOPabs{},
1467 \DWOPdiv{}, \DWOPminus{}, \DWOPmul{}, \DWOPneg{} and \DWOPplus{}
1468 require integral types of the operand (either integral base type
1469 or the \generictype). Operations do not cause an exception
1473 \begin{enumerate}[1. ]
1474 \itembfnl{\DWOPabsTARG}
1475 The \DWOPabsNAME{} operation pops the top stack entry, interprets
1476 it as a signed value and pushes its absolute value. If the
1477 absolute value cannot be represented, the result is undefined.
1480 \itembfnl{\DWOPandTARG}
1481 The \DWOPandNAME{} operation pops the top two stack values, performs
1482 a bitwise and operation on the two, and pushes the result.
1484 \itembfnl{\DWOPdivTARG}
1485 The \DWOPdivNAME{} operation pops the top two stack values, divides the former second entry by
1486 the former top of the stack using signed division, and pushes the result.
1488 \itembfnl{\DWOPminusTARG}
1489 The \DWOPminusNAME{} operation pops the top two stack values, subtracts the former top of the
1490 stack from the former second entry, and pushes the result.
1492 \itembfnl{\DWOPmodTARG}
1493 The \DWOPmodNAME{} operation pops the top two stack values and pushes the result of the
1494 calculation: former second stack entry modulo the former top of the stack.
1497 \itembfnl{\DWOPmulTARG}
1498 The \DWOPmulNAME{} operation pops the top two stack entries, multiplies them together, and
1502 \itembfnl{\DWOPnegTARG}
1503 The \DWOPnegNAME{} operation pops the top stack entry, interprets
1504 it as a signed value and pushes its negation. If the negation
1505 cannot be represented, the result is undefined.
1507 \itembfnl{\DWOPnotTARG}
1508 The \DWOPnotNAME{} operation pops the top stack entry, and pushes
1509 its bitwise complement.
1511 \itembfnl{\DWOPorTARG}
1512 The \DWOPorNAME{} operation pops the top two stack entries, performs
1513 a bitwise or operation on the two, and pushes the result.
1515 \itembfnl{\DWOPplusTARG}
1516 The \DWOPplusNAME{} operation pops the top two stack entries,
1517 adds them together, and pushes the result.
1520 \itembfnl{\DWOPplusuconstTARG}
1521 The \DWOPplusuconstNAME{} operation pops the top stack entry,
1522 adds it to the unsigned LEB128\addtoindexx{LEB128!unsigned}
1524 interpreted as the same type as the operand popped from the
1525 top of the stack and pushes the result.
1527 \textit{This operation is supplied specifically to be
1528 able to encode more field offsets in two bytes than can be
1530 \doublequote{\DWOPlitn~\DWOPplus.}}
1533 \itembfnl{\DWOPshlTARG}
1534 The \DWOPshlNAME{} operation pops the top two stack entries,
1535 shifts the former second entry left (filling with zero bits)
1536 by the number of bits specified by the former top of the stack,
1537 and pushes the result.
1539 \itembfnl{\DWOPshrTARG}
1540 The \DWOPshrNAME{} operation pops the top two stack entries,
1541 shifts the former second entry right logically (filling with
1542 zero bits) by the number of bits specified by the former top
1543 of the stack, and pushes the result.
1546 \itembfnl{\DWOPshraTARG}
1547 The \DWOPshraNAME{} operation pops the top two stack entries,
1548 shifts the former second entry right arithmetically (divide
1549 the magnitude by 2, keep the same sign for the result) by
1550 the number of bits specified by the former top of the stack,
1551 and pushes the result.
1553 \itembfnl{\DWOPxorTARG}
1554 The \DWOPxorNAME{} operation pops the top two stack entries,
1555 performs a bitwise exclusive\dash or operation on the two, and
1560 \subsubsection{Control Flow Operations}
1561 \label{chap:controlflowoperations}
1563 \addtoindexx{DWARF expression!control flow operations}
1564 following operations provide simple control of the flow of a DWARF expression.
1565 \begin{enumerate}[1. ]
1566 \itembfnl{\DWOPleTARG, \DWOPgeTARG, \DWOPeqTARG, \DWOPltTARG, \DWOPgtTARG, \DWOPneTARG}
1567 The six relational operators each:
1569 \item pop the top two stack values, which have the same type,
1570 either the same base type or the \generictype,
1572 \item compare the operands:
1574 \textless~former second entry~\textgreater \textless~relational operator~\textgreater \textless~former top entry~\textgreater
1576 \item push the constant value 1 onto the stack
1577 if the result of the operation is true or the
1578 constant value 0 if the result of the operation is false.
1579 The pushed value has the \generictype.
1582 If the operands have the \generictype, the comparisons
1583 are performed as signed operations.
1586 \itembfnl{\DWOPskipTARG}
1587 \DWOPskipNAME{} is an unconditional branch. Its single operand
1588 is a 2-byte signed integer constant. The 2-byte constant is
1589 the number of bytes of the DWARF expression to skip forward
1590 or backward from the current operation, beginning after the
1593 \itembfnl{\DWOPbraTARG}
1594 \DWOPbraNAME{} is a conditional branch. Its single operand is a
1595 2-byte signed integer constant. This operation pops the
1596 top of stack. If the value popped is not the constant 0,
1597 the 2-byte constant operand is the number of bytes of the
1598 DWARF expression to skip forward or backward from the current
1599 operation, beginning after the 2-byte constant.
1601 % The following item does not correctly hyphenate leading
1602 % to an overfull hbox and a visible artifact.
1603 % So we use \- to suggest hyphenation in this rare situation.
1604 \itembfnl{\DWOPcalltwoTARG, \DWOPcallfourTARG, \DWOPcallrefTARG}
1607 and \DWOPcallrefNAME{} perform
1608 DWARF procedure calls during evaluation of a DWARF expression or
1609 location description.
1610 For \DWOPcalltwoNAME{} and \DWOPcallfourNAME{},
1611 the operand is the 2\dash~ or 4-byte unsigned offset, respectively,
1612 of a debugging information entry in the current compilation
1613 unit. The \DWOPcallrefNAME{} operator has a single operand. In the
1614 \thirtytwobitdwarfformat,
1615 the operand is a 4-byte unsigned value;
1616 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1617 (see Section \referfol{datarep:32bitand64bitdwarfformats}).
1618 The operand is used as the offset of a
1619 debugging information entry in a
1621 section which may be contained in an executable or shared object file
1622 other than that containing the operator. For references from
1623 one executable or shared object file to another, the relocation
1624 must be performed by the consumer.
1626 \textit{Operand interpretation of
1627 \DWOPcalltwo, \DWOPcallfour{} and \DWOPcallref{} is exactly like
1628 that for \DWFORMreftwo, \DWFORMreffour{} and \DWFORMrefaddr,
1630 (see Section \refersec{datarep:attributeencodings}).}
1632 These operations transfer control of DWARF expression evaluation to
1633 \addtoindexx{location attribute}
1636 attribute of the referenced debugging information entry. If
1637 there is no such attribute, then there is no effect. Execution
1638 of the DWARF expression of
1639 \addtoindexx{location attribute}
1641 \DWATlocation{} attribute may add
1642 to and/or remove from values on the stack. Execution returns
1643 to the point following the call when the end of the attribute
1644 is reached. Values on the stack at the time of the call may be
1645 used as parameters by the called expression and values left on
1646 the stack by the called expression may be used as return values
1647 by prior agreement between the calling and called expressions.
1650 \subsubsection{Type Conversions}
1651 \label{chap:typeconversions}
1652 The following operations provides for explicit type conversion.
1654 \begin{enumerate}[1. ]
1655 \itembfnl{\DWOPconvertTARG}
1656 The \DWOPconvertNAME{} operation pops the top stack entry, converts it to a
1657 different type, then pushes the result. It takes one operand, which is an
1658 unsigned LEB128 integer that represents the offset of a debugging
1659 information entry in the current compilation unit, or value 0 which
1660 represents the \generictype. If the operand is non-zero, the
1661 referenced entry must be a \DWTAGbasetype{} entry that provides the type
1662 to which the value is converted.
1664 \itembfnl{\DWOPreinterpretTARG}
1665 The \DWOPreinterpretNAME{} operation pops the top stack entry, reinterprets
1666 the bits in its value as a value of a different type, then pushes the
1667 result. It takes one operand, which is an unsigned LEB128 integer that
1668 represents the offset of a debugging information entry in the current
1669 compilation unit, or value 0 which represents the \generictype.
1670 If the operand is non-zero, the referenced entry must be a
1671 \DWTAGbasetype{} entry that provides the type to which the value is converted.
1672 The type of the operand and result type must have the same size in bits.
1677 \subsubsection{Special Operations}
1678 \label{chap:specialoperations}
1680 \addtoindexx{DWARF expression!special operations}
1681 are these special operations currently defined:
1682 \begin{enumerate}[1. ]
1683 \itembfnl{\DWOPnopTARG}
1684 The \DWOPnopNAME{} operation is a place holder. It has no effect
1685 on the location stack or any of its values.
1687 \itembfnl{\DWOPentryvalueTARG}
1688 The \DWOPentryvalueNAME{} operation pushes
1689 the value that the described location held
1690 upon entering the current subprogram. It has two operands: an
1691 unsigned LEB128\addtoindexx{LEB128!unsigned} length, followed by
1692 a block containing a DWARF expression or a register location description
1693 (see Section \refersec{chap:registerlocationdescriptions}).
1694 The length operand specifies the length in bytes of the block.
1696 If the block contains a DWARF expression,
1697 the DWARF expression is evaluated as if it had been evaluated upon entering
1698 the current subprogram. The DWARF expression
1699 assumes no values are present on the DWARF stack initially and results
1700 in exactly one value being pushed on the DWARF stack when completed.
1701 If the block contains a register location
1702 description, \DWOPentryvalueNAME{} pushes the value that register had upon
1703 entering the current subprogram.
1706 \DWOPpushobjectaddress{} is not meaningful inside of this DWARF operation.
1709 The register location description provides a more compact form for the
1710 case where the value was in a register on entry to the subprogram.
1713 \textit{The values needed to evaluate \DWOPentryvalueNAME{} could be obtained in
1714 several ways. The consumer could suspend execution on entry to the
1715 subprogram, record values needed by \DWOPentryvalueNAME{} expressions within
1716 the subprogram, and then continue; when evaluating \DWOPentryvalueNAME{},
1717 the consumer would use these recorded values rather than the current
1718 values. Or, when evaluating \DWOPentryvalueNAME{}, the consumer could
1719 virtually unwind using the Call Frame Information
1720 (see Section \refersec{chap:callframeinformation})
1721 to recover register values that might have been clobbered since the
1722 subprogram entry point.}
1727 \section{Location Descriptions}
1728 \label{chap:locationdescriptions}
1729 \textit{Debugging information
1730 \addtoindexx{location description}
1732 \addtoindexx{location description|see{\textit{also} DWARF expression}}
1733 provide consumers a way to find
1734 the location of program variables, determine the bounds
1735 of dynamic arrays and strings, and possibly to find the
1736 base address of a subroutine\textquoteright s stack frame or the return
1737 address of a subroutine. Furthermore, to meet the needs of
1738 recent computer architectures and optimization techniques,
1739 debugging information must be able to describe the location of
1740 an object whose location changes over the object\textquoteright s lifetime.}
1742 Information about the location of program objects is provided
1743 by location descriptions. Location descriptions can be either
1745 \begin{enumerate}[1. ]
1746 \item \textit{Single location descriptions},
1748 \addtoindexx{location description!single}
1750 \addtoindexx{single location description}
1751 a language independent representation of
1752 addressing rules of arbitrary complexity built from
1753 DWARF expressions (See Section \refersec{chap:dwarfexpressions})
1755 DWARF operations specific to describing locations. They are
1756 sufficient for describing the location of any object as long
1757 as its lifetime is either static or the same as the
1758 \livelink{chap:lexicalblock}{lexical block} that owns it,
1759 and it does not move during its lifetime.
1763 \item \textit{Location lists}, which are used to
1764 \addtoindexx{location list}
1766 \addtoindexx{location description!use in location list}
1767 objects that have a limited lifetime or change their location
1768 during their lifetime. Location lists are described in
1769 Section \refersec{chap:locationlists} below.
1773 Location descriptions are distinguished in a context sensitive
1774 manner. As the value of an attribute, a location description
1775 is encoded using class \CLASSexprloc{}
1776 and a \addtoindex{location list} is encoded
1777 using class \CLASSloclist{} (which serves as an
1778 index into a separate section containing location lists).
1781 \subsection{Single Location Descriptions}
1782 \label{chap:singlelocationdescriptions}
1783 A single location description is either:
1784 \begin{enumerate}[1. ]
1785 \item A simple location description, representing an object
1786 \addtoindexx{location description!simple}
1788 \addtoindexx{simple location description}
1789 exists in one contiguous piece at the given location, or
1790 \item A composite location description consisting of one or more
1791 \addtoindexx{location description!composite}
1792 simple location descriptions, each of which is followed by
1793 one composition operation. Each simple location description
1794 describes the location of one piece of the object; each
1795 composition operation describes which part of the object is
1796 located there. Each simple location description that is a
1797 DWARF expression is evaluated independently of any others.
1802 \subsubsection{Simple Location Descriptions}
1804 \addtoindexx{location description!simple}
1805 simple location description consists of one
1806 contiguous piece or all of an object or value.
1809 \subsubsubsection{Empty Location Descriptions}
1810 An \addtoindex{empty location description}
1811 consists of a DWARF expression
1812 \addtoindexx{location description!empty}
1813 containing no operations. It represents a piece or all of an
1814 object that is present in the source but not in the object code
1815 (perhaps due to optimization).
1817 \subsubsubsection{Memory Location Descriptions}
1819 \addtoindexx{location description!memory}
1820 memory location description
1821 \addtoindexx{memory location description}
1822 consists of a non-empty DWARF
1824 Section \refersec{chap:dwarfexpressions}),
1825 whose value is the address of
1826 a piece or all of an object or other entity in memory.
1828 \subsubsubsection{Register Location Descriptions}
1829 \label{chap:registerlocationdescriptions}
1830 A register location description consists of a register name
1831 operation, which represents a piece or all of an object
1832 located in a given register.
1834 \textit{Register location descriptions describe an object
1835 (or a piece of an object) that resides in a register, while
1836 the opcodes listed in
1837 Section \refersec{chap:registervalues}
1838 are used to describe an object (or a piece of
1839 an object) that is located in memory at an address that is
1840 contained in a register (possibly offset by some constant). A
1841 register location description must stand alone as the entire
1842 description of an object or a piece of an object.
1846 The following DWARF operations can be used to
1847 specify a register location.
1849 \textit{Note that the register number represents a DWARF specific
1850 mapping of numbers onto the actual registers of a given
1851 architecture. The mapping should be chosen to gain optimal
1852 density and should be shared by all users of a given
1853 architecture. It is recommended that this mapping be defined
1854 by the ABI authoring committee for each architecture.
1856 \begin{enumerate}[1. ]
1857 \itembfnl{\DWOPregzeroTARG, \DWOPregoneTARG, ..., \DWOPregthirtyoneTARG}
1858 The \DWOPregnTARG{} operations encode the names of up to 32
1859 registers, numbered from 0 through 31, inclusive. The object
1860 addressed is in register \textit{n}.
1863 \itembfnl{\DWOPregxTARG}
1864 The \DWOPregxNAME{} operation has a single
1865 unsigned LEB128\addtoindexx{LEB128!unsigned} literal
1866 operand that encodes the name of a register.
1870 \textit{These operations name a register location. To
1871 fetch the contents of a register, it is necessary to use
1872 one of the register based addressing operations, such as
1874 (Section \refersec{chap:registervalues})}.
1876 \subsubsubsection{Implicit Location Descriptions}
1877 An \addtoindex{implicit location description}
1878 represents a piece or all
1879 \addtoindexx{location description!implicit}
1880 of an object which has no actual location but whose contents
1881 are nonetheless either known or known to be undefined.
1883 The following DWARF operations may be used to specify a value
1884 that has no location in the program but is a known constant
1885 or is computed from other locations and values in the program.
1886 \begin{enumerate}[1. ]
1887 \itembfnl{\DWOPimplicitvalueTARG}
1888 The \DWOPimplicitvalueNAME{} operation specifies an immediate value
1889 using two operands: an unsigned LEB128\addtoindexx{LEB128!unsigned}
1890 length, followed by a
1891 sequence of bytes of the given length that contain the value.
1893 \itembfnl{\DWOPstackvalueTARG}
1894 The \DWOPstackvalueNAME{}
1895 operation specifies that the object
1896 does not exist in memory but its value is nonetheless known
1897 and is at the top of the DWARF expression stack. In this form
1898 of location description, the DWARF expression represents the
1899 actual value of the object, rather than its location. The
1900 \DWOPstackvalueNAME{} operation terminates the expression.
1903 \itembfnl{\DWOPimplicitpointerTARG}
1904 \textit{An optimizing compiler may eliminate a pointer, while
1905 still retaining the value that the pointer addressed.
1906 \DWOPimplicitpointerNAME{} allows a producer to describe this value.}
1908 The \DWOPimplicitpointerNAME{} operation specifies that the object
1909 is a pointer that cannot be represented as a real pointer,
1910 even though the value it would point to can be described. In
1911 this form of location description, the DWARF expression refers
1912 to a debugging information entry that represents the actual
1913 value of the object to which the pointer would point. Thus, a
1914 consumer of the debug information would be able to show the
1915 value of the dereferenced pointer, even when it cannot show
1916 the value of the pointer itself.
1919 The \DWOPimplicitpointerNAME{} operation has two operands: a
1920 reference to a debugging information entry that describes
1921 the dereferenced object's value, and a signed number that
1922 is treated as a byte offset from the start of that value.
1923 The first operand is a 4-byte unsigned value in the 32-bit
1924 DWARF format, or an 8-byte unsigned value in the 64-bit
1925 DWARF format (see Section
1926 \refersec{datarep:32bitand64bitdwarfformats}).
1927 The second operand is a
1928 signed LEB128\addtoindexx{LEB128!signed} number.
1930 The first operand is used as the offset of a debugging
1931 information entry in a \dotdebuginfo{} section, which may be
1932 contained in an executable or shared object file other than that
1933 containing the operator. For references from one executable or
1934 shared object file to another, the relocation must be performed
1937 \textit{The debugging information entry referenced by a
1938 \DWOPimplicitpointerNAME{} operation is typically a
1939 \DWTAGvariable{} or \DWTAGformalparameter{} entry whose
1940 \DWATlocation{} attribute gives a second DWARF expression or a
1941 location list that describes the value of the object, but the
1942 referenced entry may be any entry that contains a \DWATlocation{}
1943 or \DWATconstvalue{} attribute (for example, \DWTAGdwarfprocedure).
1944 By using the second DWARF expression, a consumer can
1945 reconstruct the value of the object when asked to dereference
1946 the pointer described by the original DWARF expression
1947 containing the \DWOPimplicitpointer{} operation.}
1951 \textit{DWARF location descriptions
1952 are intended to yield the \textbf{location}
1953 of a value rather than the value itself. An optimizing compiler
1954 may perform a number of code transformations where it becomes
1955 impossible to give a location for a value, but it remains possible
1956 to describe the value itself.
1957 Section \refersec{chap:registerlocationdescriptions}
1958 describes operators that can be used to
1959 describe the location of a value when that value exists in a
1960 register but not in memory. The operations in this section are
1961 used to describe values that exist neither in memory nor in a
1966 \subsubsection{Composite Location Descriptions}
1967 A composite location description describes an object or
1968 value which may be contained in part of a register or stored
1969 in more than one location. Each piece is described by a
1970 composition operation, which does not compute a value nor
1971 store any result on the DWARF stack. There may be one or
1972 more composition operations in a single composite location
1973 description. A series of such operations describes the parts
1974 of a value in memory address order.
1976 Each composition operation is immediately preceded by a simple
1977 location description which describes the location where part
1978 of the resultant value is contained.
1979 \begin{enumerate}[1. ]
1980 \itembfnl{\DWOPpieceTARG}
1981 The \DWOPpieceNAME{} operation takes a
1982 single operand, which is an
1983 unsigned LEB128\addtoindexx{LEB128!unsigned} number.
1984 The number describes the size in bytes
1985 of the piece of the object referenced by the preceding simple
1986 location description. If the piece is located in a register,
1987 but does not occupy the entire register, the placement of
1988 the piece within that register is defined by the ABI.
1990 \textit{Many compilers store a single variable in sets of registers,
1991 or store a variable partially in memory and partially in
1992 registers. \DWOPpieceNAME{} provides a way of describing how large
1993 a part of a variable a particular DWARF location description
1997 \itembfnl{\DWOPbitpieceTARG}
1998 The \DWOPbitpieceNAME{} operation takes two operands.
1999 The first is an unsigned LEB128\addtoindexx{LEB128!unsigned}
2000 number that gives the size in bits
2001 of the piece. The second is an
2002 unsigned LEB128\addtoindexx{LEB128!unsigned} number that
2003 gives the offset in bits from the location defined by the
2004 preceding DWARF location description.
2006 Interpretation of the offset depends on the location description.
2007 If the location description is empty, the offset
2008 doesn\textquoteright{}t matter and
2009 the \DWOPbitpieceNAME{} operation describes a piece consisting
2010 of the given number of bits whose values are undefined. If
2011 the location is a register, the offset is from the least
2012 significant bit end of the register. If the location is a
2013 memory address, the \DWOPbitpieceNAME{} operation describes a
2014 sequence of bits relative to the location whose address is
2015 on the top of the DWARF stack using the bit numbering and
2016 direction conventions that are appropriate to the current
2017 language on the target system. If the location is any implicit
2018 value or stack value, the \DWOPbitpieceNAME{} operation describes
2019 a sequence of bits using the least significant bits of that
2023 \textit{\DWOPbitpieceNAME{} is
2024 used instead of \DWOPpieceNAME{} when
2025 the piece to be assembled into a value or assigned to is not
2026 byte-sized or is not at the start of a register or addressable
2030 \subsection{Location Lists}
2031 \label{chap:locationlists}
2032 Location lists are used in place of location descriptions whenever
2033 the object whose location is being described can change location
2034 during its lifetime. Location lists are contained in a separate
2035 object file section called \dotdebugloclists{} or \dotdebugloclistsdwo{}
2036 (for split DWARF object files).
2038 A location list is indicated by a location or other attribute
2039 whose value is of class \CLASSloclist{}
2040 (see Section \refersec{datarep:classesandforms}).
2042 \textit{This location list representation, the \CLASSloclist{} class, and the
2043 related \DWATloclistsbase{} attribute are new in \DWARFVersionV.
2044 Together they eliminate most or all of the object language relocations
2045 previously needed for location lists.}
2047 A location list consists of a series of location list entries.
2048 Each location list entry is one of the following kinds:
2050 \item \definition{Bounded location description}.\addtoindexx{bounded location description}
2051 This kind of entry provides a
2052 location description that specifies the location of
2053 an object that is valid over a lifetime bounded
2054 by a starting and ending address. The starting address is the
2055 lowest address of the address range over which the location
2056 is valid. The ending address is the address of the first
2057 location past the highest address of the address range.
2058 When the current PC is within the given range, the location
2059 description may be used to locate the specified object.
2061 There are several kinds of bounded location description
2062 entries which differ in the way that they specify the
2063 starting and ending addresses.
2065 The address ranges defined by the bounded location descriptions
2066 of a location list may overlap. When they do, they describe a
2067 situation in which an object exists simultaneously in more than
2068 one place. If all of the address ranges in a given location
2069 list do not collectively cover the entire range over which the
2070 object in question is defined, and there is no following default
2071 location description, it is assumed that the object is not
2072 available for the portion of the range that is not covered.
2074 \item \definition{Default location description}.\addtoindexx{default location description}
2075 This kind of entry provides a
2076 location description that specifies the location of
2077 an object that is valid when no bounded location description
2081 \item \definition{Base address}.\addtoindexx{base address!of location list}
2082 This kind of entry provides an address to be
2083 used as the base address for beginning and ending address
2084 offsets given in certain kinds of bounded location description.
2085 The applicable base address of a bounded location description
2086 entry is the address specified by the closest preceding base
2087 address entry in the same location list. If there is no
2088 preceding base address entry, then the applicable base address
2089 defaults to the base address of the compilation unit (see
2090 Section \refersec{chap:fullandpartialcompilationunitentries}).
2092 In the case of a compilation unit where all of the machine
2093 code is contained in a single contiguous section, no base
2094 address entry is needed.
2096 \item \definition{End-of-list}.\addtoindexx{end-of-list!of location list}
2097 This kind of entry marks the end of the location list.
2101 A location list consists of a sequence of zero or more bounded
2102 location description or base address entries, optionally followed
2103 by a default location entry, and terminated by an end-of-list
2106 Each location list entry begins with a single byte identifying
2107 the kind of that entry, followed by zero or more operands depending
2110 In the descriptions that follow, these terms are used for operands:
2113 \item A \definitionx{counted location description} operand consists of
2117 integer giving the length of the location
2118 description (see Section \refersec{chap:singlelocationdescriptions})
2119 that immediately follows.
2122 \item An \definitionx{address index} operand is the index of an address
2123 in the \dotdebugaddr{} section. This index is relative to the
2124 value of the \DWATaddrbase{} attribute of the associated
2125 compilation unit. The address given by this kind
2126 of operand is not relative to the compilation unit base address.
2128 \item A \definition{target address} operand is an address on the target
2129 machine. (Its size is the same as used for attribute values of
2130 class \CLASSaddress, specifically, \DWFORMaddr.)
2134 The following entry kinds are defined for use in both
2135 split or non-split units:
2137 \begin{enumerate}[1. ]
2138 \itembfnl{\DWLLEendoflistTARG}
2139 An end-of-list entry contains no further data.
2141 \textit{A series of this kind of entry may be used for padding or
2142 alignment purposes.}
2144 \itembfnl{\DWLLEbaseaddressxTARG}
2145 This is a form of base address entry that has one unsigned
2146 LEB128 operand. The operand value is an address index (into the
2147 \dotdebugaddr{} section) that indicates the applicable base address
2148 used by subsequent \DWLLEoffsetpair{} entries.
2150 \itembfnl{\DWLLEstartxendxTARG}
2151 This is a form of bounded location description entry that
2152 has two unsigned LEB128 operands. The operand values are
2153 address indices (into the \dotdebugaddr{} section). These indicate the
2154 starting and ending addresses, respectively, that define
2155 the address range for which this location is valid.
2156 These operands are followed by a counted location description.
2158 \itembfnl{\DWLLEstartxlengthTARG}
2159 This is a form of bounded location description that has two
2160 unsigned ULEB operands. The first value is an address index
2161 (into the \dotdebugaddr{} section)
2162 that indicates the beginning of the address range over
2163 which the location is valid.
2164 The second value is the length of the range.
2165 These operands are followed by a counted location description.
2167 \itembfnl{\DWLLEoffsetpairTARG}
2168 This is a form of bounded location description entry that
2169 has two unsigned LEB128 operands. The values of these
2170 operands are the starting and ending offsets, respectively,
2171 relative to the applicable base address, that define the
2172 address range for which this location is valid.
2173 These operands are followed by a counted location description.
2175 \itembfnl{\DWLLEdefaultlocationTARG}
2176 The operand is a counted location description which defines
2177 where an object is located if no prior location description
2182 The following kinds of location list entries are defined for
2183 use only in non-split DWARF units:
2185 \begin{enumerate}[1. ]
2186 \addtocounter{enumi}{6}
2187 \itembfnl{\DWLLEbaseaddressTARG}
2188 A base address entry has one target address operand.
2189 This address is used as the base address when interpreting
2190 offsets in subsequent location list entries of kind
2193 \itembfnl{\DWLLEstartendTARG}
2194 This is a form of bounded location description entry that
2195 has two target address operands. These indicate the
2196 starting and ending addresses, respectively, that define
2197 the address range for which the location is valid.
2198 These operands are followed by a counted location description.
2200 \itembfnl{\DWLLEstartlengthTARG}
2201 This is a form of bounded location description entry that
2202 has one target address operand value and an unsigned LEB128
2203 integer operand value. The address is the beginning address
2204 of the range over which the location description is valid, and
2205 the length is the number of bytes in that range.
2206 These operands are followed by a counted location description.
2211 \section{Types of Program Entities}
2212 \label{chap:typesofprogramentities}
2213 \hypertarget{chap:DWATtypetypeofdeclaration}{}
2214 Any debugging information entry describing a declaration that
2216 \addtoindexx{type attribute}
2217 a \DWATtypeDEFN{} attribute, whose value is a
2218 reference to another debugging information entry. The entry
2219 referenced may describe a base type, that is, a type that is
2220 not defined in terms of other data types, or it may describe a
2221 user-defined type, such as an array, structure or enumeration.
2222 Alternatively, the entry referenced may describe a type
2223 modifier, such as constant, packed, pointer, reference or
2224 volatile, which in turn will reference another entry describing
2225 a type or type modifier (using a
2226 \DWATtypeNAME{} attribute\addtoindexx{type attribute} of its
2227 own). See Chapter \referfol{chap:typeentries}
2228 for descriptions of the entries describing
2229 base types, user-defined types and type modifiers.
2233 \section{Accessibility of Declarations}
2234 \label{chap:accessibilityofdeclarations}
2235 \textit{Some languages, notably \addtoindex{C++} and
2236 \addtoindex{Ada}, have the concept of
2237 the accessibility of an object or of some other program
2238 entity. The accessibility specifies which classes of other
2239 program objects are permitted access to the object in question.}
2241 The accessibility of a declaration
2242 is\hypertarget{chap:DWATaccessibilityattribute}{}
2244 \DWATaccessibilityDEFN{}\addtoindexx{accessibility attribute}
2245 attribute, whose value is a constant drawn from the set of codes
2246 listed in Table \refersec{tab:accessibilitycodes}.
2248 \begin{simplenametable}[1.9in]{Accessibility codes}{tab:accessibilitycodes}
2249 \DWACCESSpublicTARG{} \\
2250 \DWACCESSprivateTARG{} \\
2251 \DWACCESSprotectedTARG{} \\
2252 \end{simplenametable}
2255 \section{Visibility of Declarations}
2256 \label{chap:visibilityofdeclarations}
2258 \textit{Several languages (such as \addtoindex{Modula-2})
2259 have the concept of the visibility of a declaration. The
2260 visibility specifies which declarations are to be
2261 visible outside of the entity in which they are
2264 The\hypertarget{chap:DWATvisibilityvisibilityofdeclaration}{}
2265 visibility of a declaration is represented
2266 by a \DWATvisibilityDEFN{}
2267 attribute\addtoindexx{visibility attribute}, whose value is a
2268 constant drawn from the set of codes listed in
2269 Table \refersec{tab:visibilitycodes}.
2271 \begin{simplenametable}[1.5in]{Visibility codes}{tab:visibilitycodes}
2272 \DWVISlocalTARG{} \\
2273 \DWVISexportedTARG{} \\
2274 \DWVISqualifiedTARG{} \\
2275 \end{simplenametable}
2278 \section{Virtuality of Declarations}
2279 \label{chap:virtualityofdeclarations}
2280 \textit{\addtoindex{C++} provides for virtual and pure virtual structure or class
2281 member functions and for virtual base classes.}
2283 The\hypertarget{chap:DWATvirtualityvirtualityindication}{}
2284 virtuality of a declaration is represented by a
2285 \DWATvirtualityDEFN{}
2286 attribute\addtoindexx{virtuality attribute}, whose value is a constant drawn
2287 from the set of codes listed in
2288 Table \refersec{tab:virtualitycodes}.
2290 \begin{simplenametable}[2.5in]{Virtuality codes}{tab:virtualitycodes}
2291 \DWVIRTUALITYnoneTARG{} \\
2292 \DWVIRTUALITYvirtualTARG{} \\
2293 \DWVIRTUALITYpurevirtualTARG{} \\
2294 \end{simplenametable}
2297 \section{Artificial Entries}
2298 \label{chap:artificialentries}
2299 \textit{A compiler may wish to generate debugging information entries
2300 for objects or types that were not actually declared in the
2301 source of the application. An example is a formal parameter
2302 entry to represent the hidden
2303 \texttt{this} parameter\index{this parameter@\texttt{this} parameter}
2304 that most \addtoindex{C++} implementations pass as the first argument
2305 to non-static member functions.}
2307 Any debugging information entry representing the
2308 \addtoindexx{artificial attribute}
2309 declaration of an object or type artificially generated by
2310 a compiler and not explicitly declared by the source
2311 program\hypertarget{chap:DWATartificialobjectsortypesthat}{}
2313 \DWATartificialDEFN{} attribute,
2314 which is a \livelink{chap:classflag}{flag}.
2317 \section{Segmented Addresses}
2318 \label{chap:segmentedaddresses}
2319 \textit{In some systems, addresses are specified as offsets within a
2321 \addtoindexx{address space!segmented}
2323 \addtoindexx{segmented addressing|see{address space}}
2324 rather than as locations within a single flat
2325 \addtoindexx{address space!flat}
2328 Any debugging information entry that contains a description
2329 of\hypertarget{chap:DWATsegmentaddressinginformation}{}
2330 the location of an object or subroutine may have a
2331 \DWATsegmentDEFN{} attribute,
2332 \addtoindexx{segment attribute}
2333 whose value is a location
2334 description. The description evaluates to the segment selector
2335 of the item being described. If the entry containing the
2336 \DWATsegmentNAME{} attribute has a
2340 \DWATentrypc{} attribute,
2341 \addtoindexx{entry PC attribute}
2344 description that evaluates to an address, then those address
2345 values represent the offset portion of the address within
2346 the segment specified
2347 \addtoindexx{segment attribute}
2348 by \DWATsegmentNAME.
2351 \DWATsegmentNAME{} attribute, it inherits
2352 \addtoindexx{segment attribute}
2353 the segment value from its parent entry. If none of the
2354 entries in the chain of parents for this entry back to
2355 its containing compilation unit entry have
2356 \DWATsegmentNAME{} attributes,
2357 then the entry is assumed to exist within a flat
2359 Similarly, if the entry has a
2360 \DWATsegmentNAME{} attribute
2361 \addtoindexx{segment attribute}
2362 containing an empty location description, that
2363 entry is assumed to exist within a
2364 \addtoindexi{flat}{address space!flat}
2367 \textit{Some systems support different
2368 classes of addresses\addtoindexx{address class}.
2369 The address class may affect the way a pointer is dereferenced
2370 or the way a subroutine is called.}
2373 Any debugging information entry representing a pointer or
2374 reference type or a subroutine or subroutine type may
2377 attribute, whose value is an integer
2378 constant. The set of permissible values is specific to
2379 each target architecture. The value \DWADDRnoneTARG,
2381 is common to all encodings, and means that no address class
2385 \textit {For example, the Intel386 \texttrademark\ processor might use the following values:}
2388 \caption{Example address class codes}
2389 \label{tab:inteladdressclasstable}
2391 \begin{tabular}{l|c|l}
2393 Name&Value&Meaning \\
2395 \textit{DW\_ADDR\_none}& 0 & \textit{no class specified} \\
2396 \textit{DW\_ADDR\_near16}& 1 & \textit{16-bit offset, no segment} \\
2397 \textit{DW\_ADDR\_far16}& 2 & \textit{16-bit offset, 16-bit segment} \\
2398 \textit{DW\_ADDR\_huge16}& 3 & \textit{16-bit offset, 16-bit segment} \\
2399 \textit{DW\_ADDR\_near32}& 4 & \textit{32-bit offset, no segment} \\
2400 \textit{DW\_ADDR\_far32}& 5 & \textit{32-bit offset, 16-bit segment} \\
2406 \section{Non-Defining Declarations and Completions}
2407 \label{chap:nondefiningdeclarationsandcompletions}
2408 A debugging information entry representing a program entity
2409 typically represents the defining declaration of that
2410 entity. In certain contexts, however, a debugger might need
2411 information about a declaration of an entity that is not
2412 \addtoindexx{incomplete declaration}
2413 also a definition, or is otherwise incomplete, to evaluate
2414 an\hypertarget{chap:DWATdeclarationincompletenondefiningorseparateentitydeclaration}{}
2415 expression correctly.
2418 \textit{As an example, consider the following fragment of \addtoindex{C} code:}
2432 \textit{\addtoindex{C} scoping rules require that the
2433 value of the variable \texttt{x} passed to the function
2434 \texttt{g} is the value of the global \texttt{float}
2435 variable \texttt{x} rather than of the local \texttt{int}
2436 variable \texttt{x}.}
2438 \subsection{Non-Defining Declarations}
2439 A debugging information entry that
2440 represents a non-defining
2441 \addtoindexx{non-defining declaration}
2443 \addtoindex{incomplete declaration}
2444 of a program entity has a
2445 \addtoindexx{declaration attribute}
2446 \DWATdeclarationDEFN{} attribute, which is a
2447 \livelink{chap:classflag}{flag}.
2449 \textit{A non-defining type declaration may nonetheless have
2450 children as illustrated in Section
2451 \refersec{app:declarationscompletingnondefiningdeclarations}.}
2454 \subsection{Declarations Completing Non-Defining Declarations}
2455 \hypertarget{chap:DWATspecificationincompletenondefiningorseparatedeclaration}{}
2456 A debugging information entry that represents a declaration
2457 that completes another (earlier) non-defining declaration may have a
2458 \DWATspecificationDEFN{}
2459 attribute whose value is a \livelink{chap:classreference}{reference} to
2460 the debugging information entry representing the non-defining declaration.
2461 A debugging information entry with a
2462 \DWATspecificationNAME{}
2463 attribute does not need to duplicate information provided by the
2464 debugging information entry referenced by that specification attribute.
2466 When the non-defining declaration is contained within a type that has
2467 been placed in a separate type unit (see Section \refersec{chap:typeunitentries}),
2468 the \DWATspecification{} attribute cannot refer directly to the entry in
2469 the type unit. Instead, the current compilation unit may contain a
2470 \doublequote{skeleton} declaration of the type, which contains only the relevant
2471 declaration and its ancestors as necessary to provide the context
2472 (including containing types and namespaces). The \DWATspecification{}
2473 attribute would then be a reference to the declaration entry within
2474 the skeleton declaration tree. The debugging information entry for the
2475 top-level type in the skeleton tree may contain a \DWATsignature{}
2476 attribute whose value is the type signature
2477 (see Section \refersec{datarep:typesignaturecomputation}).
2480 Not all attributes of the debugging information entry referenced by a
2481 \DWATspecification{} attribute
2482 apply to the referring debugging information entry.
2483 For\addtoindexx{declaration attribute}
2487 \addtoindexx{declaration attribute}
2489 \addtoindexx{declaration attribute}
2491 \addtoindexx{sibling attribute}
2495 \section{Declaration Coordinates}
2496 \label{chap:declarationcoordinates}
2497 \livetargi{chap:declarationcoordinates}{}{declaration coordinates}
2498 \textit{It is sometimes useful in a debugger to be able to associate
2499 a declaration with its occurrence in the program source.}
2501 Any debugging information entry representing
2502 the declaration of an object, module, subprogram or type may have
2503 \DWATdeclfileDEFN,\hypertarget{chap:DWATdeclfilefilecontainingsourcedeclaration}{}
2504 \addtoindexx{declaration file attribute}
2505 \DWATdecllineDEFN\hypertarget{chap:DWATdecllinelinenumberofsourcedeclaration}{}
2506 \addtoindexx{declaration line attribute} and
2507 \DWATdeclcolumnDEFN\hypertarget{chap:DWATdeclcolumncolumnpositionofsourcedeclaration}{}
2508 \addtoindexx{declaration column attribute}
2509 attributes, each of whose value is an unsigned
2510 \livelink{chap:classconstant}{integer constant}.
2513 \addtoindexx{declaration file attribute}
2517 \addtoindexx{file containing declaration}
2519 a file number from the line number information table for the
2520 compilation unit containing the debugging information entry and
2521 represents the source file in which the declaration appeared
2522 (see Section \refersec{chap:linenumberinformation}).
2523 The value 0 indicates that no source file
2527 \addtoindexx{declaration line attribute}
2528 the \DWATdeclline{} attribute represents
2529 the source line number at which the first character of
2530 the identifier of the declared object appears. The value 0
2531 indicates that no source line has been specified.
2534 \addtoindexx{declaration column attribute}
2535 the \DWATdeclcolumn{} attribute represents
2536 the source column number at which the first character of
2537 the identifier of the declared object appears. The value 0
2538 indicates that no column has been specified.
2540 \section{Identifier Names}
2541 \label{chap:identifiernames}
2542 Any\hypertarget{chap:DWATnamenameofdeclaration}{}
2543 debugging information entry
2544 \addtoindexx{identifier names}
2546 \addtoindexx{names!identifier}
2547 a program entity that has been given a name may have a
2549 attribute\addtoindexx{name attribute}, whose value of
2550 class \CLASSstring{} represents the name.
2551 A debugging information entry containing
2552 no name attribute, or containing a name attribute whose value
2553 consists of a name containing a single null byte, represents
2554 a program entity for which no name was given in the source.
2556 \textit{Because the names of program objects described by DWARF are
2557 the names as they appear in the source program, implementations
2558 of language translators that use some form of mangled name
2559 \addtoindexx{mangled names}
2560 (as do many implementations of \addtoindex{C++}) should use the
2561 unmangled form of the name in the
2562 \DWATname{} attribute,
2563 \addtoindexx{name attribute}
2564 including the keyword operator (in names such as \doublequote{operator +}),
2565 if present. See also
2566 Section \referfol{chap:linkagenames} regarding the use of
2567 \DWATlinkagename{} for
2568 \addtoindex{mangled names}.
2569 Sequences of multiple whitespace characters may be compressed.}
2571 \textit{For additional discussion, see the Best Practices section
2573 (\url{http://wiki.dwarfstd.org/index.php?title=Best_Practices}.)}
2575 \section{Data Locations and DWARF Procedures}
2576 \hypertarget{chap:DWATlocationdataobjectlocation}{}
2577 Any debugging information entry describing a data object (which
2578 includes variables and parameters) or
2579 \livelink{chap:commonblockentry}{common blocks}
2580 may have a \DWATlocationDEFN{} attribute,
2581 \addtoindexx{location attribute}
2582 whose value is a location description
2583 (see Section \refersec{chap:locationdescriptions}).
2586 A \addtoindex{DWARF procedure} is represented by any
2587 debugging information entry that has a
2588 \DWATlocationNAME{} attribute.\addtoindexx{location attribute}
2589 If a suitable entry is not otherwise available,
2590 a DWARF procedure can be represented using a debugging
2591 information entry \addtoindexx{DWARF procedure entry}
2592 with the tag \DWTAGdwarfprocedureTARG{} together with a
2593 \DWATlocationNAME{} attribute.\addtoindexx{location attribute}
2595 A DWARF procedure is called by a \DWOPcalltwo, \DWOPcallfour{}
2596 or \DWOPcallref{} DWARF expression operator
2597 (see Section \refersec{chap:controlflowoperations}).
2600 \section{Code Addresses, Ranges and Base Addresses}
2601 \label{chap:codeaddressesandranges}
2602 Any debugging information entry describing an entity that has
2603 a machine code address or range of machine code addresses,
2604 which includes compilation units, module initialization,
2605 subroutines, lexical \nolink{blocks},
2606 try/catch \nolink{blocks} (see Section \refersec{chap:tryandcatchblockentries}),
2607 labels and the like, may have
2609 \item \hypertarget{chap:DWATlowpccodeaddressorrangeofaddresses}{}
2610 A \DWATlowpcDEFN{} attribute for a single address,
2612 \item \hypertarget{chap:DWAThighpccontiguousrangeofcodeaddresses}{}
2613 A \DWATlowpcDEFN{}\addtoindexx{low PC attribute}
2614 and \DWAThighpcDEFN{}\addtoindexx{high PC attribute}
2615 pair of attributes for a single contiguous range of
2618 \item \hypertarget{chap:DWATrangesnoncontiguousrangeofcodeaddresses}{}
2619 A \DWATrangesDEFN{} attribute\addtoindexx{ranges attribute}
2620 for a non-contiguous range of addresses.
2623 If an entity has no associated machine code,
2624 none of these attributes are specified.
2627 The \definitionx{base address} of the scope for any of the
2628 debugging information entries listed above is given by either the
2629 \DWATlowpcNAME{}\livetargi{chap:DWATlowpcbaseaddressofscope}{}{base address of scope}
2630 attribute or the first address in the first range entry
2631 in the list of ranges given by the \DWATrangesNAME{} attribute.
2632 If there is no such attribute, the base address is undefined.
2634 \subsection{Single Address}
2635 \label{chap:singleaddress}
2636 When there is a single address associated with an entity,
2637 such as a label or alternate entry point of a subprogram,
2638 the entry has a \DWATlowpc{} attribute whose value is the
2639 address for the entity.
2642 \subsection{Contiguous Address Range}
2643 \label{chap:contiguousaddressranges}
2644 When the set of addresses of a debugging information entry can
2645 be described as a single contiguous range, the entry may
2646 \addtoindexx{high PC attribute}
2647 \addtoindexx{low PC attribute}
2648 have a \DWATlowpc{} and \DWAThighpc{} pair of attributes.
2649 The value of the \DWATlowpc{} attribute is the address of the
2650 first instruction associated with the entity. If the value of
2651 the \DWAThighpc{} is of class address, it is the
2652 address of the first location past the last instruction
2653 associated with the entity; if it is of class constant, the
2654 value is an unsigned integer offset which when added to the
2655 low PC gives the address of the first location past the last
2656 instruction associated with the entity.
2658 \textit{The high PC value
2659 may be beyond the last valid instruction in the executable.}
2661 \subsection{Non-Contiguous Address Ranges}
2662 \label{chap:noncontiguousaddressranges}
2663 Range lists are used when the set of addresses for a debugging
2664 information entry cannot be described as a single contiguous
2665 range.\addtoindexx{non-contiguous address ranges}
2666 Range lists are contained in a separate object file section
2667 called \dotdebugrnglists{} or \dotdebugrnglistsdwo{} (in split units).
2669 A range list is identified by a \DWATranges{}\addtoindexx{ranges attribute}
2670 or other attribute whose value is of class \CLASSrnglist{}
2671 (see Section \refersec{datarep:classesandforms}).
2673 \textit{This range list representation, the \CLASSrnglist{} class, and the
2674 related \DWATrnglistsbase{} attribute are new in \DWARFVersionV.
2675 Together they eliminate most or all of the object language relocations
2676 previously needed for range lists.}
2678 Each range list entry is one of the following kinds:
2680 \item \definition{Bounded range}.\addtoindexx{bounded range}
2681 This kind of entry defines an address range
2682 that is included in the range list. The starting address is
2683 the lowest address of the address range. The ending address
2684 is the address of the first location past the highest address
2685 of the address range.
2687 There are several kinds of bounded range entries which specify
2688 the starting and ending addresses in different ways.
2690 \item \definition{Base address}.\addtoindexx{base address!of range list}
2691 This kind of entry provides an address to be
2692 used as the base address for the beginning and ending
2693 address offsets given in certain bounded range entries. The
2694 applicable base address of a range list entry is
2695 determined by the closest preceding base address
2696 entry in the same range list. If there is no preceding
2697 base address entry, then the applicable base address
2698 defaults to the base address of the compilation unit (see
2699 Section \refersec{chap:fullandpartialcompilationunitentries}).
2701 In the case of a compilation unit where all of the machine
2702 code is contained in a single contiguous section, no base
2703 address entry is needed.
2705 \item \definition{End-of-list}.\addtoindexx{end-of-list!of range list}
2706 This kind of entry marks the end of the range list.
2710 Each range list consists of a sequence of zero or more bounded
2711 range or base address entries, terminated by an end-of-list entry.
2713 A range list containing only an end-of-list entry describes an
2714 empty scope (which contains no instructions).
2716 Bounded range entries in a range list may not overlap. There is
2717 no requirement that the entries be ordered in any particular way.
2719 A bounded range entry whose beginning and ending address offsets
2720 are equal (including zero) indicates an empty range and may be
2723 Each range list entry begins with a single byte identifying the kind
2724 of that entry, followed by zero or more operands depending on the
2727 In the descriptions that follow, the term \definitionx{address index}
2728 means the index of an address in the \dotdebugaddr{} section. This
2729 index is relative to the value of the \DWATaddrbase{} attribute
2730 of the associated compilation unit. The address given by this kind
2731 of operand is \emph{not} relative to the compilation unit base
2734 The following entry kinds are defined for use in both
2735 split or non-split units:
2736 \begin{enumerate}[1. ]
2737 \itembfnl{\DWRLEendoflistTARG}
2738 An end-of-list entry contains no further data.
2740 \textit{A series of this kind of entry may be used for padding or
2741 alignment purposes.}
2743 \itembfnl{\DWRLEbaseaddressxTARG}
2744 A base address entry has one unsigned LEB128 operand.
2745 The operand value is an address index (into the \dotdebugaddr{}
2746 section) that indicates the applicable base address used by
2747 following \DWRLEoffsetpair{} entries.
2749 \itembfnl{\DWRLEstartxendxTARG}
2750 This is a form of bounded range entry that
2751 has two unsigned LEB128 operands. The operand values are
2752 address indices (into the \dotdebugaddr{} section) that indicate the
2753 starting and ending addresses, respectively, that define
2756 \itembfnl{\DWRLEstartxlengthTARG}
2757 This is a form of bounded location description that
2758 has two unsigned ULEB operands. The first value is an address index
2759 (into the \dotdebugaddr{} section) that indicates the beginning of
2760 the address range. The second value is the length of the range.
2762 \itembfnl{\DWRLEoffsetpairTARG}
2763 This is a form of bounded range entry that
2764 has two unsigned LEB128 operands. The values of these
2765 operands are the starting and ending offsets, respectively,
2766 relative to the applicable base address, that define the
2771 The following kinds of range entry may be used only in non-split
2774 \begin{enumerate}[1. ]
2775 \addtocounter{enumi}{5}
2776 \itembfnl{\DWRLEbaseaddressTARG}
2777 A base address entry has one target address operand.
2778 This operand is the same size as used in \DWFORMaddr.
2779 This address is used as the base address when interpreting
2780 offsets in subsequent location list entries of kind
2783 \itembfnl{\DWRLEstartendTARG}
2784 This is a form of bounded range entry that
2785 has two target address operands. Each
2786 operand is the same size as used in \DWFORMaddr.
2787 These indicate the starting and ending addresses,
2788 respectively, that define the address range for which
2789 the following location is valid.
2791 \itembfnl{\DWRLEstartlengthTARG}
2792 This is a form of bounded range entry that
2793 has one target address operand value and an unsigned LEB128
2794 integer length operand value. The address is the beginning address
2795 of the range over which the location description is valid, and
2796 the length is the number of bytes in that range.
2801 \section{Entry Address}
2802 \label{chap:entryaddress}
2803 \textit{The entry or first executable instruction generated
2804 for an entity, if applicable, is often the lowest addressed
2805 instruction of a contiguous range of instructions. In other
2806 cases, the entry address needs to be specified explicitly.}
2808 Any debugging information entry describing an entity that has
2809 a range of code addresses, which includes compilation units,
2810 module initialization, subroutines,
2811 \livelink{chap:lexicalblock}{lexical \nolink{blocks}},
2812 \livelink{chap:tryandcatchblockentries}{try/catch \nolink{blocks}},
2813 and the like, may have a \DWATentrypcDEFN{} attribute
2814 \addtoindexx{entry PC address} to indicate the
2815 \definitionx{entry address} which is the address of the
2816 instruction where execution begins
2817 within that range\hypertarget{chap:entryaddressofscope}{}
2819 If the value of the \DWATentrypcNAME{} attribute is of
2820 class \CLASSaddress{} that address is the entry address;
2821 or, if it is of class
2822 \CLASSconstant, the value is an unsigned integer offset which,
2823 when added to the base address of the function, gives the entry
2827 If no \DWATentrypcNAME{} attribute is present,
2828 then the entry address is assumed to be the same as the
2829 base address of the containing scope.
2832 \section{Static and Dynamic Values of Attributes}
2833 \label{chap:staticanddynamicvaluesofattributes}
2835 Some attributes that apply to types specify a property (such
2836 as the lower bound of an array) that is an integer value,
2837 where the value may be known during compilation or may be
2838 computed dynamically during execution.
2842 attributes is determined based on the class as follows:
2844 \item For a \livelink{chap:classconstant}{constant}, the value
2845 of the constant is the value of the attribute.
2847 \item For a \livelink{chap:classreference}{reference}, the
2848 value is a reference to another debugging information entry.
2851 \renewcommand{\itemsep}{0cm}
2852 \item describe a constant which is the attribute value,
2853 \item describe a variable which contains the attribute value, or
2854 \item contain a \DWATlocation{} attribute whose value is a
2855 DWARF expression which computes the attribute value
2856 (for example, a \DWTAGdwarfprocedure{} entry).
2859 \item For an \livelink{chap:classexprloc}{exprloc}, the value
2860 is interpreted as a DWARF expression; evaluation of the expression
2861 yields the value of the attribute.
2866 \section{Entity Descriptions}
2867 \textit{Some debugging information entries may describe entities
2868 in the program that are artificial, or which otherwise have a
2869 \doublequote{name} that is not a valid identifier in the
2870 programming language.
2871 This attribute provides a means for the producer to indicate
2872 the purpose or usage of the containing debugging infor}
2874 Generally, any debugging information entry that
2875 has,\hypertarget{chap:DWATdescriptionartificialnameordescription}{}
2876 or may have, a \DWATname{} attribute, may also have a
2877 \addtoindexx{description attribute}
2878 \DWATdescriptionDEFN{} attribute whose value is a
2879 null-terminated string providing a description of the entity.
2881 \textit{It is expected that a debugger will
2882 display these descriptions as part of
2883 displaying other properties of an entity.}
2886 \section{Byte and Bit Sizes}
2887 \label{chap:byteandbitsizes}
2888 % Some trouble here with hbox full, so we try optional word breaks.
2889 Many debugging information entries allow either a
2890 \DWATbytesizeNAME{} attribute or a
2891 \DWATbitsizeNAME{} attribute,
2892 whose \livelink{chap:classconstant}{integer constant} value
2893 (see Section \ref{chap:staticanddynamicvaluesofattributes})
2895 amount of storage. The value of the
2896 \DWATbytesizeDEFN{} attribute
2897 is interpreted in bytes and the value of the
2899 attribute is interpreted in bits. The
2900 \DWATstringlengthbytesize{} and
2901 \DWATstringlengthbitsize{}
2902 attributes are similar.
2904 In addition, the \livelink{chap:classconstant}{integer constant}
2905 value of a \DWATbytestride{} attribute is interpreted
2906 in bytes and the \livelink{chap:classconstant}{integer constant} value of a
2908 attribute is interpreted in bits.
2910 \section{Linkage Names}
2911 \label{chap:linkagenames}
2912 \textit{Some language implementations, notably
2913 \addtoindex{C++} and similar
2914 languages, make use of implementation-defined names within
2915 object files that are different from the \addtoindex{identifier names}
2916 (see Section \refersec{chap:identifiernames}) of entities as they
2917 appear in the source. Such names, sometimes known as
2918 \addtoindex{mangled names}\addtoindexx{names!mangled},
2919 are used in various ways, such as: to encode additional
2920 information about an entity, to distinguish multiple entities
2921 that have the same name, and so on. When an entity has an
2922 associated distinct linkage name it may sometimes be useful
2923 for a producer to include this name in the DWARF description
2924 of the program to facilitate consumer access to and use of
2925 object file information about an entity and/or information
2926 that is encoded in the linkage name itself.
2929 % Some trouble maybe with hbox full, so we try optional word breaks.
2930 A debugging information entry may have a
2931 \DWATlinkagenameDEFN{}\hypertarget{chap:DWATlinkagenameobjectfilelinkagenameofanentity}{}
2932 attribute\addtoindexx{linkage name attribute}
2933 whose value is a null-terminated string containing the
2934 object file linkage name associated with the corresponding entity.
2937 \section{Template Parameters}
2938 \label{chap:templateparameters}
2939 \textit{In \addtoindex{C++}, a template is a generic definition
2940 of a class, function, member function, or typedef (alias).
2941 A template has formal parameters that
2942 can be types or constant values; the class, function,
2943 member function, or typedef is instantiated differently for each
2944 distinct combination of type or value actual parameters. DWARF does
2945 not represent the generic template definition, but does represent each
2948 A debugging information entry that represents a
2949 \addtoindex{template instantiation}
2950 will contain child entries describing the actual template parameters.
2951 The containing entry and each of its child entries reference a template
2952 parameter entry in any circumstance where the template definition
2953 referenced a formal template parameter.
2955 A template type parameter is represented by a debugging information
2957 \addtoindexx{template type parameter entry}
2958 \DWTAGtemplatetypeparameterTARG.
2959 A template value parameter is represented by a debugging information
2961 \addtoindexx{template value parameter entry}
2962 \DWTAGtemplatevalueparameterTARG.
2963 The actual template parameter entries appear in the same order as the
2964 corresponding template formal parameter declarations in the
2968 A type or value parameter entry may have a \DWATname{} attribute,
2969 \addtoindexx{name attribute}
2971 null-terminated string containing the name of the corresponding
2972 formal parameter. The entry may also have a
2973 \DWATdefaultvalue{} attribute, which is a flag indicating
2974 that the value corresponds to the default argument for the
2977 A\addtoindexx{formal type parameter|see{template type parameter entry}}
2978 template type parameter entry has a
2979 \DWATtype{} attribute\addtoindexx{type attribute}
2980 describing the actual type by which the formal is replaced.
2982 A template value parameter entry has a \DWATtype{} attribute
2983 describing the type of the parameterized value.
2984 The entry also has an attribute giving the
2985 actual compile-time or run-time constant value
2986 of the value parameter for this instantiation.
2988 \DWATconstvalueDEFN{} attribute,
2989 \addtoindexx{constant value attribute}
2990 \livetarg{chap:DWATconstvaluetemplatevalueparameter}{}
2991 whose value is the compile-time constant value
2992 as represented on the target architecture, or a
2993 \DWATlocation{} attribute, whose value is a
2994 single location description for the run-time constant address.
2998 \label{chap:alignment}
2999 \livetarg{chap:DWATalignmentnondefault}{}
3000 A debugging information entry may have a
3001 \DWATalignmentDEFN{} attribute\addtoindexx{alignment attribute}
3002 whose value of class \CLASSconstant{} is
3003 a positive, non-zero, integer describing the
3004 alignment of the entity.
3006 \textit{For example, an alignment attribute whose value is 8 indicates
3007 that the entity to which it applies occurs at an address that is a
3008 multiple of eight (not a multiple of $2^8$ or 256).}