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 \DWTAGimporteddeclaration,
58 \DWTAGinlinedsubroutine,
70 \DWTAGptrtomembertype,
73 \DWTAGrvaluereferencetype,
85 \DWTAGtemplatetypeparameter,
86 \DWTAGtemplatevalueparameter,
92 \DWTAGunspecifiedparameters,
93 \DWTAGunspecifiedtype,
104 \textit{The debugging information entry descriptions in
105 Chapters 3, 4 and 5 generally include mention of
106 most, but not necessarily all, of the attributes
107 that are normally or possibly used with the entry.
108 Some attributes, whose applicability tends to be
109 pervasive and invariant across many kinds of
110 debugging information entries, are described in
111 this section and not necessarily mentioned in all
112 contexts where they may be appropriate.
115 the \livelink{chap:declarationcoordinates}{declaration coordinates}, and
119 The debugging information entries are contained in the
120 \dotdebuginfo{} and/or \dotdebuginfodwo{} sections of an object file.
123 Optionally, debugging information may be partitioned such
124 that the majority of the debugging information can remain in
125 individual object files without being processed by the
126 linker. See Section \refersec{datarep:splitdwarfobjectfiles} and
127 Appendix \refersec{app:splitdwarfobjectsinformative} for details.
130 As a further option, debugging information entries and other debugging
131 information that are the same in multiple executable or shared object files
132 may be found in a separate \addtoindex{supplementary object file} that
133 contains supplementary debug sections.
134 See Section \refersec{datarep:dwarfsupplemetaryobjectfiles} for
137 \section{Attribute Types}
138 \label{chap:attributetypes}
139 Each attribute value is characterized by an attribute name.
140 \addtoindexx{attribute duplication}
141 No more than one attribute with a given name may appear in any
142 debugging information entry.
143 There are no limitations on the
144 \addtoindexx{attribute ordering}
145 ordering of attributes within a debugging information entry.
147 The attributes are listed in Table \referfol{tab:attributenames}.
149 \setlength{\extrarowheight}{0.1cm}
150 \addtoindexx{attributes!list of}
151 \begin{longtable}{P{6.2cm}|P{8.5cm}}
152 \caption{Attribute names} \label{tab:attributenames} \\
153 \hline \bfseries Attribute$^*$&\bfseries Usage \\ \hline
155 \bfseries Attribute$^*$&\bfseries Identifies or Specifies \\ \hline
160 \vspace{2mm}\emph{Continued on next page} \newline
161 $^*${\parbox[t]{15cm}{\tiny Links for attributes come to the left column of this table;
162 links in the right column "fan-out" to one or more descriptions.}} \newline
167 $^*${\parbox[t]{15cm}{\tiny Links for attributes come to the left column of this table;
168 links in the right column "fan-out" to one or more descriptions.}}}
171 \DWATabstractoriginTARG
172 &\livelinki{chap:DWATabstractorigininlineinstance}
173 {Inline instances of inline subprograms}
174 {inline instances of inline subprograms} \\
175 % Heren livelink we cannot use \dash or \dash{}.
176 &\livelinki{chap:DWATabstractoriginoutoflineinstance}
177 {Out-of-line instances of inline subprograms}
178 {out-of-line instances of inline subprograms} \\
179 \DWATaccessibilityTARG
180 &\livelink{chap:DWATaccessdeclaration}
181 {Access declaration} (\addtoindex{C++}, \addtoindex{Ada}) \\
182 &\livelink{chap:DWATaccessibilitycppinheritedmembers}
183 {Accessibility of base or inherited class} (\addtoindex{C++}) \\
184 &\livelinki{chap:DWATaccessibilityattribute}
185 {Accessibility of data member or member function}
186 {accessibility attribute}
188 \DWATaddressclassTARG
189 &\livelinki{chap:DWATadressclasspointerorreferencetypes}
190 {Pointer or reference types}
191 {pointer or reference types} \\
192 &\livelinki{chap:DWATaddressclasssubroutineorsubroutinetype}
193 {Subroutine or subroutine type}
194 {subroutine or subroutine type} \\
196 &\livelinki{chap:DWATaddrbaseforaddresstable}
197 {Base offset for address table}
200 &\livelinki{chap:DWATalignmentnondefault}
201 {Non-default alignment of type, subprogram or variable}
202 {non-default alignment} \addtoindexx{alignment!non-default} \\
204 &\livelinki{chap:DWATallocatedallocationstatusoftypes}
205 {Allocation status of types}
206 {allocation status of types} \\
208 &\livelinki{chap:DWATartificialobjectsortypesthat}
209 {Objects or types that are not actually declared in the source}
210 {objects or types that are not actually declared in the source} \\
211 \DWATassociatedTARG{}
212 &\livelinki{chap:DWATassociatedassociationstatusoftypes}
213 {Association status of types}
214 {association status of types} \\
216 &\livelinki{chap:DWATbasetypesprimitivedatatypesofcompilationunit}
217 {Primitive data types of compilation unit}
218 {primitive data types of compilation unit} \\
219 \DWATbinaryscaleTARG{}
220 &\livelinki{chap:DWATbinaryscalebinaryscalefactorforfixedpointtype}
221 {Binary scale factor for fixed-point type}
222 {binary scale factor for fixed-point type} \\
223 %\DWATbitoffsetTARG{}
224 %&\livelinki{chap:DWATbitoffsetbasetypebitlocation}{Base type bit location}{base type bit location} \\
225 %&\livelinki{chap:DWATbitoffsetdatamemberbitlocation}{Data member bit location}{data member bit location} \\
227 &\livelinki{chap:DWATbitsizebasetypebitsize}
228 {Size of a base type in bits}
229 {base type bit size} \\
230 &\livelinki{chap:DWATbitsizedatamemberbitsize}
231 {Size of a data member in bits}
232 {data member bit size} \\
234 &\livelinki{chap:DWATbitstridearrayelementstrideofarraytype}
235 {Array element stride (of array type)}
236 {array element stride (of array type)} \\*
237 &\livelinki{chap:DWATbitstridesubrangestridedimensionofarraytype}
238 {Subrange stride (dimension of array type)}
239 {subrange stride (dimension of array type)} \\*
240 &\livelinki{chap:DWATbitstrideenumerationstridedimensionofarraytype}
241 {Enumeration stride (dimension of array type)}
242 {enumeration stride (dimension of array type)} \\
244 &\livelinki{chap:DWATbytesizedataobjectordatatypesize}
245 {Size of a data object or data type in bytes}
246 {data object or data type size} \\
247 \DWATbytestrideTARG{}
248 &\livelinki{chap:DWATbytestridearrayelementstrideofarraytype}
249 {Array element stride (of array type)}
250 {array element stride (of array type)} \\
251 &\livelinki{chap:DWATbytestridesubrangestridedimensionofarraytype}
252 {Subrange stride (dimension of array type)}
253 {subrange stride (dimension of array type)} \\
254 &\livelinki{chap:DWATbytestrideenumerationstridedimensionofarraytype}
255 {Enumeration stride (dimension of array type)}
256 {enumeration stride (dimension of array type)} \\
257 \DWATcallallcallsTARG{}
258 &\livelinki{chap:DWATcallallcallsofasubprogram}
259 {All tail and normal calls in a subprogram are described by call site entries}
260 {all tail and normal calls are described}
261 \index{call site!summary!all tail and normal calls are described} \\
262 \DWATcallallsourcecallsTARG{}
263 &\livelinki{chap:DWATcallallsourcecallsofasubprogram}
264 {All tail, normal and inlined calls in a subprogram are described by call site and inlined subprogram entries}
265 {all tail, normal and inlined calls are described}
266 \index{call site!summary!all tail, normal and inlined calls are described} \\
267 \DWATcallalltailcallsTARG{}
268 &\livelinki{chap:DWATcallalltailcallsofasubprogram}
269 {All tail calls in a subprogram are described by call site entries}
270 {all tail calls are described}
271 \index{call site!summary!all tail calls are described} \\
272 \DWATcallcolumnTARG{}
273 &\livelinki{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}
274 {Column position of inlined subroutine call}
275 {column position of inlined subroutine call} \\
276 &\livelinki{chap:DWATcallcolumnofcallsite}
277 {Column position of call site of non-inlined call}
278 {column position of call site of non-inlined call} \\
279 \DWATcalldatalocationTARG{}
280 &\livelinki{chap:DWATcalldatalocationofcallparameter}
281 {Address of the value pointed to by an argument passed in a call}
282 {address of the value pointed to by an argument}
283 \index{call site!address of the value pointed to by an argument} \\
284 \DWATcalldatavalueTARG{}
285 &\livelinki{chap:DWATcalldatavalueofcallparameter}
286 {Value pointed to by an argument passed in a call}
287 {value pointed to by an argument}
288 \index{call site!value pointed to by an argument} \\
290 &\livelinki{chap:DWATcallfilefilecontaininginlinedsubroutinecall}
291 {File containing inlined subroutine call}
292 {file containing inlined subroutine call} \\
293 &\livelinki{chap:DWATcallfileofcallsite}
294 {File containing call site of non-inlined call}
295 {file containing call site of non-inlined call} \\
297 &\livelinki{chap:DWATcalllinelinenumberofinlinedsubroutinecall}
298 {Line number of inlined subroutine call}
299 {line number of inlined subroutine call} \\
300 &\livelinki{chap:DWATcalllineofcallsite}
301 {Line containing call site of non-inlined call}
302 {line containing call site of non-inlined call} \\
303 \DWATcallingconventionTARG{}
304 &\livelinki{chap:DWATcallingconventionforsubprograms}
305 {Calling convention for subprograms}
306 {Calling convention!for subprograms} \\
307 &\livelinki{chap:DWATcallingconventionfortypes}
308 {Calling convention for types}
309 {Calling convention!for types} \\
310 \DWATcalloriginTARG{}
311 &\livelinki{chap:DWATcalloriginofcallsite}
312 {Subprogram called in a call}
314 \index{call site!subprogram called} \\
315 \DWATcallparameterTARG{}
316 &\livelinki{chap:DWATcallparameterofcallparameter}
317 {Parameter entry in a call}
319 \index{call site!parameter entry} \\
321 &\livelinki{chap:DWATcallpcofcallsite}
322 {Address of the call instruction in a call}
323 {address of call instruction}
324 \index{call site!address of the call instruction} \\
325 \DWATcallreturnpcTARG{}
326 &\livelinki{chap:DWATcallreturnpcofcallsite}
327 {Return address from a call}
328 {return address from a call}
329 \index{call site!return address} \\
330 \DWATcalltailcallTARG{}
331 &\livelinki{chap:DWATcalltailcallofcallsite}
332 {Call is a tail call}
333 {call is a tail call}
334 \index{call site!tail call} \\
335 \DWATcalltargetTARG{}
336 &\livelinki{chap:DWATcalltargetofcallsite}
337 {Address of called routine in a call}
338 {address of called routine}
339 \index{call site!address of called routine} \\
340 \DWATcalltargetclobberedTARG{}
341 &\livelinki{chap:DWATcalltargetclobberedofcallsite}
342 {Address of called routine, which may be clobbered, in a call}
343 {address of called routine, which may be clobbered}
344 \index{call site!address of called routine, which may be clobbered} \\
346 &\livelinki{chap:DWATcallvalueofcallparameter}
347 {Argument value passed in a call}
348 {argument value passed}
349 \index{call site!argument value passed} \\
350 \DWATcommonreferenceTARG
351 &\livelinki{chap:commonreferencecommonblockusage}
353 {common block usage} \\
355 &\livelinki{chap:DWATcompdircompilationdirectory}
356 {Compilation directory}
357 {compilation directory} \\
359 &\livelinki{chap:DWATconstexprcompiletimeconstantobject}
360 {Compile-time constant object}
361 {compile-time constant object} \\
362 &\livelinki{chap:DWATconstexprcompiletimeconstantfunction}
363 {Compile-time constant function}
364 {compile-time constant function} \\
366 &\livelinki{chap:DWATconstvalueconstantobject}
369 &\livelinki{chap:DWATconstvalueenumerationliteralvalue}
370 {Enumeration literal value}
371 {enumeration literal value} \\
372 &\livelinki{chap:DWATconstvaluetemplatevalueparameter}
373 {Template value parameter}
374 {template value parameter} \\
375 \DWATcontainingtypeTARG
376 &\livelinki{chap:DWATcontainingtypecontainingtypeofpointertomembertype}
377 {Containing type of pointer to member type}
378 {containing type of pointer to member type} \\
380 &\livelinki{chap:DWATcountelementsofsubrangetype}
381 {Elements of subrange type}
382 {elements of breg subrange type} \\
383 \DWATdatabitoffsetTARG
384 &\livelinki{chap:DWATdatabitoffsetbasetypebitlocation}
385 {Base type bit location}
386 {base type bit location} \\
387 &\livelinki{chap:DWATdatabitoffsetdatamemberbitlocation}
388 {Data member bit location}
389 {data member bit location} \\
390 \DWATdatalocationTARG{}
391 &\livelinki{chap:DWATdatalocationindirectiontoactualdata}
392 {Indirection to actual data}
393 {indirection to actual data} \\
394 \DWATdatamemberlocationTARG
395 &\livelinki{chap:DWATdatamemberlocationdatamemberlocation}
396 {Data member location}
397 {data member location} \\
398 &\livelinki{chap:DWATdatamemberlocationinheritedmemberlocation}
399 {Inherited member location}
400 {inherited member location} \\
401 \DWATdecimalscaleTARG
402 &\livelinki{chap:DWATdecimalscaledecimalscalefactor}
403 {Decimal scale factor}
404 {decimal scale factor} \\
406 &\livelinki{chap:DWATdecimalsigndecimalsignrepresentation}
407 {Decimal sign representation}
408 {decimal sign representation} \\
410 &\livelinki{chap:DWATdeclcolumncolumnpositionofsourcedeclaration}
411 {Column position of source declaration}
412 {column position of source declaration} \\
414 &\livelinki{chap:DWATdeclfilefilecontainingsourcedeclaration}
415 {File containing source declaration}
416 {file containing source declaration} \\
418 &\livelinki{chap:DWATdecllinelinenumberofsourcedeclaration}
419 {Line number of source declaration}
420 {line number of source declaration} \\
422 &\livelinki{chap:DWATdeclarationincompletenondefiningorseparateentitydeclaration}
423 {Incomplete, non-defining, or separate entity declaration}
424 {incomplete, non-defining, or separate entity declaration} \\
426 &\livelinki{chap:DWATdefaulteddef}
427 {Whether a member function has been declared as default}
428 {defaulted attribute} \\
429 \DWATdefaultvalueTARG
430 &\livelinki{chap:DWATdefaultvaluedefaultvalueofparameter}
431 {Default value of parameter}
432 {default value of parameter} \\
434 &\livelinki{chap:DWATdeleteddef}
435 {Whether a member has been declared as deleted}
436 {Deletion of member function} \\
437 \DWATdescriptionTARG{}
438 &\livelinki{chap:DWATdescriptionartificialnameordescription}
439 {Artificial name or description}
440 {artificial name or description} \\
442 &\livelinki{chap:DWATdigitcountdigitcountforpackeddecimalornumericstringtype}
443 {Digit count for packed decimal or numeric string type}
444 {digit count for packed decimal or numeric string type} \\
446 &\livelinki{chap:DWATdiscrdiscriminantofvariantpart}
447 {Discriminant of variant part}
448 {discriminant of variant part} \\
450 &\livelinki{chap:DWATdiscrlistlistofdiscriminantvalues}
451 {List of discriminant values}
452 {list of discriminant values} \\
454 &\livelinki{chap:DWATdiscrvaluediscriminantvalue}
456 {discriminant value} \\
459 &\livelinki{chap:DWATdwonameforunit}
460 {Name of split DWARF object file}
461 {split DWARF object file!object file name} \\
463 &\livelinki{chap:DWATelementalelementalpropertyofasubroutine}
464 {Elemental property of a subroutine}
465 {elemental property of a subroutine} \\
467 &\livelinki{chap:DWATencodingencodingofbasetype}
468 {Encoding of base type}
469 {encoding of base type} \\
471 &\livelinki{chap:DWATendianityendianityofdata}
473 {endianity of data} \\
475 &\livelinki{chap:entryaddressofscope}
476 {Entry address of a scope (compilation unit, \mbox{subprogram,} and so on)}
477 {entry address of a scope} \\
479 &\livelinki{chap:DWATenumclasstypesafeenumerationdefinition}
480 {Type safe enumeration definition}
481 {type safe enumeration definition}\\
483 &\livelinki{chap:DWATexplicitexplicitpropertyofmemberfunction}
484 {Explicit property of member function}
485 {explicit property of member function}\\
486 \DWATexportsymbolsTARG
487 &\livelinki{chap:DWATexportsymbolsofnamespace}
488 {Export (inline) symbols of namespace}
489 {export symbols of a namespace} \\
490 &\livelinki{chap:DWATexportsymbolsofstructunionclass}
491 {Export symbols of a structure, union or class}
492 {export symbols of a structure, union or class} \\
494 &\livelinki{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}
495 {Previous namespace extension or original namespace}
496 {previous namespace extension or original namespace}\\
498 &\livelinki{chap:DWATexternalexternalsubroutine}
499 {External subroutine}
500 {external subroutine} \\
501 &\livelinki{chap:DWATexternalexternalvariable}
503 {external variable} \\
505 &\livelinki{chap:DWATframebasesubroutineframebaseaddress}
506 {Subroutine frame base address}
507 {subroutine frame base address} \\
509 &\livelinki{chap:DWATfriendfriendrelationship}
510 {Friend relationship}
511 {friend relationship} \\
513 &\livelinki{chap:DWAThighpccontiguousrangeofcodeaddresses}
514 {Contiguous range of code addresses}
515 {contiguous range of code addresses} \\
516 \DWATidentifiercaseTARG
517 &\livelinki{chap:DWATidentifiercaseidentifiercaserule}
518 {Identifier case rule}
519 {identifier case rule} \\
521 &\livelinki{chap:DWATimportimporteddeclaration}
522 {Imported declaration}
523 {imported declaration} \\*
524 &\livelinki{chap:DWATimportimportedunit}
527 &\livelinki{chap:DWATimportnamespacealias}
529 {namespace alias} \\*
530 &\livelinki{chap:DWATimportnamespaceusingdeclaration}
531 {Namespace using declaration}
532 {namespace using declaration} \\*
533 &\livelinki{chap:DWATimportnamespaceusingdirective}
534 {Namespace using directive}
535 {namespace using directive} \\
537 &\livelinki{chap:DWATinlineabstracttinstance}
539 {abstract instance} \\
540 &\livelinki{chap:DWATinlineinlinedsubroutine}
542 {inlined subroutine} \\
544 &\livelinki{chap:DWATisoptionaloptionalparameter}
546 {optional parameter} \\
548 &\livelinki{chap:DWATlanguageprogramminglanguage}
549 {Programming language}
550 {programming language} \\
552 &\livelinki{chap:DWATlinkagenameobjectfilelinkagenameofanentity}
553 {Object file linkage name of an entity}
554 {object file linkage name of an entity}\\
556 &\livelinki{chap:DWATlocationdataobjectlocation}
557 {Data object location}
558 {data object location}\\
560 &\livelinki{chap:DWATlowpccodeaddressorrangeofaddresses}
561 {Code address or range of addresses}
562 {code address or range of addresses}\\*
563 &\livelinki{chap:DWATlowpcbaseaddressofscope}
564 {Base address of scope}
565 {base address of scope}\\
567 &\livelinki{chap:DWATlowerboundlowerboundofsubrange}
568 {Lower bound of subrange}
569 {lower bound of subrange} \\
571 &\livelinki{chap:DWATmacroinfomacroinformation}
572 {Macro preprocessor information (legacy)}
573 {macro preprocessor information (legacy)} \\
574 & \textit{(reserved for coexistence with \DWARFVersionIV{} and earlier)} \\
576 &\livelinki{chap:DWATmacrosmacroinformation}
577 {Macro preprocessor information}
578 {macro preprocessor information} \\
579 & \textit{(\texttt{\#define}, \texttt{\#undef}, and so on in \addtoindex{C},
580 \addtoindex{C++} and similar languages)} \\
581 \DWATmainsubprogramTARG
582 &\livelinki{chap:DWATmainsubprogrammainorstartingsubprogram}
583 {Main or starting subprogram}
584 {main or starting subprogram} \\
585 &\livelinki{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}
586 {Unit containing main or starting subprogram}
587 {unit containing main or starting subprogram}\\
589 &\livelinki{chap:DWATmutablemutablepropertyofmemberdata}
590 {Mutable property of member data}
591 {mutable property of member data} \\
593 &\livelinki{chap:DWATnamenameofdeclaration}
594 {Name of declaration}
595 {name of declaration}\\
596 &\livelinki{chap:DWATnamepathnameofcompilationsource}
597 {Path name of compilation source}
598 {path name of compilation source} \\
599 \DWATnamelistitemTARG
600 &\livelinki{chap:DWATnamelistitemnamelistitem}
604 &\livelinki{chap:DWATnoreturnofsubprogram}
605 {\doublequote{no return} property of a subprogram}
606 {noreturn attribute} \\
607 \DWATobjectpointerTARG
608 &\livelinki{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}
609 {Object (\texttt{this}, \texttt{self}) pointer of member function}
610 {object (\texttt{this}, \texttt{self}) pointer of member function}\\
612 &\livelinki{chap:DWATorderingarrayrowcolumnordering}
613 {Array row/column ordering}
614 {array row/column ordering}\\
615 \DWATpicturestringTARG
616 &\livelinki{chap:DWATpicturestringpicturestringfornumericstringtype}
617 {Picture string for numeric string type}
618 {picture string for numeric string type} \\
620 &\livelinki{chap:DWATprioritymodulepriority}
624 &\livelinki{chap:DWATproducercompileridentification}
625 {Compiler identification}
626 {compiler identification}\\
628 &\livelinki{chap:DWATprototypedsubroutineprototype}
629 {Subroutine prototype}
630 {subroutine prototype}\\
632 &\livelinki{chap:DWATpurepurepropertyofasubroutine}
633 {Pure property of a subroutine}
634 {pure property of a subroutine} \\
636 &\livelinki{chap:DWATrangesnoncontiguousrangeofcodeaddresses}
637 {Non-contiguous range of code addresses}
638 {non-contiguous range of code addresses} \\
640 &\livelinki{chap:DWATrangesbaseforrangelists}
641 {Base offset for range lists}
644 &\livelinki{chap:DWATrankofdynamicarray}
645 {Dynamic number of array dimensions}
646 {dynamic number of array dimensions} \\
648 &\livelinki{chap:DWATrecursiverecursivepropertyofasubroutine}
649 {Recursive property of a subroutine}
650 {recursive property of a subroutine} \\
652 &\livelink{chap:DWATreferenceofnonstaticmember}
653 {\&-qualified non-static member function} \textit{(\addtoindex{C++})} \\
655 &\livelinki{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}
656 {Subroutine return address save location}
657 {subroutine return address save location} \\
658 \DWATrvaluereferenceTARG
659 &\livelink{chap:DWATrvaluereferenceofnonstaticmember}
660 {\&\&-qualified non-static member function} \textit{(\addtoindex{C++})} \\
663 &\livelinki{chap:DWATsegmentaddressinginformation}
664 {Addressing information}
665 {addressing information} \\
667 &\livelinki{chap:DWATsiblingdebugginginformationentryrelationship}
668 {Debugging information entry relationship}
669 {debugging information entry relationship} \\
671 &\livelinki{chap:DWATsmallscalefactorforfixedpointtype}
672 {Scale factor for fixed-point type}
673 {scale factor for fixed-point type} \\
675 &\livelinki{chap:DWATsignaturetypesignature}
678 \DWATspecificationTARG
679 &\livelinki{chap:DWATspecificationincompletenondefiningorseparatedeclaration}
680 {Incomplete, non-defining, or separate declaration corresponding to a declaration}
681 {incomplete, non-defining, or separate declaration corresponding to a declaration} \\
683 &\livelinki{chap:DWATstartscopeofdeclaration}
684 {Reduced scope of declaration}
685 {reduced scope of declaration} \\*
687 &\livelinki{chap:DWATstaticlinklocationofuplevelframe}
688 {Location of uplevel frame}
689 {location of uplevel frame} \\
691 &\livelinki{chap:DWATstmtlistlinenumberinformationforunit}
692 {Line number information for unit}
693 {line number information for unit}\\
694 \DWATstringlengthTARG
695 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
696 {String length of string type}
697 {string length of string type} \\
698 \DWATstringlengthbitsizeTARG
699 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
700 {Size of string length of string type}
701 {string length of string type!size of} \\
702 \DWATstringlengthbytesizeTARG
703 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
704 {Size of string length of string type}
705 {string length of string type!size of} \\
706 \DWATstroffsetsbaseTARG
707 &\livelinki{chap:DWATstroffsetbaseforindirectstringtable}
708 {Base of string offsets table}
709 {string offsets table} \\
710 \DWATthreadsscaledTARG
711 &\livelink{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}
712 {UPC array bound THREADS scale factor}\\
714 &\livelinki{chap:DWATtrampolinetargetsubroutine}
716 {target subroutine of trampoline} \\
718 &\livelinki{chap:DWATtypeofcallsite}
720 {type!of call site} \\
721 &\livelinki{chap:DWAATtypeofstringtype}
722 {Type of string type components}
723 {type!of string type components} \\
724 &\livelinki{chap:DWATtypetypeofsubroutinereturn}
725 {Type of subroutine return}
726 {type!of subroutine return} \\
727 &\livelinki{chap:DWATtypetypeofdeclaration}
728 {Type of declaration}
729 {type!of declaration} \\
731 &\livelinki{chap:DWATupperboundupperboundofsubrange}
732 {Upper bound of subrange}
733 {upper bound of subrange} \\
735 &\livelinki{chap:DWATuselocationmemberlocationforpointertomembertype}
736 {Member location for pointer to member type}
737 {member location for pointer to member type} \\
738 \DWATuseUTFeightTARG\addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
739 &\livelinki{chap:DWATuseUTF8compilationunitusesutf8strings}
740 {Compilation unit uses UTF-8 strings}
741 {compilation unit uses UTF-8 strings} \\
742 \DWATvariableparameterTARG
743 &\livelinki{chap:DWATvariableparameternonconstantparameterflag}
744 {Non-constant parameter flag}
745 {non-constant parameter flag} \\
747 &\livelinki{chap:DWATvirtualityvirtualityindication}
748 {virtuality attribute}
749 {Virtuality of member function or base class} \\
751 &\livelinki{chap:DWATvisibilityvisibilityofdeclaration}
752 {Visibility of declaration}
753 {visibility of declaration} \\
754 \DWATvtableelemlocationTARG
755 &\livelinki{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}
756 {Virtual function vtable slot}
757 {virtual function vtable slot}\\
760 \addtoindexx{address|see {\textit{also} address class}}
761 \addtoindexx{addrptr|see {\textit{also} addrptr class}}
762 \addtoindexx{block|see {\textit{also} block class}}
763 \addtoindexx{constant|see {\textit{also} constant class}}
764 \addtoindexx{exprloc|see {\textit{also} exprloc class}}
765 \addtoindexx{flag|see {\textit{also} flag class}}
766 \addtoindexx{lineptr|see {\textit{also} lineptr class}}
767 \addtoindexx{loclistptr|see {\textit{also} loclistptr class}}
768 \addtoindexx{macptr|see {\textit{also} macptr class}}
769 \addtoindexx{rangelistptr|see {\textit{also} rangelistptr class}}
770 \addtoindexx{reference|see {\textit{also} reference class}}
771 \addtoindexx{string|see {\textit{also} string class}}
772 \addtoindexx{stroffsetsptr|see {\textit{also} stroffsetsptr class}}
774 \addtoindexx{class of attribute value!address|see {address class}}
775 \addtoindexx{class of attribute value!addrptr|see {addrptr class}}
776 \addtoindexx{class of attribute value!block|see {block class}}
777 \addtoindexx{class of attribute value!constant|see {constant class}}
778 \addtoindexx{class of attribute value!exprloc|see {exprloc class}}
779 \addtoindexx{class of attribute value!flag|see {flag class}}
780 \addtoindexx{class of attribute value!lineptr|see {lineptr class}}
781 \addtoindexx{class of attribute value!loclistptr|see {loclistptr class}}
782 \addtoindexx{class of attribute value!macptr|see {macptr class}}
783 \addtoindexx{class of attribute value!rangelistptr|see {rangelistptr class}}
784 \addtoindexx{class of attribute value!reference|see {reference class}}
785 \addtoindexx{class of attribute value!string|see {string class}}
786 \addtoindexx{class of attribute value!stroffsetsptr|see {stroffsetsptr class}}
789 The permissible values
790 \addtoindexx{attribute value classes}
791 for an attribute belong to one or more classes of attribute
793 Each form class may be represented in one or more ways.
794 For example, some attribute values consist
795 of a single piece of constant data.
796 \doublequote{Constant data}
797 is the class of attribute value that those attributes may have.
798 There are several representations of constant data,
799 including fixed length data of one, two, four, eight or 16 bytes
800 in size, and variable length data).
801 The particular representation for any given instance
802 of an attribute is encoded along with the attribute name as
803 part of the information that guides the interpretation of a
804 debugging information entry.
807 Attribute value forms belong
808 \addtoindexx{tag names!list of}
809 to one of the classes shown in Table \referfol{tab:classesofattributevalue}.
811 \begin{longtable}{l|P{11cm}}
812 \caption{Classes of attribute value}
813 \label{tab:classesofattributevalue} \\
814 \hline \bfseries Attribute Class & \bfseries General Use and Encoding \\ \hline
816 \bfseries Attribute Class & \bfseries General Use and Encoding \\ \hline
818 \hline \emph{Continued on next page}
823 \hypertarget{chap:classaddress}{}
824 \livelinki{datarep:classaddress}{address}{address class}
825 &Refers to some location in the address space of the \mbox{described} program.
828 \hypertarget{chap:classaddrptr}{}
829 \livelinki{datarep:classaddrptr}{addrptr}{addrptr class}
831 Specifies a location in the DWARF section that holds
832 a series of machine address values. Certain attributes use
833 one of these addresses by indexing relative to this location.
836 \hypertarget{chap:classblock}{}
837 \livelinki{datarep:classblock}{block}{block class}
838 & An arbitrary number of uninterpreted bytes of data.
839 The number of data bytes may be implicit from context
840 or explicitly specified by an initial unsigned LEB128 value
841 (see Section \refersec{datarep:variablelengthdata})
842 that precedes that number of data bytes.
845 \hypertarget{chap:classconstant}{}
846 \livelinki{datarep:classconstant}{constant}{constant class}
847 &One, two, four, eight or sixteen
848 bytes of uninterpreted data, or data
849 encoded in the variable length format known as LEB128
850 (see Section \refersec{datarep:variablelengthdata}).
853 \hypertarget{chap:classexprloc}{}
854 \livelinki{datarep:classexprloc}{exprloc}{exprloc class}
855 &A DWARF expression for a value or a location in the
856 address space of the described program.
857 A leading unsigned LEB128 value
858 (see Section \refersec{datarep:variablelengthdata})
859 specifies the number of bytes in the expression.
862 \hypertarget{chap:classflag}{}
863 \livelinki{datarep:classflag}{flag}{flag class}
864 &A small constant that indicates the presence or absence
868 \hypertarget{chap:classlineptr}{}
869 \livelinki{datarep:classlineptr}{lineptr}{lineptr class}
870 &Specifies a location in the DWARF section that holds line
874 \hypertarget{chap:classloclistptr}{}
875 \livelinki{datarep:classloclistptr}{loclistptr}{loclistptr class}
876 &Specifies a location in the DWARF section that holds location
877 lists, which describe objects whose location can change during
881 \hypertarget{chap:classmacptr}{}
882 \livelinki{datarep:classmacptr}{macptr}{macptr class}
884 a location in the DWARF section that holds macro definition
888 \hypertarget{chap:classrangelistptr}{}
889 \livelinki{datarep:classrangelistptr}{rangelistptr}{rangelistptr class}
890 &Specifies a location in the DWARF section that holds
891 non-contiguous address ranges.
894 \hypertarget{chap:classreference}{}
895 \livelinki{datarep:classreference}{reference}{reference class}
896 &Refers to one of the debugging information
897 entries that \mbox{describe} the program. There are four types of
898 \mbox{reference}. The first is an offset relative to the beginning
899 of the \mbox{compilation} unit in which the reference occurs and must
900 refer to an entry within that same compilation unit. The second
901 type of reference is the offset of a debugging \mbox{information}
902 entry in any compilation unit, including one different from
903 the unit containing the reference. The third type of reference
904 is an indirect reference to a
905 \addtoindexx{type signature}
906 type definition using an 8-byte signature
907 for that type. The fourth type of reference is a reference from within the
908 \dotdebuginfo{} section of the executable or shared object file to
909 a debugging information entry in the \dotdebuginfo{} section of
910 a \addtoindex{supplementary object file}.
913 \hypertarget{chap:classstring}{}
914 \livelinki{datarep:classstring}{string}{string class}
915 & A null-terminated sequence of zero or more
916 (non-null) bytes. Data in this class are generally
917 printable strings. Strings may be represented directly in
918 the debugging \mbox{information} entry or as an offset in a separate
922 \hypertarget{chap:classstroffsetsptr}{}
923 \livelinki{datarep:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class}
924 &Specifies a location in the DWARF section that holds
925 a series of offsets into the DWARF section that holds strings.
926 Certain attributes use one of these offsets by indexing
927 relative to this location. The resulting offset is then
928 used to index into the DWARF string section.
935 \section{Relationship of Debugging Information Entries}
936 \label{chap:relationshipofdebugginginformationentries}
938 A variety of needs can be met by permitting a single
939 \addtoindexx{debugging information entry!ownership relation}
940 debugging information entry to \doublequote{own} an arbitrary number
941 of other debugging entries and by permitting the same debugging
942 information entry to be one of many owned by another debugging
944 This makes it possible, for example, to
945 describe the static \livelink{chap:lexicalblock}{block} structure
946 within a source file,
947 to show the members of a structure, union, or class, and to
948 associate declarations with source files or source files
949 with shared object files.
953 The ownership relationship
954 \addtoindexx{debugging information entry!ownership relation}
956 information entries is achieved naturally because the debugging
957 information is represented as a tree. The nodes of the tree
958 are the debugging information entries themselves.
959 The child entries of any node are exactly those debugging information
960 entries owned by that node.
963 While the ownership relation
964 of the debugging information entries is represented as a
965 tree, other relations among the entries exist, for example,
966 a reference from an entry representing a variable to another
967 entry representing the type of that variable.
969 relations are taken into account, the debugging entries
970 form a graph, not a tree.
974 The tree itself is represented
975 by flattening it in prefix order.
976 Each debugging information
977 entry is defined either to have child entries or not to have
978 child entries (see Section \refersec{datarep:abbreviationstables}).
979 If an entry is defined not
980 to have children, the next physically succeeding entry is a
982 If an entry is defined to have children, the next
983 physically succeeding entry is its first child.
985 children are represented as siblings of the first child.
986 A chain of sibling entries is terminated by a null entry.
988 In cases where a producer of debugging information feels that
989 it\hypertarget{chap:DWATsiblingdebugginginformationentryrelationship}{}
990 will be important for consumers of that information to
991 quickly scan chains of sibling entries, while ignoring the
992 children of individual siblings, that producer may attach a
993 \addtoindexx{sibling attribute}
994 \DWATsiblingDEFN{} attribute
995 to any debugging information entry.
996 The value of this attribute is a reference to the sibling entry
997 of the entry to which the attribute is attached.
999 \section{Target Addresses}
1000 \label{chap:targetaddressableunitsandaddresses}
1001 \label{chap:targetaddresses}
1002 \addtoindexx{size of an address}
1003 \addtoindexx{size of an address|see{\textit{also} \texttt{address\_size}}}
1004 \addtoindexx{address size|see{size of an address}}
1005 \addtoindexx{address size|see{\textit{also} \texttt{address\_size}}}
1007 Addresses, bytes and bits in DWARF use the numbering and direction
1008 conventions that are appropriate to the current language on
1011 Many places in this document refer to the size of an address
1012 on the target architecture (or equivalently, target machine)
1013 to which a DWARF description applies. For processors which
1014 can be configured to have different address sizes or different
1015 instruction sets, the intent is to refer to the configuration
1016 which is either the default for that processor or which is
1017 specified by the object file or executable file which contains
1018 the DWARF information.
1021 For example, if a particular target architecture supports
1022 both 32-bit and 64-bit addresses, the compiler will generate
1023 an object file which specifies that it contains executable
1024 code generated for one or the other of these
1025 \addtoindexx{size of an address}
1027 that case, the DWARF debugging information contained in this
1028 object file will use the same address size.}
1031 \section{DWARF Expressions}
1032 \label{chap:dwarfexpressions}
1033 DWARF expressions describe how to compute a value or
1034 specify a location. They are expressed in
1035 terms of DWARF operations that operate on a stack of values.
1037 A DWARF expression is encoded as a stream of operations,
1038 each consisting of an opcode followed by zero or more literal
1039 operands. The number of operands is implied by the opcode.
1042 general operations that are defined here, operations that are
1043 specific to location descriptions are defined in
1044 Section \refersec{chap:locationdescriptions}.
1046 \subsection{General Operations}
1047 \label{chap:generaloperations}
1048 Each general operation represents a postfix operation on
1049 a simple stack machine.
1050 Each element of the stack has a type and a value, and can represent
1051 a value of any supported base type of the target machine. Instead of
1052 a base type, elements can have a
1053 \definitionx{special address type}\livetarg{chap:specialaddresstype}{},
1054 which is an integral type that has the
1055 \addtoindex{size of an address} on the target machine and
1056 unspecified signedness. The value on the top of the stack after
1057 \doublequote{executing} the
1058 \addtoindex{DWARF expression}
1060 \addtoindexx{DWARF expression|see{\textit{also} location description}}
1061 taken to be the result (the address of the object, the
1062 value of the array bound, the length of a dynamic string,
1063 the desired value itself, and so on).
1067 \subsubsection{Literal Encodings}
1068 \label{chap:literalencodings}
1070 \addtoindexx{DWARF expression!literal encodings}
1071 following operations all push a value onto the DWARF
1073 \addtoindexx{DWARF expression!stack operations}
1074 Operations other than \DWOPconsttype{} push a value with the
1075 \specialaddresstype, and if the value of a constant in one of these
1076 operations is larger than can be stored in a single stack element,
1077 the value is truncated to the element size and the low-order bits
1078 are pushed on the stack.
1079 \begin{enumerate}[1. ]
1080 \itembfnl{\DWOPlitzeroTARG, \DWOPlitoneTARG, \dots, \DWOPlitthirtyoneTARG}
1081 The \DWOPlitnTARG{} operations encode the unsigned literal values
1082 from 0 through 31, inclusive.
1084 \itembfnl{\DWOPaddrTARG}
1085 The \DWOPaddrNAME{} operation has a single operand that encodes
1086 a machine address and whose size is the \addtoindex{size of an address}
1087 on the target machine.
1089 \itembfnl{\DWOPconstoneuTARG, \DWOPconsttwouTARG, \DWOPconstfouruTARG, \DWOPconsteightuTARG}
1091 The single operand of a \DWOPconstnuNAME{} operation provides a 1,
1092 2, 4, or 8-byte unsigned integer constant, respectively.
1094 \itembfnl{\DWOPconstonesTARG, \DWOPconsttwosTARG, \DWOPconstfoursTARG, \DWOPconsteightsTARG}
1095 The single operand of a \DWOPconstnsNAME{} operation provides a 1,
1096 2, 4, or 8-byte signed integer constant, respectively.
1099 \itembfnl{\DWOPconstuTARG}
1100 The single operand of the \DWOPconstuNAME{} operation provides
1101 an unsigned LEB128\addtoindexx{LEB128!unsigned} integer constant.
1103 \itembfnl{\DWOPconstsTARG}
1104 The single operand of the \DWOPconstsNAME{} operation provides
1105 a signed LEB128\addtoindexx{LEB128!unsigned} integer constant.
1108 \itembfnl{\DWOPaddrxTARG}
1109 The \DWOPaddrxNAME{} operation has a single operand that
1110 encodes an unsigned LEB128\addtoindexx{LEB128!unsigned} value,
1111 which is a zero-based index into the \dotdebugaddr{} section,
1112 where a machine address is stored.
1113 This index is relative to the value of the
1114 \DWATaddrbase{} attribute of the associated compilation unit.
1116 \itembfnl{\DWOPconstxTARG}
1117 The \DWOPconstxNAME{} operation has a single operand that
1118 encodes an unsigned LEB128\addtoindexx{LEB128!unsigned} value,
1119 which is a zero-based
1120 index into the \dotdebugaddr{} section, where a constant, the
1121 size of a machine address, is stored.
1122 This index is relative to the value of the
1123 \DWATaddrbase{} attribute of the associated compilation unit.
1126 \textit{The \DWOPconstxNAME{} operation is provided for constants that
1127 require link-time relocation but should not be
1128 interpreted by the consumer as a relocatable address
1129 (for example, offsets to thread-local storage).}
1132 \itembfnl{\DWOPconsttypeTARG}
1133 The \DWOPconsttypeNAME{} operation takes three operands. The first operand
1134 is an unsigned LEB128 integer that represents the offset of a debugging
1135 information entry in the current compilation unit, which must be a
1136 \DWTAGbasetype{} entry that provides the type of the constant provided. The
1137 second operand is 1-byte unsigned integer that specifies the size of the
1138 constant value, which is the same as the size of the base type referenced
1139 by the first operand. The third operand is a
1140 sequence of bytes of the given size that is
1141 interpreted as a value of the referenced type.
1143 \textit{While the size of the constant can be inferred from the base type
1144 definition, it is encoded explicitly into the operation so that the
1145 operation can be parsed easily without reference to the \dotdebuginfo{}
1151 \subsubsection{Register Values}
1152 \label{chap:registervalues}
1153 The following operations push a value onto the stack that is either the
1154 contents of a register or the result of adding the contents of a register
1155 to a given signed offset.
1156 \addtoindexx{DWARF expression!register based addressing}
1157 \DWOPregvaltype{} pushes the contents
1158 of the register together with the given base type, while the other operations
1159 push the result of adding the contents of a register to a given
1160 signed offset together with the \specialaddresstype.
1163 \begin{enumerate}[1. ]
1164 \itembfnl{\DWOPfbregTARG}
1165 The \DWOPfbregNAME{} operation provides a
1166 signed LEB128\addtoindexx{LEB128!signed} offset
1167 from the address specified by the location description in the
1168 \DWATframebase{} attribute of the current function.
1170 \textit{This is typically a stack pointer register plus or minus some offset.}
1172 \itembfnl{\DWOPbregzeroTARG, \DWOPbregoneTARG, \dots, \DWOPbregthirtyoneTARG}
1173 The single operand of the \DWOPbregnTARG{}
1175 a signed LEB128\addtoindexx{LEB128!signed} offset from
1176 the contents of the specified register.
1178 \itembfnl{\DWOPbregxTARG}
1179 The \DWOPbregxNAME{} operation provides the sum of two values specified
1180 by its two operands. The first operand is a register number
1181 which is specified by an unsigned LEB128\addtoindexx{LEB128!unsigned}
1182 number. The second operand is a signed LEB128\addtoindexx{LEB128!signed} offset.
1185 \itembfnl{\DWOPregvaltypeTARG}
1186 The \DWOPregvaltypeNAME{} operation provides the contents of
1187 a given register interpreted as a value of a given type. The first
1188 operand is an unsigned LEB128\addtoindexx{LEB128!unsigned} number,
1189 which identifies a register whose contents is to
1190 be pushed onto the stack. The second operand is an
1191 unsigned LEB128\addtoindexx{LEB128!unsigned} number
1192 that represents the offset of a debugging information entry in the current
1193 compilation unit, which must be a \DWTAGbasetype{} entry that provides the
1194 type of the value contained in the specified register.
1199 \subsubsection{Stack Operations}
1200 \label{chap:stackoperations}
1202 \addtoindexx{DWARF expression!stack operations}
1203 operations manipulate the DWARF stack. Operations
1204 that index the stack assume that the top of the stack (most
1205 recently added entry) has index 0.
1207 Each entry on the stack has an associated type.
1210 \begin{enumerate}[1. ]
1211 \itembfnl{\DWOPdupTARG}
1212 The \DWOPdupNAME{} operation duplicates the value (including its
1213 type identifier) at the top of the stack.
1215 \itembfnl{\DWOPdropTARG}
1216 The \DWOPdropNAME{} operation pops the value (including its type
1217 identifier) at the top of the stack.
1219 \itembfnl{\DWOPpickTARG}
1220 The single operand of the \DWOPpickNAME{} operation provides a
1221 1-byte index. A copy of the stack entry (including its
1222 type identifier) with the specified
1223 index (0 through 255, inclusive) is pushed onto the stack.
1225 \itembfnl{\DWOPoverTARG}
1226 The \DWOPoverNAME{} operation duplicates the entry currently second
1227 in the stack at the top of the stack.
1228 This is equivalent to a
1229 \DWOPpick{} operation, with index 1.
1232 \itembfnl{\DWOPswapTARG}
1233 The \DWOPswapNAME{} operation swaps the top two stack entries.
1234 The entry at the top of the stack (including its type identifier)
1235 becomes the second stack entry, and the second entry (including
1236 its type identifier) becomes the top of the stack.
1238 \itembfnl{\DWOProtTARG}
1239 The \DWOProtNAME{} operation rotates the first three stack
1240 entries. The entry at the top of the stack (including its
1241 type identifier) becomes the third stack entry, the second
1242 entry (including its type identifier) becomes the top of
1243 the stack, and the third entry (including its type identifier)
1244 becomes the second entry.
1246 \itembfnl{\DWOPderefTARG}
1247 The \DWOPderefNAME{} operation pops the top stack entry and
1248 treats it as an address. The popped value must have an integral type.
1249 The value retrieved from that address is pushed,
1250 and has the \specialaddresstype{}.
1251 The size of the data retrieved from the
1252 \addtoindexi{dereferenced}{address!dereference operator}
1253 address is the \addtoindex{size of an address} on the target machine.
1256 \itembfnl{\DWOPderefsizeTARG}
1257 The \DWOPderefsizeNAME{} operation behaves like the
1259 operation: it pops the top stack entry and treats it as an
1260 address. The popped value must have an integral type.
1261 The value retrieved from that address is pushed,
1262 and has the \specialaddresstype{}.
1263 In the \DWOPderefsizeNAME{} operation, however, the size in bytes
1264 of the data retrieved from the dereferenced address is
1265 specified by the single operand. This operand is a 1-byte
1266 unsigned integral constant whose value may not be larger
1267 than the size of the \specialaddresstype. The data
1268 retrieved is zero extended to the size of an address on the
1269 target machine before being pushed onto the expression stack.
1271 \itembfnl{\DWOPdereftypeTARG}
1272 The \DWOPdereftypeNAME{} operation behaves like the \DWOPderefsize{} operation:
1273 it pops the top stack entry and treats it as an address.
1274 The popped value must have an integral type.
1275 The value retrieved from that address is pushed together with a type identifier.
1276 In the \DWOPdereftypeNAME{} operation, the size in
1277 bytes of the data retrieved from the dereferenced address is specified by
1278 the first operand. This operand is a 1-byte unsigned integral constant whose
1279 value which is the same as the size of the base type referenced
1280 by the second operand.
1281 The second operand is an unsigned LEB128 integer that
1282 represents the offset of a debugging information entry in the current
1283 compilation unit, which must be a \DWTAGbasetype{} entry that provides the
1284 type of the data pushed.
1286 \textit{While the size of the pushed value could be inferred from the base
1287 type definition, it is encoded explicitly into the operation so that the
1288 operation can be parsed easily without reference to the \dotdebuginfo{}
1292 \itembfnl{\DWOPxderefTARG}
1293 The \DWOPxderefNAME{} operation provides an extended dereference
1294 mechanism. The entry at the top of the stack is treated as an
1295 address. The second stack entry is treated as an \doublequote{address
1296 space identifier} for those architectures that support
1297 \addtoindexi{multiple}{address space!multiple}
1299 Both of these entries must have integral type identifiers.
1300 The top two stack elements are popped,
1301 and a data item is retrieved through an implementation-defined
1302 address calculation and pushed as the new stack top together with the
1303 \specialaddresstype{} identifier.
1304 The size of the data retrieved from the
1305 \addtoindexi{dereferenced}{address!dereference operator}
1306 address is the size of the \specialaddresstype.
1309 \itembfnl{\DWOPxderefsizeTARG}
1310 The \DWOPxderefsizeNAME{} operation behaves like the
1311 \DWOPxderef{} operation. The entry at the top of the stack is
1312 treated as an address. The second stack entry is treated as
1313 an \doublequote{address space identifier} for those architectures
1315 \addtoindexi{multiple}{address space!multiple}
1317 Both of these entries must have integral type identifiers.
1319 elements are popped, and a data item is retrieved through an
1320 implementation\dash defined address calculation and pushed as the
1321 new stack top. In the \DWOPxderefsizeNAME{} operation, however,
1322 the size in bytes of the data retrieved from the
1323 \addtoindexi{dereferenced}{address!dereference operator}
1324 address is specified by the single operand. This operand is a
1325 1-byte unsigned integral constant whose value may not be larger
1326 than the \addtoindex{size of an address} on the target machine. The data
1327 retrieved is zero extended to the \addtoindex{size of an address} on the
1328 target machine before being pushed onto the expression stack together
1329 with the \specialaddresstype{} identifier.
1331 \itembfnl{\DWOPxdereftypeTARG}
1332 The \DWOPxdereftypeNAME{} operation behaves like the \DWOPxderefsize{}
1333 operation: it pops the top two stack entries, treats them as an address and
1334 an address space identifier, and pushes the value retrieved. In the
1335 \DWOPxdereftypeNAME{} operation, the size in bytes of the data retrieved from
1336 the dereferenced address is specified by the first operand. This operand is
1337 a 1-byte unsigned integral constant whose value
1338 value which is the same as the size of the base type referenced
1339 by the second operand. The second
1340 operand is an unsigned LEB128 integer that represents the offset of a
1341 debugging information entry in the current compilation unit, which must be a
1342 \DWTAGbasetype{} entry that provides the type of the data pushed.
1345 \itembfnl{\DWOPpushobjectaddressTARG}
1346 The \DWOPpushobjectaddressNAME{}
1347 operation pushes the address
1348 of the object currently being evaluated as part of evaluation
1349 of a user presented expression. This object may correspond
1350 to an independent variable described by its own debugging
1351 information entry or it may be a component of an array,
1352 structure, or class whose address has been dynamically
1353 determined by an earlier step during user expression
1356 \textit{This operator provides explicit functionality
1357 (especially for arrays involving descriptors) that is analogous
1358 to the implicit push of the base
1359 \addtoindexi{address}{address!implicit push of base}
1360 of a structure prior to evaluation of a
1361 \DWATdatamemberlocation{}
1362 to access a data member of a structure. For an example, see
1363 Appendix \refersec{app:aggregateexamples}.}
1366 \itembfnl{\DWOPformtlsaddressTARG}
1367 The \DWOPformtlsaddressNAME{}
1368 operation pops a value from the stack, which must have an
1369 integral type identifier, translates this
1370 value into an address in the
1371 \addtoindex{thread-local storage}
1372 for a thread, and pushes the address
1373 onto the stack together with the \specialaddresstype{} identifier.
1374 The meaning of the value on the top of the stack prior to this
1375 operation is defined by the run-time environment. If the run-time
1376 environment supports multiple thread-local storage
1377 \nolink{blocks} for a single thread, then the \nolink{block}
1378 corresponding to the executable or shared
1379 library containing this DWARF expression is used.
1381 \textit{Some implementations of
1382 \addtoindex{C}, \addtoindex{C++}, \addtoindex{Fortran}, and other
1383 languages, support a
1384 thread-local storage class. Variables with this storage class
1385 have distinct values and addresses in distinct threads, much
1386 as automatic variables have distinct values and addresses in
1387 each function invocation. Typically, there is a single \nolink{block}
1388 of storage containing all thread\dash local variables declared in
1389 the main executable, and a separate \nolink{block} for the variables
1390 declared in each shared library. Each
1391 thread\dash local variable can then be accessed in its block using an
1392 identifier. This identifier is typically an offset into the block and
1393 pushed onto the DWARF stack by one of the
1394 \DWOPconstnx{} operations prior to the
1395 \DWOPformtlsaddress{} operation.
1396 Computing the address of
1397 the appropriate \nolink{block} can be complex (in some cases, the
1398 compiler emits a function call to do it), and difficult
1399 to describe using ordinary DWARF location descriptions.
1400 Instead of forcing complex thread-local storage calculations into
1401 the DWARF expressions, the \DWOPformtlsaddress{} allows the consumer
1402 to perform the computation based on the run-time environment.}
1405 \itembfnl{\DWOPcallframecfaTARG}
1406 The \DWOPcallframecfaNAME{}
1407 operation pushes the value of the
1408 CFA, obtained from the Call Frame Information
1409 (see Section \refersec{chap:callframeinformation}).
1411 \textit{Although the value of \DWATframebase{}
1412 can be computed using other DWARF expression operators,
1413 in some cases this would require an extensive location list
1414 because the values of the registers used in computing the
1415 CFA change during a subroutine. If the
1416 Call Frame Information
1417 is present, then it already encodes such changes, and it is
1418 space efficient to reference that.}
1421 \textit{Examples illustrating many of these stack operations are
1422 found in Appendix \refersec{app:dwarfstackoperationexamples}.}
1425 \subsubsection{Arithmetic and Logical Operations}
1426 \addtoindexx{DWARF expression!arithmetic operations}
1427 \addtoindexx{DWARF expression!logical operations}
1428 The following provide arithmetic and logical operations.
1429 Operands of an operation with two operands
1430 must have the same type,
1431 either the same base type or both the \specialaddresstype.
1432 The result of the operation which is pushed back has the same type
1433 as the type of the operand(s).
1435 If the type of the operands is the \specialaddresstype,
1436 except as otherwise specified, the arithmetic operations
1437 perform addressing arithmetic, that is, unsigned arithmetic that is performed
1438 modulo one plus the largest representable address (for example, 0x100000000
1439 when the \addtoindex{size of an address} is 32 bits).
1441 Operations other than \DWOPabs{},
1442 \DWOPdiv{}, \DWOPminus{}, \DWOPmul{}, \DWOPneg{} and \DWOPplus{}
1443 require integral types of the operand (either integral base type
1444 or the \specialaddresstype). Operations do not cause an exception
1448 \begin{enumerate}[1. ]
1449 \itembfnl{\DWOPabsTARG}
1450 The \DWOPabsNAME{} operation pops the top stack entry, interprets
1451 it as a signed value and pushes its absolute value. If the
1452 absolute value cannot be represented, the result is undefined.
1455 \itembfnl{\DWOPandTARG}
1456 The \DWOPandNAME{} operation pops the top two stack values, performs
1457 a bitwise and operation on the two, and pushes the result.
1459 \itembfnl{\DWOPdivTARG}
1460 The \DWOPdivNAME{} operation pops the top two stack values, divides the former second entry by
1461 the former top of the stack using signed division, and pushes the result.
1463 \itembfnl{\DWOPminusTARG}
1464 The \DWOPminusNAME{} operation pops the top two stack values, subtracts the former top of the
1465 stack from the former second entry, and pushes the result.
1467 \itembfnl{\DWOPmodTARG}
1468 The \DWOPmodNAME{} operation pops the top two stack values and pushes the result of the
1469 calculation: former second stack entry modulo the former top of the stack.
1472 \itembfnl{\DWOPmulTARG}
1473 The \DWOPmulNAME{} operation pops the top two stack entries, multiplies them together, and
1477 \itembfnl{\DWOPnegTARG}
1478 The \DWOPnegNAME{} operation pops the top stack entry, interprets
1479 it as a signed value and pushes its negation. If the negation
1480 cannot be represented, the result is undefined.
1482 \itembfnl{\DWOPnotTARG}
1483 The \DWOPnotNAME{} operation pops the top stack entry, and pushes
1484 its bitwise complement.
1486 \itembfnl{\DWOPorTARG}
1487 The \DWOPorNAME{} operation pops the top two stack entries, performs
1488 a bitwise or operation on the two, and pushes the result.
1490 \itembfnl{\DWOPplusTARG}
1491 The \DWOPplusNAME{} operation pops the top two stack entries,
1492 adds them together, and pushes the result.
1495 \itembfnl{\DWOPplusuconstTARG}
1496 The \DWOPplusuconstNAME{} operation pops the top stack entry,
1497 adds it to the unsigned LEB128\addtoindexx{LEB128!unsigned}
1499 interpreted as the same type as the operand popped from the
1500 top of the stack and pushes the result.
1502 \textit{This operation is supplied specifically to be
1503 able to encode more field offsets in two bytes than can be
1505 \doublequote{\DWOPlitn~\DWOPplus.}}
1508 \itembfnl{\DWOPshlTARG}
1509 The \DWOPshlNAME{} operation pops the top two stack entries,
1510 shifts the former second entry left (filling with zero bits)
1511 by the number of bits specified by the former top of the stack,
1512 and pushes the result.
1514 \itembfnl{\DWOPshrTARG}
1515 The \DWOPshrNAME{} operation pops the top two stack entries,
1516 shifts the former second entry right logically (filling with
1517 zero bits) by the number of bits specified by the former top
1518 of the stack, and pushes the result.
1521 \itembfnl{\DWOPshraTARG}
1522 The \DWOPshraNAME{} operation pops the top two stack entries,
1523 shifts the former second entry right arithmetically (divide
1524 the magnitude by 2, keep the same sign for the result) by
1525 the number of bits specified by the former top of the stack,
1526 and pushes the result.
1528 \itembfnl{\DWOPxorTARG}
1529 The \DWOPxorNAME{} operation pops the top two stack entries,
1530 performs a bitwise exclusive\dash or operation on the two, and
1535 \subsubsection{Control Flow Operations}
1536 \label{chap:controlflowoperations}
1538 \addtoindexx{DWARF expression!control flow operations}
1539 following operations provide simple control of the flow of a DWARF expression.
1540 \begin{enumerate}[1. ]
1541 \itembfnl{\DWOPleTARG, \DWOPgeTARG, \DWOPeqTARG, \DWOPltTARG, \DWOPgtTARG, \DWOPneTARG}
1542 The six relational operators each:
1544 \item pop the top two stack values, which have the same type,
1545 either the same base type or both the \specialaddresstype,
1547 \item compare the operands:
1549 \textless~former second entry~\textgreater \textless~relational operator~\textgreater \textless~former top entry~\textgreater
1551 \item push the constant value 1 onto the stack
1552 if the result of the operation is true or the
1553 constant value 0 if the result of the operation is false.
1554 The pushed value has the \specialaddresstype.
1557 If the operands have the \specialaddresstype, the comparisons
1558 are performed as signed operations.
1561 \itembfnl{\DWOPskipTARG}
1562 \DWOPskipNAME{} is an unconditional branch. Its single operand
1563 is a 2-byte signed integer constant. The 2-byte constant is
1564 the number of bytes of the DWARF expression to skip forward
1565 or backward from the current operation, beginning after the
1568 \itembfnl{\DWOPbraTARG}
1569 \DWOPbraNAME{} is a conditional branch. Its single operand is a
1570 2-byte signed integer constant. This operation pops the
1571 top of stack. If the value popped is not the constant 0,
1572 the 2-byte constant operand is the number of bytes of the
1573 DWARF expression to skip forward or backward from the current
1574 operation, beginning after the 2-byte constant.
1576 % The following item does not correctly hyphenate leading
1577 % to an overfull hbox and a visible artifact.
1578 % So we use \- to suggest hyphenation in this rare situation.
1579 \itembfnl{\DWOPcalltwoTARG, \DWOPcallfourTARG, \DWOPcallrefTARG}
1582 and \DWOPcallrefNAME{} perform
1583 DWARF procedure calls during evaluation of a DWARF expression or
1584 location description.
1585 For \DWOPcalltwoNAME{} and \DWOPcallfourNAME{},
1586 the operand is the 2\dash~ or 4-byte unsigned offset, respectively,
1587 of a debugging information entry in the current compilation
1588 unit. The \DWOPcallrefNAME{} operator has a single operand. In the
1589 \thirtytwobitdwarfformat,
1590 the operand is a 4-byte unsigned value;
1591 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1592 (see Section \referfol{datarep:32bitand64bitdwarfformats}).
1593 The operand is used as the offset of a
1594 debugging information entry in a
1596 section which may be contained in an executable or shared object file
1597 other than that containing the operator. For references from
1598 one executable or shared object file to another, the relocation
1599 must be performed by the consumer.
1601 \textit{Operand interpretation of
1602 \DWOPcalltwo, \DWOPcallfour{} and \DWOPcallref{} is exactly like
1603 that for \DWFORMreftwo, \DWFORMreffour{} and \DWFORMrefaddr,
1605 (see Section \refersec{datarep:attributeencodings}).}
1607 These operations transfer control of DWARF expression evaluation to
1608 \addtoindexx{location attribute}
1611 attribute of the referenced debugging information entry. If
1612 there is no such attribute, then there is no effect. Execution
1613 of the DWARF expression of
1614 \addtoindexx{location attribute}
1616 \DWATlocation{} attribute may add
1617 to and/or remove from values on the stack. Execution returns
1618 to the point following the call when the end of the attribute
1619 is reached. Values on the stack at the time of the call may be
1620 used as parameters by the called expression and values left on
1621 the stack by the called expression may be used as return values
1622 by prior agreement between the calling and called expressions.
1625 \subsubsection{Type Conversions}
1626 \label{chap:typeconversions}
1627 The following operations provides for explicit type conversion.
1629 \begin{enumerate}[1. ]
1630 \itembfnl{\DWOPconvertTARG}
1631 The \DWOPconvertNAME{} operation pops the top stack entry, converts it to a
1632 different type, then pushes the result. It takes one operand, which is an
1633 unsigned LEB128 integer that represents the offset of a debugging
1634 information entry in the current compilation unit, or value 0 which
1635 represents the \specialaddresstype. If the operand is non-zero, the
1636 referenced entry must be a \DWTAGbasetype{} entry that provides the type
1637 to which the value is converted.
1639 \itembfnl{\DWOPreinterpretTARG}
1640 The \DWOPreinterpretNAME{} operation pops the top stack entry, reinterprets
1641 the bits in its value as a value of a different type, then pushes the
1642 result. It takes one operand, which is an unsigned LEB128 integer that
1643 represents the offset of a debugging information entry in the current
1644 compilation unit, or value 0 which represents the \specialaddresstype.
1645 If the operand is non-zero, the referenced entry must be a
1646 \DWTAGbasetype{} entry that provides the type to which the value is converted.
1647 The type of the operand and result type should have the same size in bits.
1652 \subsubsection{Special Operations}
1653 \label{chap:specialoperations}
1655 \addtoindexx{DWARF expression!special operations}
1656 are these special operations currently defined:
1657 \begin{enumerate}[1. ]
1658 \itembfnl{\DWOPnopNAME}
1659 The \DWOPnopTARG{} operation is a place holder. It has no effect
1660 on the location stack or any of its values.
1662 \itembfnl{\DWOPentryvalueNAME}
1663 The \DWOPentryvalueTARG{} operation pushes
1665 the value that the described location held
1667 upon entering the current subprogram. It has two operands: an
1668 unsigned LEB128\addtoindexx{LEB128!unsigned} length, followed by
1669 a block containing a DWARF expression or a register location description
1670 (see Section \refersec{chap:registerlocationdescriptions}).
1671 The length operand specifies the length
1672 in bytes of the block. If the block contains a register location
1673 description, \DWOPentryvalueNAME{} pushes the value that register had upon
1674 entering the current subprogram. If the block contains a DWARF expression,
1675 the DWARF expression is evaluated as if it has been evaluated upon entering
1676 the current subprogram. The DWARF expression
1677 assumes no values are present on the DWARF stack initially and results
1678 in exactly one value being pushed on the DWARF stack when completed.
1680 \DWOPpushobjectaddress{} is not meaningful inside of this DWARF operation.
1683 The values needed to evaluate \DWOPentryvalueNAME{} could be obtained in
1684 several ways. The consumer could suspend execution on entry to the
1685 subprogram, record values needed by \DWOPentryvalueNAME{} expressions within
1686 the subprogram, and then continue; when evaluating \DWOPentryvalueNAME{},
1687 the consumer would use these recorded values rather than the current
1688 values. Or, when evaluating \DWOPentryvalueNAME{}, the consumer could
1692 using the Call Frame Information
1693 (see Section \refersec{chap:callframeinformation})
1694 to recover register values that might have been clobbered since the
1695 subprogram entry point.}
1700 \section{Location Descriptions}
1701 \label{chap:locationdescriptions}
1702 \textit{Debugging information
1703 \addtoindexx{location description}
1705 \addtoindexx{location description|see{\textit{also} DWARF expression}}
1706 provide consumers a way to find
1707 the location of program variables, determine the bounds
1708 of dynamic arrays and strings, and possibly to find the
1709 base address of a subroutine\textquoteright s stack frame or the return
1710 address of a subroutine. Furthermore, to meet the needs of
1711 recent computer architectures and optimization techniques,
1712 debugging information must be able to describe the location of
1713 an object whose location changes over the object\textquoteright s lifetime.}
1715 Information about the location of program objects is provided
1716 by location descriptions. Location descriptions can be either
1718 \begin{enumerate}[1. ]
1719 \item \textit{Single location descriptions},
1721 \addtoindexx{location description!single}
1723 \addtoindexx{single location description}
1724 a language independent representation of
1725 addressing rules of arbitrary complexity built from
1726 DWARF expressions (See Section \refersec{chap:dwarfexpressions})
1728 DWARF operations specific to describing locations. They are
1729 sufficient for describing the location of any object as long
1730 as its lifetime is either static or the same as the
1731 \livelink{chap:lexicalblock}{lexical block} that owns it,
1732 and it does not move during its lifetime.
1736 \item \textit{Location lists}, which are used to
1737 \addtoindexx{location list}
1739 \addtoindexx{location description!use in location list}
1740 objects that have a limited lifetime or change their location
1741 during their lifetime. Location lists are described in
1742 Section \refersec{chap:locationlists} below.
1746 Location descriptions are distinguished in a context sensitive
1747 manner. As the value of an attribute, a location description
1749 \addtoindexx{exprloc class}
1750 class \livelink{chap:classexprloc}{exprloc}
1751 and a location list is encoded
1752 using class \livelink{chap:classloclistptr}{loclistptr}
1754 \addtoindex{loclistptr}
1755 serves as an offset into a
1757 \addtoindexx{location list}
1758 location list table).
1761 \subsection{Single Location Descriptions}
1762 A single location description is either:
1763 \begin{enumerate}[1. ]
1764 \item A simple location description, representing an object
1765 \addtoindexx{location description!simple}
1767 \addtoindexx{simple location description}
1768 exists in one contiguous piece at the given location, or
1769 \item A composite location description consisting of one or more
1770 \addtoindexx{location description!composite}
1771 simple location descriptions, each of which is followed by
1772 one composition operation. Each simple location description
1773 describes the location of one piece of the object; each
1774 composition operation describes which part of the object is
1775 located there. Each simple location description that is a
1776 DWARF expression is evaluated independently of any others.
1781 \subsubsection{Simple Location Descriptions}
1783 \addtoindexx{location description!simple}
1784 simple location description consists of one
1785 contiguous piece or all of an object or value.
1788 \subsubsubsection{Empty Location Descriptions}
1789 An \addtoindex{empty location description}
1790 consists of a DWARF expression
1791 \addtoindexx{location description!empty}
1792 containing no operations. It represents a piece or all of an
1793 object that is present in the source but not in the object code
1794 (perhaps due to optimization).
1796 \subsubsubsection{Memory Location Descriptions}
1798 \addtoindexx{location description!memory}
1799 memory location description
1800 \addtoindexx{memory location description}
1801 consists of a non-empty DWARF
1803 Section \refersec{chap:dwarfexpressions}),
1804 whose value is the address of
1805 a piece or all of an object or other entity in memory.
1807 \subsubsubsection{Register Location Descriptions}
1808 \label{chap:registerlocationdescriptions}
1809 A register location description consists of a register name
1810 operation, which represents a piece or all of an object
1811 located in a given register.
1813 \textit{Register location descriptions describe an object
1814 (or a piece of an object) that resides in a register, while
1815 the opcodes listed in
1816 Section \refersec{chap:registervalues}
1817 are used to describe an object (or a piece of
1818 an object) that is located in memory at an address that is
1819 contained in a register (possibly offset by some constant). A
1820 register location description must stand alone as the entire
1821 description of an object or a piece of an object.
1824 The following DWARF operations can be used to
1825 specify a register location.
1827 \textit{Note that the register number represents a DWARF specific
1828 mapping of numbers onto the actual registers of a given
1829 architecture. The mapping should be chosen to gain optimal
1830 density and should be shared by all users of a given
1831 architecture. It is recommended that this mapping be defined
1832 by the ABI authoring committee for each architecture.
1834 \begin{enumerate}[1. ]
1835 \itembfnl{\DWOPregzeroTARG, \DWOPregoneTARG, ..., \DWOPregthirtyoneTARG}
1836 The \DWOPregnTARG{} operations encode the names of up to 32
1837 registers, numbered from 0 through 31, inclusive. The object
1838 addressed is in register \textit{n}.
1841 \itembfnl{\DWOPregxTARG}
1842 The \DWOPregxNAME{} operation has a single
1843 unsigned LEB128\addtoindexx{LEB128!unsigned} literal
1844 operand that encodes the name of a register.
1848 \textit{These operations name a register location. To
1849 fetch the contents of a register, it is necessary to use
1850 one of the register based addressing operations, such as
1852 (Section \refersec{chap:registervalues})}.
1854 \subsubsubsection{Implicit Location Descriptions}
1855 An \addtoindex{implicit location description}
1856 represents a piece or all
1857 \addtoindexx{location description!implicit}
1858 of an object which has no actual location but whose contents
1859 are nonetheless either known or known to be undefined.
1861 The following DWARF operations may be used to specify a value
1862 that has no location in the program but is a known constant
1863 or is computed from other locations and values in the program.
1864 \begin{enumerate}[1. ]
1865 \itembfnl{\DWOPimplicitvalueTARG}
1866 The \DWOPimplicitvalueNAME{} operation specifies an immediate value
1867 using two operands: an unsigned LEB128\addtoindexx{LEB128!unsigned}
1868 length, followed by a
1869 sequence of bytes of the given length that contain the value.
1871 \itembfnl{\DWOPstackvalueTARG}
1872 The \DWOPstackvalueNAME{}
1873 operation specifies that the object
1874 does not exist in memory but its value is nonetheless known
1875 and is at the top of the DWARF expression stack. In this form
1876 of location description, the DWARF expression represents the
1877 actual value of the object, rather than its location. The
1878 \DWOPstackvalueNAME{} operation terminates the expression.
1881 \itembfnl{\DWOPimplicitpointerTARG}
1882 \textit{An optimizing compiler may eliminate a pointer, while
1883 still retaining the value that the pointer addressed.
1884 \DWOPimplicitpointerNAME{} allows a producer to describe this value.}
1886 The \DWOPimplicitpointerNAME{} operation specifies that the object
1887 is a pointer that cannot be represented as a real pointer,
1888 even though the value it would point to can be described. In
1889 this form of location description, the DWARF expression refers
1890 to a debugging information entry that represents the actual
1891 value of the object to which the pointer would point. Thus, a
1892 consumer of the debug information would be able to show the
1893 value of the dereferenced pointer, even when it cannot show
1894 the value of the pointer itself.
1897 The \DWOPimplicitpointerNAME{} operation has two operands: a
1898 reference to a debugging information entry that describes
1899 the dereferenced object's value, and a signed number that
1900 is treated as a byte offset from the start of that value.
1901 The first operand is a 4-byte unsigned value in the 32-bit
1902 DWARF format, or an 8-byte unsigned value in the 64-bit
1903 DWARF format (see Section
1904 \refersec{datarep:32bitand64bitdwarfformats}).
1905 The second operand is a
1906 signed LEB128\addtoindexx{LEB128!signed} number.
1908 The first operand is used as the offset of a debugging
1909 information entry in a \dotdebuginfo{} section, which may be
1910 contained in an executable or shared object file other than that
1911 containing the operator. For references from one executable or
1912 shared object file to another, the relocation must be performed
1915 \textit{The debugging information entry referenced by a
1916 \DWOPimplicitpointerNAME{} operation is typically a
1917 \DWTAGvariable{} or \DWTAGformalparameter{} entry whose
1918 \DWATlocation{} attribute gives a second DWARF expression or a
1919 location list that describes the value of the object, but the
1920 referenced entry may be any entry that contains a \DWATlocation{}
1921 or \DWATconstvalue{} attribute (for example, \DWTAGdwarfprocedure).
1922 By using the second DWARF expression, a consumer can
1923 reconstruct the value of the object when asked to dereference
1924 the pointer described by the original DWARF expression
1925 containing the \DWOPimplicitpointer{} operation.}
1929 \textit{DWARF location descriptions
1930 are intended to yield the \textbf{location}
1931 of a value rather than the value itself. An optimizing compiler
1932 may perform a number of code transformations where it becomes
1933 impossible to give a location for a value, but it remains possible
1934 to describe the value itself.
1935 Section \refersec{chap:registerlocationdescriptions}
1936 describes operators that can be used to
1937 describe the location of a value when that value exists in a
1938 register but not in memory. The operations in this section are
1939 used to describe values that exist neither in memory nor in a
1944 \subsubsection{Composite Location Descriptions}
1945 A composite location description describes an object or
1946 value which may be contained in part of a register or stored
1947 in more than one location. Each piece is described by a
1948 composition operation, which does not compute a value nor
1949 store any result on the DWARF stack. There may be one or
1950 more composition operations in a single composite location
1951 description. A series of such operations describes the parts
1952 of a value in memory address order.
1954 Each composition operation is immediately preceded by a simple
1955 location description which describes the location where part
1956 of the resultant value is contained.
1957 \begin{enumerate}[1. ]
1958 \itembfnl{\DWOPpieceTARG}
1959 The \DWOPpieceNAME{} operation takes a
1960 single operand, which is an
1961 unsigned LEB128\addtoindexx{LEB128!unsigned} number.
1962 The number describes the size in bytes
1963 of the piece of the object referenced by the preceding simple
1964 location description. If the piece is located in a register,
1965 but does not occupy the entire register, the placement of
1966 the piece within that register is defined by the ABI.
1968 \textit{Many compilers store a single variable in sets of registers,
1969 or store a variable partially in memory and partially in
1970 registers. \DWOPpieceNAME{} provides a way of describing how large
1971 a part of a variable a particular DWARF location description
1975 \itembfnl{\DWOPbitpieceTARG}
1976 The \DWOPbitpieceNAME{}
1977 operation takes two operands. The first
1978 is an unsigned LEB128\addtoindexx{LEB128!unsigned}
1979 number that gives the size in bits
1980 of the piece. The second is an
1981 unsigned LEB128\addtoindexx{LEB128!unsigned} number that
1982 gives the offset in bits from the location defined by the
1983 preceding DWARF location description.
1985 Interpretation of the offset depends on the location description.
1986 If the location description is empty, the offset
1987 doesn\textquoteright{}t matter and
1988 the \DWOPbitpieceNAME{} operation describes a piece consisting
1989 of the given number of bits whose values are undefined. If
1990 the location is a register, the offset is from the least
1991 significant bit end of the register. If the location is a
1992 memory address, the \DWOPbitpieceNAME{} operation describes a
1993 sequence of bits relative to the location whose address is
1994 on the top of the DWARF stack using the bit numbering and
1995 direction conventions that are appropriate to the current
1996 language on the target system. If the location is any implicit
1997 value or stack value, the \DWOPbitpieceNAME{} operation describes
1998 a sequence of bits using the least significant bits of that
2002 \textit{\DWOPbitpieceNAME{} is
2003 used instead of \DWOPpieceNAME{} when
2004 the piece to be assembled into a value or assigned to is not
2005 byte-sized or is not at the start of a register or addressable
2009 \subsection{Location Lists}
2010 \label{chap:locationlists}
2011 There are two forms of location lists. The first form
2012 is intended for use in other than a \splitDWARFobjectfile,
2013 while the second is intended for use in a \splitDWARFobjectfile{}
2014 (see Section \refersec{datarep:splitdwarfobjectfiles}). The two
2015 forms are otherwise equivalent.
2019 \subsubsection{Location Lists in Non-split Objects}
2020 \label{chap:locationlistsinnonsplitobjects}
2022 \addtoindexx{location list}
2023 are used in place of location descriptions
2024 whenever the object whose location is being described
2025 can change location during its lifetime.
2027 \addtoindexx{location list}
2028 are contained in a separate object file section called
2029 \dotdebugloc{}. A location list is indicated by a location
2030 attribute whose value is an offset from the beginning of
2031 the \dotdebugloc{} section to the first byte of the list for the
2034 The \definitionx{applicable base address} of a normal
2035 location list entry (see following) is
2036 \addtoindexx{location list!base address selection entry}
2037 determined by the closest preceding base address selection
2038 entry in the same location list. If there is
2039 no such selection entry, then the applicable base address
2040 defaults to the base address of the compilation unit (see
2041 Section \refersec{chap:fullandpartialcompilationunitentries}).
2043 \textit{In the case of a compilation unit where all of
2044 the machine code is contained in a single contiguous section,
2045 no base address selection entry is needed.}
2047 Each entry in a location list is either a location
2048 \addtoindexi{list}{address selection|see{base address selection}}
2051 \addtoindexi{base}{base address selection entry!in location list}
2052 address selection entry,
2053 \addtoindexx{location list!base address selection entry}
2055 \addtoindexx{end-of-list entry!in location list}
2058 \subsubsubsection{Location List Entry}
2059 A location list entry has two forms:
2060 a normal location list entry and a default location list entry.
2063 \subsubsubsubsection{Normal Location List Entry}
2064 A\addtoindexx{location list!normal entry}
2065 \addtoindex{normal location list entry} consists of:
2066 \begin{enumerate}[1. ]
2067 \item A beginning address offset.
2068 This address offset has the \addtoindex{size of an address} and is
2069 relative to the applicable base address of the compilation
2070 unit referencing this location list. It marks the beginning
2072 \addtoindexi{range}{address range!in location list}
2073 over which the location is valid.
2075 \item An ending address offset. This address offset again
2076 has the \addtoindex{size of an address} and is relative to the applicable
2077 base address of the compilation unit referencing this location
2078 list. It marks the first address past the end of the address
2079 range over which the location is valid. The ending address
2080 must be greater than or equal to the beginning address.
2082 \textit{A location list entry (but not a base address selection or
2083 end-of-list entry) whose beginning
2084 and ending addresses are equal has no effect
2085 because the size of the range covered by such
2088 \item An unsigned 2-byte length describing the length of the location
2089 description that follows.
2091 \item A \addtoindex{single location description}
2092 describing the location of the object over the range specified by
2093 the beginning and end addresses.
2096 Address ranges defined by normal location list entries
2097 may overlap. When they do, they describe a
2098 situation in which an object exists simultaneously in more than
2099 one place. If all of the address ranges in a given location
2100 list do not collectively cover the entire range over which the
2101 object in question is defined, it is assumed that the object is
2102 not available for the portion of the range that is not covered.
2105 \subsubsubsubsection{Default Location List Entry}
2106 A \addtoindex{default location list entry} consists of:
2107 \addtoindexx{location list!default entry}
2108 \begin{enumerate}[1. ]
2110 \item The value of the largest representable address offset (for
2111 example, \wffffffff when the size of an address is 32 bits).
2112 \item An unsigned 2-byte length describing the length of the location
2113 description that follows.
2114 \item A single location description describing the location of the
2115 object when there is no prior normal location list entry
2116 that applies in the same location list.
2119 A default location list entry is independent of any applicable
2120 base address (except to the extent to which base addresses
2121 affect prior normal location list entries).
2123 A default location list entry must be the last location list
2124 entry of a location list except for the terminating end-of-list
2127 A \addtoindex{default location list entry} describes a single
2128 location which applies to all addresses which are not included
2129 in any range defined earlier in the same location list.
2132 \subsubsubsection{Base Address Selection Entry}
2134 \addtoindexi{address}{address selection|see{base address selection}}
2135 \addtoindexx{location list!base address selection entry}
2137 \addtoindexi{entry}{base address selection entry!in location list}
2139 \begin{enumerate}[1. ]
2140 \item The value of the largest representable
2141 address offset (for example, \wffffffff when the size of
2142 an address is 32 bits).
2143 \item An address, which defines the
2144 appropriate base address for use in interpreting the beginning
2145 and ending address offsets of subsequent entries of the location list.
2148 \textit{A base address selection entry
2149 affects only the remainder of the list in which it is contained.}
2152 \subsubsubsection{End-of-List Entry}
2153 The end of any given location list is marked by an
2154 \addtoindexx{location list!end-of-list entry}
2155 end-of-list entry, which consists of a 0 for the beginning address
2156 offset and a 0 for the ending address offset. A location list
2158 \addtoindexx{end-of-list entry!in location list}
2159 end-of-list entry describes an object that
2160 exists in the source code but not in the executable program.
2162 Neither a base address selection entry nor an end-of-list
2163 entry includes a location description.
2166 \textit{When a DWARF consumer is parsing and decoding a location
2167 list, it must recognize the beginning and ending address
2168 offsets of (0, 0) for an end-of-list entry and
2169 \mbox{(0, \texttt{maximum-address})} for
2170 a default location list entry prior to applying any base
2171 address. Any other pair of offsets beginning with 0 is a
2172 valid normal location list entry. Next, it must recognize the
2173 beginning address offset of \texttt{maximum-address} for a base address selection
2174 entry prior to applying any base address. The current base
2175 address is not applied to the subsequent value (although there
2176 may be an underlying object language relocation that affects
2179 \textit{A base address selection entry and an end-of-list
2180 entry for a location list are identical to a base address
2181 selection entry and end-of-list entry, respectively, for a
2182 \addtoindex{range list}
2183 (see Section \refersec{chap:noncontiguousaddressranges})
2184 in interpretation and representation.}
2187 \subsubsection{Location Lists in Split Object Files}
2188 \label{chap:locationlistsinsplitobjectfiles}
2189 In a \splitDWARFobjectfile{} (see
2190 Section \refersec{datarep:splitdwarfobjectfiles}),
2191 location lists are contained in the \dotdebuglocdwo{} section.
2193 The \addtoindex{applicable base address} of a split
2194 location list entry (see following) is
2195 \addtoindexx{location list!base address selection entry}
2196 determined by the closest preceding base address selection
2197 entry (\DWLLEbaseaddressselectionentry) in the same location list. If there is
2198 no such selection entry, then the applicable base address
2199 defaults to the base address of the compilation unit (see
2200 Section \refersec{chap:fullandpartialcompilationunitentries}).
2202 Each entry in the split location list
2203 begins with a type code, which is a single unsigned byte that
2204 identifies the type of entry. There are five types of entries:
2206 \itembfnl{\DWLLEendoflistentryTARG}
2207 This entry indicates the end of a location list, and
2208 contains no further data.
2211 \itembfnl{\DWLLEbaseaddressselectionentryTARG}
2212 This entry contains an
2213 unsigned LEB128\addtoindexx{LEB128!unsigned} value immediately
2214 following the type code. This value is the index of an
2215 address in the \dotdebugaddr{} section, which is then used as
2216 the base address when interpreting offsets in subsequent
2217 location list entries of type \DWLLEoffsetpairentry.
2218 This index is relative to the value of the
2219 \DWATaddrbase{} attribute of the associated compilation unit.
2221 \itembfnl{\DWLLEstartendentryTARG}
2222 This entry contains two unsigned LEB128\addtoindexx{LEB128!unsigned}
2223 values immediately following the type code. These values are the
2224 indices of two addresses in the \dotdebugaddr{} section.
2225 These indices are relative to the value of the
2226 \DWATaddrbase{} attribute of the associated compilation unit
2227 (see Section \refersec{chap:unitentries}).
2228 These indicate the starting and ending addresses,
2229 respectively, that define the address range for which
2230 this location is valid. The starting and ending addresses
2231 given by this type of entry are not relative to the
2232 compilation unit base address. A single location
2233 description follows the fields that define the address range.
2236 \itembfnl{\DWLLEstartlengthentryTARG}
2237 This entry contains one unsigned LEB128\addtoindexx{LEB128!unsigned}
2239 unsigned value immediately following the type code. The
2240 first value is the index of an address in the \dotdebugaddr{}
2241 section, which marks the beginning of the address range
2242 over which the location is valid.
2243 This index is relative to the value of the
2244 \DWATaddrbase{} attribute of the associated compilation unit.
2245 The starting address given by this
2246 type of entry is not relative to the compilation unit
2247 base address. The second value is the
2248 length of the range in bytes. A single location
2249 description follows the fields that define the address range.
2251 \itembfnl{\DWLLEoffsetpairentryTARG}
2252 This entry contains two 4-byte unsigned values
2253 immediately following the type code. These values are the
2254 starting and ending offsets, respectively, relative to
2255 the applicable base address, that define the address
2256 range for which this location is valid. A single location
2257 description follows the fields that define the address range.
2261 \textit{The \DWLLEbaseaddressselectionentry, \DWLLEstartendentry{}
2262 and \DWLLEstartlengthentry{} entries obtain addresses within the
2263 target program indirectly using an index (not an offset) into an
2264 array of addresses. The base of that array is obtained using the
2265 \DWATaddrbase{} attribute of the containing compilation unit.
2266 The value of that attribute is the offset of the base of the array
2267 in the \dotdebugaddr{} section of the unit.}
2270 \section{Types of Program Entities}
2271 \label{chap:typesofprogramentities}
2272 \hypertarget{chap:DWATtypetypeofdeclaration}{}
2273 Any debugging information entry describing a declaration that
2275 \addtoindexx{type attribute}
2276 a \DWATtypeDEFN{} attribute, whose value is a
2277 reference to another debugging information entry. The entry
2278 referenced may describe a base type, that is, a type that is
2279 not defined in terms of other data types, or it may describe a
2280 user-defined type, such as an array, structure or enumeration.
2281 Alternatively, the entry referenced may describe a type
2282 modifier, such as constant, packed, pointer, reference or
2283 volatile, which in turn will reference another entry describing
2284 a type or type modifier (using a
2285 \DWATtypeNAME{} attribute\addtoindexx{type attribute} of its
2286 own). See Chapter \referfol{chap:typeentries}
2287 for descriptions of the entries describing
2288 base types, user-defined types and type modifiers.
2292 \section{Accessibility of Declarations}
2293 \label{chap:accessibilityofdeclarations}
2294 \textit{Some languages, notably \addtoindex{C++} and
2295 \addtoindex{Ada}, have the concept of
2296 the accessibility of an object or of some other program
2297 entity. The accessibility specifies which classes of other
2298 program objects are permitted access to the object in question.}
2300 The accessibility of a declaration
2301 is\hypertarget{chap:DWATaccessibilityattribute}{}
2303 \DWATaccessibilityDEFN{}\addtoindexx{accessibility attribute}
2304 attribute, whose value is a constant drawn from the set of codes
2305 listed in Table \refersec{tab:accessibilitycodes}.
2307 \begin{simplenametable}[1.9in]{Accessibility codes}{tab:accessibilitycodes}
2308 \DWACCESSpublicTARG{} \\
2309 \DWACCESSprivateTARG{} \\
2310 \DWACCESSprotectedTARG{} \\
2311 \end{simplenametable}
2314 \section{Visibility of Declarations}
2315 \label{chap:visibilityofdeclarations}
2317 \textit{Several languages (such as \addtoindex{Modula-2})
2318 have the concept of the visibility of a declaration. The
2319 visibility specifies which declarations are to be
2320 visible outside of the entity in which they are
2323 The\hypertarget{chap:DWATvisibilityvisibilityofdeclaration}{}
2324 visibility of a declaration is represented
2325 by a \DWATvisibilityDEFN{}
2326 attribute\addtoindexx{visibility attribute}, whose value is a
2327 constant drawn from the set of codes listed in
2328 Table \refersec{tab:visibilitycodes}.
2330 \begin{simplenametable}[1.5in]{Visibility codes}{tab:visibilitycodes}
2331 \DWVISlocalTARG{} \\
2332 \DWVISexportedTARG{} \\
2333 \DWVISqualifiedTARG{} \\
2334 \end{simplenametable}
2337 \section{Virtuality of Declarations}
2338 \label{chap:virtualityofdeclarations}
2339 \textit{\addtoindex{C++} provides for virtual and pure virtual structure or class
2340 member functions and for virtual base classes.}
2342 The\hypertarget{chap:DWATvirtualityvirtualityindication}{}
2343 virtuality of a declaration is represented by a
2344 \DWATvirtualityDEFN{}
2345 attribute\addtoindexx{virtuality attribute}, whose value is a constant drawn
2346 from the set of codes listed in
2347 Table \refersec{tab:virtualitycodes}.
2349 \begin{simplenametable}[2.5in]{Virtuality codes}{tab:virtualitycodes}
2350 \DWVIRTUALITYnoneTARG{} \\
2351 \DWVIRTUALITYvirtualTARG{} \\
2352 \DWVIRTUALITYpurevirtualTARG{} \\
2353 \end{simplenametable}
2356 \section{Artificial Entries}
2357 \label{chap:artificialentries}
2358 \textit{A compiler may wish to generate debugging information entries
2359 for objects or types that were not actually declared in the
2360 source of the application. An example is a formal parameter
2361 entry to represent the hidden
2362 \texttt{this} parameter\index{this parameter@\texttt{this} parameter}
2363 that most \addtoindex{C++} implementations pass as the first argument
2364 to non-static member functions.}
2366 Any debugging information entry representing the
2367 \addtoindexx{artificial attribute}
2368 declaration of an object or type artificially generated by
2369 a compiler and not explicitly declared by the source
2370 program\hypertarget{chap:DWATartificialobjectsortypesthat}{}
2372 \DWATartificialDEFN{} attribute,
2373 which is a \livelink{chap:classflag}{flag}.
2376 \section{Segmented Addresses}
2377 \label{chap:segmentedaddresses}
2378 \textit{In some systems, addresses are specified as offsets within a
2380 \addtoindexx{address space!segmented}
2382 \addtoindexx{segmented addressing|see{address space}}
2383 rather than as locations within a single flat
2384 \addtoindexx{address space!flat}
2387 Any debugging information entry that contains a description
2388 of\hypertarget{chap:DWATsegmentaddressinginformation}{}
2389 the location of an object or subroutine may have a
2390 \DWATsegmentDEFN{} attribute,
2391 \addtoindexx{segment attribute}
2392 whose value is a location
2393 description. The description evaluates to the segment selector
2394 of the item being described. If the entry containing the
2395 \DWATsegmentNAME{} attribute has a
2399 \DWATentrypc{} attribute,
2400 \addtoindexx{entry PC attribute}
2403 description that evaluates to an address, then those address
2404 values represent the offset portion of the address within
2405 the segment specified
2406 \addtoindexx{segment attribute}
2407 by \DWATsegmentNAME.
2410 \DWATsegmentNAME{} attribute, it inherits
2411 \addtoindexx{segment attribute}
2412 the segment value from its parent entry. If none of the
2413 entries in the chain of parents for this entry back to
2414 its containing compilation unit entry have
2415 \DWATsegmentNAME{} attributes,
2416 then the entry is assumed to exist within a flat
2418 Similarly, if the entry has a
2419 \DWATsegmentNAME{} attribute
2420 \addtoindexx{segment attribute}
2421 containing an empty location description, that
2422 entry is assumed to exist within a
2423 \addtoindexi{flat}{address space!flat}
2426 \textit{Some systems support different
2427 classes of addresses\addtoindexx{address class}.
2428 The address class may affect the way a pointer is dereferenced
2429 or the way a subroutine is called.}
2432 Any debugging information entry representing a pointer or
2433 reference type or a subroutine or subroutine type may
2436 attribute, whose value is an integer
2437 constant. The set of permissible values is specific to
2438 each target architecture. The value \DWADDRnoneTARG,
2440 is common to all encodings, and means that no address class
2444 \textit {For example, the Intel386 \texttrademark\ processor might use the following values:}
2447 \caption{Example address class codes}
2448 \label{tab:inteladdressclasstable}
2450 \begin{tabular}{l|c|l}
2452 Name&Value&Meaning \\
2454 \textit{DW\_ADDR\_none}& 0 & \textit{no class specified} \\
2455 \textit{DW\_ADDR\_near16}& 1 & \textit{16-bit offset, no segment} \\
2456 \textit{DW\_ADDR\_far16}& 2 & \textit{16-bit offset, 16-bit segment} \\
2457 \textit{DW\_ADDR\_huge16}& 3 & \textit{16-bit offset, 16-bit segment} \\
2458 \textit{DW\_ADDR\_near32}& 4 & \textit{32-bit offset, no segment} \\
2459 \textit{DW\_ADDR\_far32}& 5 & \textit{32-bit offset, 16-bit segment} \\
2465 \section{Non-Defining Declarations and Completions}
2466 \label{chap:nondefiningdeclarationsandcompletions}
2467 A debugging information entry representing a program entity
2468 typically represents the defining declaration of that
2469 entity. In certain contexts, however, a debugger might need
2470 information about a declaration of an entity that is not
2471 \addtoindexx{incomplete declaration}
2472 also a definition, or is otherwise incomplete, to evaluate
2473 an\hypertarget{chap:DWATdeclarationincompletenondefiningorseparateentitydeclaration}{}
2474 expression correctly.
2477 \textit{As an example, consider the following fragment of \addtoindex{C} code:}
2491 \textit{\addtoindex{C} scoping rules require that the
2492 value of the variable \texttt{x} passed to the function
2493 \texttt{g} is the value of the global \texttt{float}
2494 variable \texttt{x} rather than of the local \texttt{int}
2495 variable \texttt{x}.}
2497 \subsection{Non-Defining Declarations}
2498 A debugging information entry that
2499 represents a non-defining
2500 \addtoindexx{non-defining declaration}
2502 \addtoindex{incomplete declaration}
2503 of a program entity has a
2504 \addtoindexx{declaration attribute}
2505 \DWATdeclarationDEFN{} attribute, which is a
2506 \livelink{chap:classflag}{flag}.
2508 \textit{A non-defining type declaration may nonetheless have
2509 children as illustrated in Section
2510 \refersec{app:declarationscompletingnondefiningdeclarations}.}
2513 \subsection{Declarations Completing Non-Defining Declarations}
2514 \hypertarget{chap:DWATspecificationincompletenondefiningorseparatedeclaration}{}
2515 A debugging information entry that represents a declaration
2516 that completes another (earlier) non-defining declaration may have a
2517 \DWATspecificationDEFN{}
2518 attribute whose value is a \livelink{chap:classreference}{reference} to
2519 the debugging information entry representing the non-defining declaration.
2520 A debugging information entry with a
2521 \DWATspecificationNAME{}
2522 attribute does not need to duplicate information provided by the
2523 debugging information entry referenced by that specification attribute.
2525 When the non-defining declaration is contained within a type that has
2526 been placed in a separate type unit (see Section \refersec{chap:typeunitentries}),
2527 the \DWATspecification{} attribute cannot refer directly to the entry in
2528 the type unit. Instead, the current compilation unit may contain a
2529 \doublequote{skeleton} declaration of the type, which contains only the relevant
2530 declaration and its ancestors as necessary to provide the context
2531 (including containing types and namespaces). The \DWATspecification{}
2532 attribute would then be a reference to the declaration entry within
2533 the skeleton declaration tree. The debugging information entry for the
2534 top-level type in the skeleton tree may contain a \DWATsignature{}
2535 attribute whose value is the type signature
2536 (see Section \refersec{datarep:typesignaturecomputation}).
2539 Not all attributes of the debugging information entry referenced by a
2540 \DWATspecification{} attribute
2541 apply to the referring debugging information entry.
2542 For\addtoindexx{declaration attribute}
2546 \addtoindexx{declaration attribute}
2548 \addtoindexx{declaration attribute}
2550 \addtoindexx{sibling attribute}
2554 \section{Declaration Coordinates}
2555 \label{chap:declarationcoordinates}
2556 \livetargi{chap:declarationcoordinates}{}{declaration coordinates}
2557 \textit{It is sometimes useful in a debugger to be able to associate
2558 a declaration with its occurrence in the program source.}
2560 Any debugging information entry representing
2561 the declaration of an object, module, subprogram or type may have
2562 \DWATdeclfileDEFN,\hypertarget{chap:DWATdeclfilefilecontainingsourcedeclaration}{}
2563 \addtoindexx{declaration file attribute}
2564 \DWATdecllineDEFN\hypertarget{chap:DWATdecllinelinenumberofsourcedeclaration}{}
2565 \addtoindexx{declaration line attribute} and
2566 \DWATdeclcolumnDEFN\hypertarget{chap:DWATdeclcolumncolumnpositionofsourcedeclaration}{}
2567 \addtoindexx{declaration column attribute}
2568 attributes, each of whose value is an unsigned
2569 \livelink{chap:classconstant}{integer constant}.
2572 \addtoindexx{declaration file attribute}
2576 \addtoindexx{file containing declaration}
2578 a file number from the line number information table for the
2579 compilation unit containing the debugging information entry and
2580 represents the source file in which the declaration appeared
2581 (see Section \refersec{chap:linenumberinformation}).
2582 The value 0 indicates that no source file
2586 \addtoindexx{declaration line attribute}
2587 the \DWATdeclline{} attribute represents
2588 the source line number at which the first character of
2589 the identifier of the declared object appears. The value 0
2590 indicates that no source line has been specified.
2593 \addtoindexx{declaration column attribute}
2594 the \DWATdeclcolumn{} attribute represents
2595 the source column number at which the first character of
2596 the identifier of the declared object appears. The value 0
2597 indicates that no column has been specified.
2599 \section{Identifier Names}
2600 \label{chap:identifiernames}
2601 Any\hypertarget{chap:DWATnamenameofdeclaration}{}
2602 debugging information entry
2603 \addtoindexx{identifier names}
2605 \addtoindexx{names!identifier}
2606 a program entity that has been given a name may have a
2608 attribute\addtoindexx{name attribute}, whose value of
2609 class \CLASSstring{} represents the name.
2610 A debugging information entry containing
2611 no name attribute, or containing a name attribute whose value
2612 consists of a name containing a single null byte, represents
2613 a program entity for which no name was given in the source.
2615 \textit{Because the names of program objects described by DWARF are
2616 the names as they appear in the source program, implementations
2617 of language translators that use some form of mangled name
2618 \addtoindexx{mangled names}
2619 (as do many implementations of \addtoindex{C++}) should use the
2620 unmangled form of the name in the
2621 \DWATname{} attribute,
2622 \addtoindexx{name attribute}
2623 including the keyword operator (in names such as \doublequote{operator +}),
2624 if present. See also
2625 Section \referfol{chap:linkagenames} regarding the use of
2626 \DWATlinkagename{} for
2627 \addtoindex{mangled names}.
2628 Sequences of multiple whitespace characters may be compressed.}
2630 \textit{For additional discussion, see the Best Practices section
2632 (\url{http://wiki.dwarfstd.org/index.php?title=Best_Practices}.)}
2634 \section{Data Locations and DWARF Procedures}
2635 \hypertarget{chap:DWATlocationdataobjectlocation}{}
2636 Any debugging information entry describing a data object (which
2637 includes variables and parameters) or
2638 \livelink{chap:commonblockentry}{common blocks}
2639 may have a \DWATlocationDEFN{} attribute,
2640 \addtoindexx{location attribute}
2641 whose value is a location description
2642 (see Section \refersec{chap:locationdescriptions}).
2645 A \addtoindex{DWARF procedure} is represented by any
2646 debugging information entry that has a
2647 \DWATlocationNAME{} attribute.\addtoindexx{location attribute}
2648 If a suitable entry is not otherwise available,
2649 a DWARF procedure can be represented using a debugging
2650 information entry \addtoindexx{DWARF procedure entry}
2651 with the tag \DWTAGdwarfprocedureTARG{} together with a
2652 \DWATlocationNAME{} attribute.\addtoindexx{location attribute}
2654 A DWARF procedure is called by a \DWOPcalltwo, \DWOPcallfour{}
2655 or \DWOPcallref{} DWARF expression operator
2656 (see Section \refersec{chap:controlflowoperations}).
2659 \section{Code Addresses, Ranges and Base Addresses}
2660 \label{chap:codeaddressesandranges}
2661 Any debugging information entry describing an entity that has
2662 a machine code address or range of machine code addresses,
2663 which includes compilation units, module initialization,
2664 subroutines, lexical \nolink{blocks},
2665 try/catch \nolink{blocks} (see Section \refersec{chap:tryandcatchblockentries}),
2666 labels and the like, may have
2668 \item \hypertarget{chap:DWATlowpccodeaddressorrangeofaddresses}{}
2669 A \DWATlowpcDEFN{} attribute for a single address,
2671 \item \hypertarget{chap:DWAThighpccontiguousrangeofcodeaddresses}{}
2672 A \DWATlowpcDEFN{}\addtoindexx{low PC attribute}
2673 and \DWAThighpcDEFN{}\addtoindexx{high PC attribute}
2674 pair of attributes for a single contiguous range of
2677 \item \hypertarget{chap:DWATrangesnoncontiguousrangeofcodeaddresses}{}
2678 A \DWATrangesDEFN{} attribute\addtoindexx{ranges attribute}
2679 for a non-contiguous range of addresses.
2682 If an entity has no associated machine code,
2683 none of these attributes are specified.
2686 The \definitionx{base address} of the scope for any of the
2687 debugging information entries listed above is given by either the
2688 \DWATlowpcNAME{}\livetargi{chap:DWATlowpcbaseaddressofscope}{}{base address of scope}
2689 attribute or the first address in the first range entry
2690 in the list of ranges given by the \DWATrangesNAME{} attribute.
2691 If there is no such attribute, the base address is undefined.
2693 \subsection{Single Address}
2694 \label{chap:singleaddress}
2695 When there is a single address associated with an entity,
2696 such as a label or alternate entry point of a subprogram,
2697 the entry has a \DWATlowpc{} attribute whose value is the
2698 address for the entity.
2701 \subsection{Contiguous Address Range}
2702 \label{chap:contiguousaddressranges}
2703 When the set of addresses of a debugging information entry can
2704 be described as a single contiguous range, the entry may
2705 \addtoindexx{high PC attribute}
2706 \addtoindexx{low PC attribute}
2707 have a \DWATlowpc{} and \DWAThighpc{} pair of attributes.
2708 The value of the \DWATlowpc{} attribute is the address of the
2709 first instruction associated with the entity. If the value of
2710 the \DWAThighpc{} is of class address, it is the
2711 address of the first location past the last instruction
2712 associated with the entity; if it is of class constant, the
2713 value is an unsigned integer offset which when added to the
2714 low PC gives the address of the first location past the last
2715 instruction associated with the entity.
2717 \textit{The high PC value
2718 may be beyond the last valid instruction in the executable.}
2720 \subsection{Non-Contiguous Address Ranges}
2721 \label{chap:noncontiguousaddressranges}
2722 When the set of addresses of a debugging information entry
2723 \addtoindexx{non-contiguous address ranges}
2724 cannot be described as a single contiguous range, the entry
2725 may have a \DWATranges{} attribute\addtoindexx{ranges attribute}
2726 whose value is of class \livelink{chap:classrangelistptr}{rangelistptr}
2727 and indicates the beginning of a \addtoindex{range list}.
2729 a \DWATstartscope{} attribute\addtoindexx{start scope attribute}
2730 (see Section \refersec{chap:dataobjectentries}).
2731 may have a value of class
2732 \livelink{chap:classrangelistptr}{rangelistptr} for the same reason.
2734 Range lists are contained in the \dotdebugranges{} section.
2735 A \addtoindex{range list} is indicated by a
2736 \DWATranges{} attribute\addtoindexx{ranges attribute}
2737 whose value is an offset from the beginning of the
2738 \dotdebugranges{} section to the beginning of the
2739 \addtoindex{range list}.
2742 If the current compilation unit contains a \DWATrangesbase{}
2743 attribute, the value of that attribute establishes a base
2744 offset within the \dotdebugranges{} section for the compilation
2745 unit. The offset given by the \DWATranges{} attribute is
2746 relative to that base.
2749 The \definitionx{applicable base address} of a \addtoindex{range list}
2750 entry is determined by the closest preceding base address
2751 selection entry in the same range list (see
2752 Section \ref{chap:baseaddressselectionentry}).
2753 If there is no such selection
2754 entry, then the applicable base address defaults to the base
2755 address of the compilation unit
2756 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
2758 \textit{In the case of a compilation unit where all of the machine
2759 code is contained in a single contiguous section, no base
2760 address selection entry is needed.}
2762 Address range entries in a \addtoindex{range list} may not overlap.
2763 There is no requirement that the entries be ordered in any particular way.
2765 Each entry in a \addtoindex{range list} is either a
2766 \addtoindex{range list entry},
2767 \addtoindexx{base address selection entry!in range list}
2768 a base address selection entry, or an
2769 \addtoindexx{end-of-list entry!in range list}
2773 \subsubsection{Range List Entry}
2774 A \addtoindex{range list entry} consists of:
2775 \begin{enumerate}[1. ]
2776 \item A beginning address offset. This address offset has the
2777 \addtoindex{size of an address} and is relative to
2778 the \addtoindex{applicable base address} of the compilation unit referencing this
2779 \addtoindex{range list}.
2780 It marks the beginning of an
2781 \addtoindexi{address range}{address range!in range list}.
2783 \item An ending address offset. This address offset again has the
2784 \addtoindex{size of an address} and is relative
2785 to the \addtoindex{applicable base address} of the compilation unit referencing
2786 this \addtoindex{range list}.
2787 It marks the first address past the end of the address range.
2788 The ending address must be greater than or
2789 equal to the beginning address.
2792 \textit{A \addtoindex{range list} entry (but not a base address
2793 selection or end-of-list entry) whose beginning and
2794 ending addresses are equal has no effect because the size of the
2795 range covered by such an entry is zero.}
2799 \subsubsection{Base Address Selection Entry}
2800 \label{chap:baseaddressselectionentry}
2801 A \addtoindex{base address selection entry} consists of:
2802 \begin{enumerate}[1. ]
2803 \item The value of the largest representable address offset
2804 (for example, \wffffffff when the size of an address is 32 bits).
2806 \item An address, which defines the appropriate base address
2807 for use in interpreting the beginning and ending address offsets
2808 of subsequent entries of the location list.
2811 \textit{A base address selection entry affects only the
2812 remainder of the list in which it is contained.}
2814 \subsubsection{End-of-List Entry}
2815 The end of any given \addtoindex{range list} is marked by an
2816 \addtoindexx{end-of-list entry!in range list}
2818 which consists of a 0 for the beginning address
2819 offset and a 0 for the ending address offset.
2820 A \addtoindex{range list}
2821 containing only an end-of-list entry describes an empty scope
2822 (which contains no instructions).
2824 \textit{A base address selection entry and an
2825 \addtoindexx{end-of-list entry!in range list}
2826 end-of-list entry for
2827 a \addtoindex{range list}
2828 are identical to a base address selection entry
2829 and end-of-list entry, respectively, for a location list
2830 (see Section \refersec{chap:locationlists})
2831 in interpretation and representation.}
2834 \section{Entry Address}
2835 \label{chap:entryaddress}
2836 \textit{The entry or first executable instruction generated
2837 for an entity, if applicable, is often the lowest addressed
2838 instruction of a contiguous range of instructions. In other
2839 cases, the entry address needs to be specified explicitly.}
2841 Any debugging information entry describing an entity that has
2842 a range of code addresses, which includes compilation units,
2843 module initialization, subroutines,
2844 \livelink{chap:lexicalblock}{lexical \nolink{blocks}},
2845 \livelink{chap:tryandcatchblockentries}{try/catch \nolink{blocks}},
2846 and the like, may have a \DWATentrypcDEFN{} attribute
2847 \addtoindexx{entry PC address} to indicate the
2848 \definitionx{entry address} which is the address of the
2849 instruction where execution should begin
2850 within that range\hypertarget{chap:entryaddressofscope}{}
2852 If the value of the \DWATentrypcNAME{} attribute is of
2853 class \CLASSaddress{} that address is the entry address;
2854 or, if it is of class
2855 \CLASSconstant, the value is an unsigned integer offset which,
2856 when added to the base address of the function, gives the entry
2860 If no \DWATentrypcNAME{} attribute is present,
2861 then the entry address is assumed to be the same as the
2862 base address of the containing scope.
2865 \section{Static and Dynamic Values of Attributes}
2866 \label{chap:staticanddynamicvaluesofattributes}
2868 Some attributes that apply to types specify a property (such
2869 as the lower bound of an array) that is an integer value,
2870 where the value may be known during compilation or may be
2871 computed dynamically during execution.
2875 attributes is determined based on the class as follows:
2877 \item For a \livelink{chap:classconstant}{constant}, the value
2878 of the constant is the value of the attribute.
2880 \item For a \livelink{chap:classreference}{reference}, the
2881 value is a reference to another debugging information entry.
2884 \renewcommand{\itemsep}{0cm}
2885 \item describe a constant which is the attribute value,
2886 \item describe a variable which contains the attribute value, or
2887 \item contain a \DWATlocation{} attribute whose value is a
2888 DWARF expression which computes the attribute value
2889 (for example, a \DWTAGdwarfprocedure{} entry).
2892 \item For an \livelink{chap:classexprloc}{exprloc}, the value
2893 is interpreted as a DWARF expression; evaluation of the expression
2894 yields the value of the attribute.
2899 \section{Entity Descriptions}
2900 \textit{Some debugging information entries may describe entities
2901 in the program that are artificial, or which otherwise have a
2902 \doublequote{name} that is not a valid identifier in the
2903 programming language.
2904 This attribute provides a means for the producer to indicate
2905 the purpose or usage of the containing debugging infor}
2907 Generally, any debugging information entry that
2908 has,\hypertarget{chap:DWATdescriptionartificialnameordescription}{}
2909 or may have, a \DWATname{} attribute, may also have a
2910 \addtoindexx{description attribute}
2911 \DWATdescriptionDEFN{} attribute whose value is a
2912 null-terminated string providing a description of the entity.
2914 \textit{It is expected that a debugger will
2915 display these descriptions as part of
2916 displaying other properties of an entity.}
2919 \section{Byte and Bit Sizes}
2920 \label{chap:byteandbitsizes}
2921 % Some trouble here with hbox full, so we try optional word breaks.
2922 Many debugging information entries allow either a
2923 \DWATbytesizeNAME{} attribute or a
2924 \DWATbitsizeNAME{} attribute,
2925 whose \livelink{chap:classconstant}{integer constant} value
2926 (see Section \ref{chap:staticanddynamicvaluesofattributes})
2928 amount of storage. The value of the
2929 \DWATbytesizeDEFN{} attribute
2930 is interpreted in bytes and the value of the
2932 attribute is interpreted in bits. The
2933 \DWATstringlengthbytesize{} and
2934 \DWATstringlengthbitsize{}
2935 attributes are similar.
2937 In addition, the \livelink{chap:classconstant}{integer constant}
2938 value of a \DWATbytestride{} attribute is interpreted
2939 in bytes and the \livelink{chap:classconstant}{integer constant} value of a
2941 attribute is interpreted in bits.
2943 \section{Linkage Names}
2944 \label{chap:linkagenames}
2945 \textit{Some language implementations, notably
2946 \addtoindex{C++} and similar
2947 languages, make use of implementation-defined names within
2948 object files that are different from the \addtoindex{identifier names}
2949 (see Section \refersec{chap:identifiernames}) of entities as they
2950 appear in the source. Such names, sometimes known as
2951 \addtoindex{mangled names}\addtoindexx{names!mangled},
2952 are used in various ways, such as: to encode additional
2953 information about an entity, to distinguish multiple entities
2954 that have the same name, and so on. When an entity has an
2955 associated distinct linkage name it may sometimes be useful
2956 for a producer to include this name in the DWARF description
2957 of the program to facilitate consumer access to and use of
2958 object file information about an entity and/or information
2959 that is encoded in the linkage name itself.
2962 % Some trouble maybe with hbox full, so we try optional word breaks.
2963 A debugging information entry may have a
2964 \DWATlinkagenameDEFN{}\hypertarget{chap:DWATlinkagenameobjectfilelinkagenameofanentity}{}
2965 attribute\addtoindexx{linkage name attribute}
2966 whose value is a null-terminated string containing the
2967 object file linkage name associated with the corresponding entity.
2970 \section{Template Parameters}
2971 \label{chap:templateparameters}
2972 \textit{In \addtoindex{C++}, a template is a generic definition
2973 of a class, function, member function, or typedef (alias).
2974 A template has formal parameters that
2975 can be types or constant values; the class, function,
2976 member function, or typedef is instantiated differently for each
2977 distinct combination of type or value actual parameters. DWARF does
2978 not represent the generic template definition, but does represent each
2981 A debugging information entry that represents a
2982 \addtoindex{template instantiation}
2983 will contain child entries describing the actual template parameters.
2984 The containing entry and each of its child entries reference a template
2985 parameter entry in any circumstance where the template definition
2986 referenced a formal template parameter.
2988 A template type parameter is represented by a debugging information
2990 \addtoindexx{template type parameter entry}
2991 \DWTAGtemplatetypeparameterTARG.
2992 A template value parameter is represented by a debugging information
2994 \addtoindexx{template value parameter entry}
2995 \DWTAGtemplatevalueparameterTARG.
2996 The actual template parameter entries appear in the same order as the
2997 corresponding template formal parameter declarations in the
3001 A type or value parameter entry may have a \DWATname{} attribute,
3002 \addtoindexx{name attribute}
3004 null-terminated string containing the name of the corresponding
3005 formal parameter. The entry may also have a
3006 \DWATdefaultvalue{} attribute, which is a flag indicating
3007 that the value corresponds to the default argument for the
3010 A\addtoindexx{formal type parameter|see{template type parameter entry}}
3011 template type parameter entry has a
3012 \DWATtype{} attribute\addtoindexx{type attribute}
3013 describing the actual type by which the formal is replaced.
3015 A template value parameter entry has a \DWATtype{} attribute
3016 describing the type of the parameterized value.
3017 The entry also has an attribute giving the
3018 actual compile-time or run-time constant value
3019 of the value parameter for this instantiation.
3021 \DWATconstvalueDEFN{} attribute,
3022 \addtoindexx{constant value attribute}
3023 \livetarg{chap:DWATconstvaluetemplatevalueparameter}{}
3024 whose value is the compile-time constant value
3025 as represented on the target architecture, or a
3026 \DWATlocation{} attribute, whose value is a
3027 single location description for the run-time constant address.
3030 \label{chap:alignment}
3031 \livetarg{chap:DWATalignmentnondefault}{}
3032 A debugging information entry may have a
3033 \DWATalignmentDEFN{} attribute\addtoindexx{alignment attribute}
3034 whose value of class \CLASSconstant{} is
3035 a positive, non-zero, integer describing the
3036 alignment of the entity.
3038 \textit{For example, an alignment attribute whose value is 8 indicates
3039 that the entity to which it applies occurs at an address that is a
3040 multiple of eight (not a multiple of $2^8$ or 256).}