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,
83 \DWTAGtemplatetypeparameter,
84 \DWTAGtemplatevalueparameter,
90 \DWTAGunspecifiedparameters,
91 \DWTAGunspecifiedtype,
102 \textit{The debugging information entry descriptions in
103 Chapters 3, 4 and 5 generally include mention of
104 most, but not necessarily all, of the attributes
105 that are normally or possibly used with the entry.
106 Some attributes, whose applicability tends to be
107 pervasive and invariant across many kinds of
108 debugging information entries, are described in
109 this section and not necessarily mentioned in all
110 contexts where they may be appropriate.
113 the \livelink{chap:declarationcoordinates}{declaration coordinates}, and
117 The debugging information entries are contained in the
118 \dotdebuginfo{} and/or \dotdebuginfodwo{} sections of an object file.
121 Optionally, debugging information may be partitioned such
122 that the majority of the debugging information can remain in
123 individual object files without being processed by the
124 linker. See Section \refersec{datarep:splitdwarfobjectfiles} and
125 Appendix \refersec{app:splitdwarfobjectsinformative} for details.
128 As a further option, debugging information entries and other debugging
129 information that are the same in multiple executable or shared object files
130 may be found in a separate \addtoindex{supplementary object file} that
131 contains supplementary debug sections.
132 See Section \refersec{datarep:dwarfsupplemetaryobjectfiles} for
135 \section{Attribute Types}
136 \label{chap:attributetypes}
137 Each attribute value is characterized by an attribute name.
138 \addtoindexx{attribute duplication}
139 No more than one attribute with a given name may appear in any
140 debugging information entry.
141 There are no limitations on the
142 \addtoindexx{attribute ordering}
143 ordering of attributes within a debugging information entry.
145 The attributes are listed in Table \referfol{tab:attributenames}.
147 \setlength{\extrarowheight}{0.1cm}
148 \addtoindexx{attributes!list of}
149 \begin{longtable}{P{6.2cm}|P{8.5cm}}
150 \caption{Attribute names} \label{tab:attributenames} \\
151 \hline \bfseries Attribute$^*$&\bfseries Usage \\ \hline
153 \bfseries Attribute$^*$&\bfseries Identifies or Specifies \\ \hline
158 \vspace{2mm}\emph{Continued on next page} \newline
159 $^*${\parbox[t]{15cm}{\tiny Links for attributes come to the left column of this table;
160 links in the right column "fan-out" to one or more descriptions.}} \newline
165 $^*${\parbox[t]{15cm}{\tiny Links for attributes come to the left column of this table;
166 links in the right column "fan-out" to one or more descriptions.}}}
169 \DWATabstractoriginTARG
170 &\livelinki{chap:DWATabstractorigininlineinstance}
171 {Inline instances of inline subprograms}
172 {inline instances of inline subprograms} \\
173 % Heren livelink we cannot use \dash or \dash{}.
174 &\livelinki{chap:DWATabstractoriginoutoflineinstance}
175 {Out-of-line instances of inline subprograms}
176 {out-of-line instances of inline subprograms} \\
177 \DWATaccessibilityTARG
178 &\livelink{chap:DWATaccessdeclaration}
179 {Access declaration} (\addtoindex{C++}, \addtoindex{Ada}) \\
180 &\livelink{chap:DWATaccessibilitycppinheritedmembers}
181 {Accessibility of base or inherited class} (\addtoindex{C++}) \\
182 &\livelinki{chap:DWATaccessibilityattribute}
183 {Accessibility of data member or member function}
184 {accessibility attribute}
186 \DWATaddressclassTARG
187 &\livelinki{chap:DWATadressclasspointerorreferencetypes}
188 {Pointer or reference types}
189 {pointer or reference types} \\
190 &\livelinki{chap:DWATaddressclasssubroutineorsubroutinetype}
191 {Subroutine or subroutine type}
192 {subroutine or subroutine type} \\
194 &\livelinki{chap:DWATaddrbaseforaddresstable}
195 {Base offset for address table}
198 &\livelinki{chap:DWATalignmentnondefault}
199 {Non-default alignment of type, subprogram or variable}
200 {non-default alignment} \addtoindexx{alignment!non-default} \\
202 &\livelinki{chap:DWATallocatedallocationstatusoftypes}
203 {Allocation status of types}
204 {allocation status of types} \\
206 &\livelinki{chap:DWATartificialobjectsortypesthat}
207 {Objects or types that are not actually declared in the source}
208 {objects or types that are not actually declared in the source} \\
209 \DWATassociatedTARG{}
210 &\livelinki{chap:DWATassociatedassociationstatusoftypes}
211 {Association status of types}
212 {association status of types} \\
214 &\livelinki{chap:DWATbasetypesprimitivedatatypesofcompilationunit}
215 {Primitive data types of compilation unit}
216 {primitive data types of compilation unit} \\
217 \DWATbinaryscaleTARG{}
218 &\livelinki{chap:DWATbinaryscalebinaryscalefactorforfixedpointtype}
219 {Binary scale factor for fixed-point type}
220 {binary scale factor for fixed-point type} \\
221 %\DWATbitoffsetTARG{}
222 %&\livelinki{chap:DWATbitoffsetbasetypebitlocation}{Base type bit location}{base type bit location} \\
223 %&\livelinki{chap:DWATbitoffsetdatamemberbitlocation}{Data member bit location}{data member bit location} \\
225 &\livelinki{chap:DWATbitsizebasetypebitsize}
226 {Size of a base type in bits}
227 {base type bit size} \\
228 &\livelinki{chap:DWATbitsizedatamemberbitsize}
229 {Size of a data member in bits}
230 {data member bit size} \\
232 &\livelinki{chap:DWATbitstridearrayelementstrideofarraytype}
233 {Array element stride (of array type)}
234 {array element stride (of array type)} \\*
235 &\livelinki{chap:DWATbitstridesubrangestridedimensionofarraytype}
236 {Subrange stride (dimension of array type)}
237 {subrange stride (dimension of array type)} \\*
238 &\livelinki{chap:DWATbitstrideenumerationstridedimensionofarraytype}
239 {Enumeration stride (dimension of array type)}
240 {enumeration stride (dimension of array type)} \\
242 &\livelinki{chap:DWATbytesizedataobjectordatatypesize}
243 {Size of a data object or data type in bytes}
244 {data object or data type size} \\
245 \DWATbytestrideTARG{}
246 &\livelinki{chap:DWATbytestridearrayelementstrideofarraytype}
247 {Array element stride (of array type)}
248 {array element stride (of array type)} \\
249 &\livelinki{chap:DWATbytestridesubrangestridedimensionofarraytype}
250 {Subrange stride (dimension of array type)}
251 {subrange stride (dimension of array type)} \\
252 &\livelinki{chap:DWATbytestrideenumerationstridedimensionofarraytype}
253 {Enumeration stride (dimension of array type)}
254 {enumeration stride (dimension of array type)} \\
255 \DWATcallallcallsTARG{}
256 &\livelinki{chap:DWATcallallcallsofasubprogram}
257 {All tail and normal calls in a subprogram are described by call site entries}
258 {all tail and normal calls are described}
259 \index{call site!summary!all tail and normal calls are described} \\
260 \DWATcallallsourcecallsTARG{}
261 &\livelinki{chap:DWATcallallsourcecallsofasubprogram}
262 {All tail, normal and inlined calls in a subprogram are described by call site and inlined subprogram entries}
263 {all tail, normal and inlined calls are described}
264 \index{call site!summary!all tail, normal and inlined calls are described} \\
265 \DWATcallalltailcallsTARG{}
266 &\livelinki{chap:DWATcallalltailcallsofasubprogram}
267 {All tail calls in a subprogram are described by call site entries}
268 {all tail calls are described}
269 \index{call site!summary!all tail calls are described} \\
270 \DWATcallcolumnTARG{}
271 &\livelinki{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}
272 {Column position of inlined subroutine call}
273 {column position of inlined subroutine call} \\
274 &\livelinki{chap:DWATcallcolumnofcallsite}
275 {Column position of call site of non-inlined call}
276 {column position of call site of non-inlined call} \\
277 \DWATcalldatalocationTARG{}
278 &\livelinki{chap:DWATcalldatalocationofcallparameter}
279 {Address of the value pointed to by an argument passed in a call}
280 {address of the value pointed to by an argument}
281 \index{call site!address of the value pointed to by an argument} \\
282 \DWATcalldatavalueTARG{}
283 &\livelinki{chap:DWATcalldatavalueofcallparameter}
284 {Value pointed to by an argument passed in a call}
285 {value pointed to by an argument}
286 \index{call site!value pointed to by an argument} \\
288 &\livelinki{chap:DWATcallfilefilecontaininginlinedsubroutinecall}
289 {File containing inlined subroutine call}
290 {file containing inlined subroutine call} \\
291 &\livelinki{chap:DWATcallfileofcallsite}
292 {File containing call site of non-inlined call}
293 {file containing call site of non-inlined call} \\
295 &\livelinki{chap:DWATcalllinelinenumberofinlinedsubroutinecall}
296 {Line number of inlined subroutine call}
297 {line number of inlined subroutine call} \\
298 &\livelinki{chap:DWATcalllineofcallsite}
299 {Line containing call site of non-inlined call}
300 {line containing call site of non-inlined call} \\
301 \DWATcallingconventionTARG{}
302 &\livelinki{chap:DWATcallingconventionforsubprograms}
303 {Calling convention for subprograms}
304 {Calling convention!for subprograms} \\
305 &\livelinki{chap:DWATcallingconventionfortypes}
306 {Calling convention for types}
307 {Calling convention!for types} \\
308 \DWATcalloriginTARG{}
309 &\livelinki{chap:DWATcalloriginofcallsite}
310 {Subprogram called in a call}
312 \index{call site!subprogram called} \\
313 \DWATcallparameterTARG{}
314 &\livelinki{chap:DWATcallparameterofcallparameter}
315 {Parameter entry in a call}
317 \index{call site!parameter entry} \\
319 &\livelinki{chap:DWATcallpcofcallsite}
320 {Address of the call instruction in a call}
321 {address of call instruction}
322 \index{call site!address of the call instruction} \\
323 \DWATcallreturnpcTARG{}
324 &\livelinki{chap:DWATcallreturnpcofcallsite}
325 {Return address from a call}
326 {return address from a call}
327 \index{call site!return address} \\
328 \DWATcalltailcallTARG{}
329 &\livelinki{chap:DWATcalltailcallofcallsite}
330 {Call is a tail call}
331 {call is a tail call}
332 \index{call site!tail call} \\
333 \DWATcalltargetTARG{}
334 &\livelinki{chap:DWATcalltargetofcallsite}
335 {Address of called routine in a call}
336 {address of called routine}
337 \index{call site!address of called routine} \\
338 \DWATcalltargetclobberedTARG{}
339 &\livelinki{chap:DWATcalltargetclobberedofcallsite}
340 {Address of called routine, which may be clobbered, in a call}
341 {address of called routine, which may be clobbered}
342 \index{call site!address of called routine, which may be clobbered} \\
344 &\livelinki{chap:DWATcallvalueofcallparameter}
345 {Argument value passed in a call}
346 {argument value passed}
347 \index{call site!argument value passed} \\
348 \DWATcommonreferenceTARG
349 &\livelinki{chap:commonreferencecommonblockusage}
351 {common block usage} \\
353 &\livelinki{chap:DWATcompdircompilationdirectory}
354 {Compilation directory}
355 {compilation directory} \\
357 &\livelinki{chap:DWATconstexprcompiletimeconstantobject}
358 {Compile-time constant object}
359 {compile-time constant object} \\
360 &\livelinki{chap:DWATconstexprcompiletimeconstantfunction}
361 {Compile-time constant function}
362 {compile-time constant function} \\
364 &\livelinki{chap:DWATconstvalueconstantobject}
367 &\livelinki{chap:DWATconstvalueenumerationliteralvalue}
368 {Enumeration literal value}
369 {enumeration literal value} \\
370 &\livelinki{chap:DWATconstvaluetemplatevalueparameter}
371 {Template value parameter}
372 {template value parameter} \\
373 \DWATcontainingtypeTARG
374 &\livelinki{chap:DWATcontainingtypecontainingtypeofpointertomembertype}
375 {Containing type of pointer to member type}
376 {containing type of pointer to member type} \\
378 &\livelinki{chap:DWATcountelementsofsubrangetype}
379 {Elements of subrange type}
380 {elements of breg subrange type} \\
381 \DWATdatabitoffsetTARG
382 &\livelinki{chap:DWATdatabitoffsetbasetypebitlocation}
383 {Base type bit location}
384 {base type bit location} \\
385 &\livelinki{chap:DWATdatabitoffsetdatamemberbitlocation}
386 {Data member bit location}
387 {data member bit location} \\
388 \DWATdatalocationTARG{}
389 &\livelinki{chap:DWATdatalocationindirectiontoactualdata}
390 {Indirection to actual data}
391 {indirection to actual data} \\
392 \DWATdatamemberlocationTARG
393 &\livelinki{chap:DWATdatamemberlocationdatamemberlocation}
394 {Data member location}
395 {data member location} \\
396 &\livelinki{chap:DWATdatamemberlocationinheritedmemberlocation}
397 {Inherited member location}
398 {inherited member location} \\
399 \DWATdecimalscaleTARG
400 &\livelinki{chap:DWATdecimalscaledecimalscalefactor}
401 {Decimal scale factor}
402 {decimal scale factor} \\
404 &\livelinki{chap:DWATdecimalsigndecimalsignrepresentation}
405 {Decimal sign representation}
406 {decimal sign representation} \\
408 &\livelinki{chap:DWATdeclcolumncolumnpositionofsourcedeclaration}
409 {Column position of source declaration}
410 {column position of source declaration} \\
412 &\livelinki{chap:DWATdeclfilefilecontainingsourcedeclaration}
413 {File containing source declaration}
414 {file containing source declaration} \\
416 &\livelinki{chap:DWATdecllinelinenumberofsourcedeclaration}
417 {Line number of source declaration}
418 {line number of source declaration} \\
420 &\livelinki{chap:DWATdeclarationincompletenondefiningorseparateentitydeclaration}
421 {Incomplete, non-defining, or separate entity declaration}
422 {incomplete, non-defining, or separate entity declaration} \\
424 &\livelinki{chap:DWATdefaulteddef}
425 {Whether a member function has been declared as default}
426 {defaulted attribute} \\
427 \DWATdefaultvalueTARG
428 &\livelinki{chap:DWATdefaultvaluedefaultvalueofparameter}
429 {Default value of parameter}
430 {default value of parameter} \\
432 &\livelinki{chap:DWATdeleteddef}
433 {Whether a member has been declared as deleted}
434 {Deletion of member function} \\
435 \DWATdescriptionTARG{}
436 &\livelinki{chap:DWATdescriptionartificialnameordescription}
437 {Artificial name or description}
438 {artificial name or description} \\
440 &\livelinki{chap:DWATdigitcountdigitcountforpackeddecimalornumericstringtype}
441 {Digit count for packed decimal or numeric string type}
442 {digit count for packed decimal or numeric string type} \\
444 &\livelinki{chap:DWATdiscrdiscriminantofvariantpart}
445 {Discriminant of variant part}
446 {discriminant of variant part} \\
448 &\livelinki{chap:DWATdiscrlistlistofdiscriminantvalues}
449 {List of discriminant values}
450 {list of discriminant values} \\
452 &\livelinki{chap:DWATdiscrvaluediscriminantvalue}
454 {discriminant value} \\
456 &\livelinki{chap:DWATdwonameforunit}
457 {Name of split DWARF object file}
458 {split DWARF object file!object file name} \\
460 &\livelinki{chap:DWATelementalelementalpropertyofasubroutine}
461 {Elemental property of a subroutine}
462 {elemental property of a subroutine} \\
464 &\livelinki{chap:DWATencodingencodingofbasetype}
465 {Encoding of base type}
466 {encoding of base type} \\
468 &\livelinki{chap:DWATendianityendianityofdata}
470 {endianity of data} \\
472 &\livelinki{chap:entryaddressofscope}
473 {Entry address of a scope (compilation unit, \mbox{subprogram,} and so on)}
474 {entry address of a scope} \\
476 &\livelinki{chap:DWATenumclasstypesafeenumerationdefinition}
477 {Type safe enumeration definition}
478 {type safe enumeration definition}\\
480 &\livelinki{chap:DWATexplicitexplicitpropertyofmemberfunction}
481 {Explicit property of member function}
482 {explicit property of member function}\\
483 \DWATexportsymbolsTARG
484 &\livelinki{chap:DWATexportsymbolsofnamespace}
485 {Export (inline) symbols of namespace}
486 {export symbols of a namespace} \\
487 &\livelinki{chap:DWATexportsymbolsofstructunionclass}
488 {Export symbols of a structure, union or class}
489 {export symbols of a structure, union or class} \\
491 &\livelinki{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}
492 {Previous namespace extension or original namespace}
493 {previous namespace extension or original namespace}\\
495 &\livelinki{chap:DWATexternalexternalsubroutine}
496 {External subroutine}
497 {external subroutine} \\
498 &\livelinki{chap:DWATexternalexternalvariable}
500 {external variable} \\
502 &\livelinki{chap:DWATframebasesubroutineframebaseaddress}
503 {Subroutine frame base address}
504 {subroutine frame base address} \\
506 &\livelinki{chap:DWATfriendfriendrelationship}
507 {Friend relationship}
508 {friend relationship} \\
510 &\livelinki{chap:DWAThighpccontiguousrangeofcodeaddresses}
511 {Contiguous range of code addresses}
512 {contiguous range of code addresses} \\
513 \DWATidentifiercaseTARG
514 &\livelinki{chap:DWATidentifiercaseidentifiercaserule}
515 {Identifier case rule}
516 {identifier case rule} \\
518 &\livelinki{chap:DWATimportimporteddeclaration}
519 {Imported declaration}
520 {imported declaration} \\*
521 &\livelinki{chap:DWATimportimportedunit}
524 &\livelinki{chap:DWATimportnamespacealias}
526 {namespace alias} \\*
527 &\livelinki{chap:DWATimportnamespaceusingdeclaration}
528 {Namespace using declaration}
529 {namespace using declaration} \\*
530 &\livelinki{chap:DWATimportnamespaceusingdirective}
531 {Namespace using directive}
532 {namespace using directive} \\
534 &\livelinki{chap:DWATinlineabstracttinstance}
536 {abstract instance} \\
537 &\livelinki{chap:DWATinlineinlinedsubroutine}
539 {inlined subroutine} \\
541 &\livelinki{chap:DWATisoptionaloptionalparameter}
543 {optional parameter} \\
545 &\livelinki{chap:DWATlanguageprogramminglanguage}
546 {Programming language}
547 {programming language} \\
549 &\livelinki{chap:DWATlinkagenameobjectfilelinkagenameofanentity}
550 {Object file linkage name of an entity}
551 {object file linkage name of an entity}\\
553 &\livelinki{chap:DWATlocationdataobjectlocation}
554 {Data object location}
555 {data object location}\\
557 \DWATloclistsbaseTARG
558 &\livelinki{chap:DWATloclistsbaseinlocationlist}
559 {Location lists base}
560 {location lists base}
564 &\livelinki{chap:DWATlowpccodeaddressorrangeofaddresses}
565 {Code address or range of addresses}
566 {code address or range of addresses}\\*
567 &\livelinki{chap:DWATlowpcbaseaddressofscope}
568 {Base address of scope}
569 {base address of scope}\\
571 &\livelinki{chap:DWATlowerboundlowerboundofsubrange}
572 {Lower bound of subrange}
573 {lower bound of subrange} \\
575 &\livelinki{chap:DWATmacroinfomacroinformation}
576 {Macro preprocessor information (legacy)}
577 {macro preprocessor information (legacy)} \\
578 & \textit{(reserved for coexistence with \DWARFVersionIV{} and earlier)} \\
580 &\livelinki{chap:DWATmacrosmacroinformation}
581 {Macro preprocessor information}
582 {macro preprocessor information} \\
583 & \textit{(\texttt{\#define}, \texttt{\#undef}, and so on in \addtoindex{C},
584 \addtoindex{C++} and similar languages)} \\
585 \DWATmainsubprogramTARG
586 &\livelinki{chap:DWATmainsubprogrammainorstartingsubprogram}
587 {Main or starting subprogram}
588 {main or starting subprogram} \\
589 &\livelinki{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}
590 {Unit containing main or starting subprogram}
591 {unit containing main or starting subprogram}\\
593 &\livelinki{chap:DWATmutablemutablepropertyofmemberdata}
594 {Mutable property of member data}
595 {mutable property of member data} \\
597 &\livelinki{chap:DWATnamenameofdeclaration}
598 {Name of declaration}
599 {name of declaration}\\
600 &\livelinki{chap:DWATnamepathnameofcompilationsource}
601 {Path name of compilation source}
602 {path name of compilation source} \\
603 \DWATnamelistitemTARG
604 &\livelinki{chap:DWATnamelistitemnamelistitem}
608 &\livelinki{chap:DWATnoreturnofsubprogram}
609 {\doublequote{no return} property of a subprogram}
610 {noreturn attribute} \\
611 \DWATobjectpointerTARG
612 &\livelinki{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}
613 {Object (\texttt{this}, \texttt{self}) pointer of member function}
614 {object (\texttt{this}, \texttt{self}) pointer of member function}\\
616 &\livelinki{chap:DWATorderingarrayrowcolumnordering}
617 {Array row/column ordering}
618 {array row/column ordering}\\
619 \DWATpicturestringTARG
620 &\livelinki{chap:DWATpicturestringpicturestringfornumericstringtype}
621 {Picture string for numeric string type}
622 {picture string for numeric string type} \\
624 &\livelinki{chap:DWATprioritymodulepriority}
628 &\livelinki{chap:DWATproducercompileridentification}
629 {Compiler identification}
630 {compiler identification}\\
632 &\livelinki{chap:DWATprototypedsubroutineprototype}
633 {Subroutine prototype}
634 {subroutine prototype}\\
636 &\livelinki{chap:DWATpurepurepropertyofasubroutine}
637 {Pure property of a subroutine}
638 {pure property of a subroutine} \\
640 &\livelinki{chap:DWATrangesnoncontiguousrangeofcodeaddresses}
641 {Non-contiguous range of code addresses}
642 {non-contiguous range of code addresses} \\
644 \DWATrnglistsbaseTARG
646 &\livelinki{chap:DWATrnglistsbase}
647 {Base offset for range lists}
650 &\livelinki{chap:DWATrankofdynamicarray}
651 {Dynamic number of array dimensions}
652 {dynamic number of array dimensions} \\
654 &\livelinki{chap:DWATrecursiverecursivepropertyofasubroutine}
655 {Recursive property of a subroutine}
656 {recursive property of a subroutine} \\
658 &\livelink{chap:DWATreferenceofnonstaticmember}
659 {\&-qualified non-static member function} \textit{(\addtoindex{C++})} \\
661 &\livelinki{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}
662 {Subroutine return address save location}
663 {subroutine return address save location} \\
664 \DWATrvaluereferenceTARG
665 &\livelink{chap:DWATrvaluereferenceofnonstaticmember}
666 {\&\&-qualified non-static member function} \textit{(\addtoindex{C++})} \\
669 &\livelinki{chap:DWATsegmentaddressinginformation}
670 {Addressing information}
671 {addressing information} \\
673 &\livelinki{chap:DWATsiblingdebugginginformationentryrelationship}
674 {Debugging information entry relationship}
675 {debugging information entry relationship} \\
677 &\livelinki{chap:DWATsmallscalefactorforfixedpointtype}
678 {Scale factor for fixed-point type}
679 {scale factor for fixed-point type} \\
681 &\livelinki{chap:DWATsignaturetypesignature}
684 \DWATspecificationTARG
685 &\livelinki{chap:DWATspecificationincompletenondefiningorseparatedeclaration}
686 {Incomplete, non-defining, or separate declaration corresponding to a declaration}
687 {incomplete, non-defining, or separate declaration corresponding to a declaration} \\
689 &\livelinki{chap:DWATstartscopeofdeclaration}
690 {Reduced scope of declaration}
691 {reduced scope of declaration} \\*
693 &\livelinki{chap:DWATstaticlinklocationofuplevelframe}
694 {Location of uplevel frame}
695 {location of uplevel frame} \\
697 &\livelinki{chap:DWATstmtlistlinenumberinformationforunit}
698 {Line number information for unit}
699 {line number information for unit}\\
700 \DWATstringlengthTARG
701 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
702 {String length of string type}
703 {string length of string type} \\
704 \DWATstringlengthbitsizeTARG
705 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
706 {Size of string length of string type}
707 {string length of string type!size of} \\
708 \DWATstringlengthbytesizeTARG
709 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}
710 {Size of string length of string type}
711 {string length of string type!size of} \\
712 \DWATstroffsetsbaseTARG
713 &\livelinki{chap:DWATstroffsetbaseforindirectstringtable}
714 {Base of string offsets table}
715 {string offsets table} \\
716 \DWATthreadsscaledTARG
717 &\livelink{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}
718 {Array bound THREADS scale factor}
719 \bbeb (\addtoindex{UPC}) \\
721 &\livelinki{chap:DWATtrampolinetargetsubroutine}
723 {target subroutine of trampoline} \\
725 &\livelinki{chap:DWATtypeofcallsite}
727 {type!of call site} \\
728 &\livelinki{chap:DWAATtypeofstringtype}
729 {Type of string type components}
730 {type!of string type components} \\
731 &\livelinki{chap:DWATtypetypeofsubroutinereturn}
732 {Type of subroutine return}
733 {type!of subroutine return} \\
734 &\livelinki{chap:DWATtypetypeofdeclaration}
735 {Type of declaration}
736 {type!of declaration} \\
738 &\livelinki{chap:DWATupperboundupperboundofsubrange}
739 {Upper bound of subrange}
740 {upper bound of subrange} \\
742 &\livelinki{chap:DWATuselocationmemberlocationforpointertomembertype}
743 {Member location for pointer to member type}
744 {member location for pointer to member type} \\
745 \DWATuseUTFeightTARG\addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
746 &\livelinki{chap:DWATuseUTF8compilationunitusesutf8strings}
747 {Compilation unit uses UTF-8 strings}
748 {compilation unit uses UTF-8 strings} \\
749 \DWATvariableparameterTARG
750 &\livelinki{chap:DWATvariableparameternonconstantparameterflag}
751 {Non-constant parameter flag}
752 {non-constant parameter flag} \\
754 &\livelinki{chap:DWATvirtualityvirtualityindication}
755 {virtuality attribute}
756 {Virtuality of member function or base class} \\
758 &\livelinki{chap:DWATvisibilityvisibilityofdeclaration}
759 {Visibility of declaration}
760 {visibility of declaration} \\
761 \DWATvtableelemlocationTARG
762 &\livelinki{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}
763 {Virtual function vtable slot}
764 {virtual function vtable slot}\\
767 \addtoindexx{address|see {\textit{also} address class}}
768 \addtoindexx{addrptr|see {\textit{also} addrptr class}}
769 \addtoindexx{block|see {\textit{also} block class}}
770 \addtoindexx{constant|see {\textit{also} constant class}}
771 \addtoindexx{exprloc|see {\textit{also} exprloc class}}
772 \addtoindexx{flag|see {\textit{also} flag class}}
773 \addtoindexx{lineptr|see {\textit{also} lineptr class}}
774 \addtoindexx{loclistsptr|see {\textit{also} loclistsptr class}}
775 \addtoindexx{loclist|see {\textit{also} loclist class}}
776 \addtoindexx{macptr|see {\textit{also} macptr class}}
777 \addtoindexx{rnglistsptr|see {\textit{also} rnglistsptr class}}
778 \addtoindexx{rnglist|see {\textit{also} rnglist class}}
779 \addtoindexx{reference|see {\textit{also} reference class}}
780 \addtoindexx{string|see {\textit{also} string class}}
781 \addtoindexx{stroffsetsptr|see {\textit{also} stroffsetsptr class}}
783 \addtoindexx{class of attribute value!address|see {address class}}
784 \addtoindexx{class of attribute value!addrptr|see {addrptr class}}
785 \addtoindexx{class of attribute value!block|see {block class}}
786 \addtoindexx{class of attribute value!constant|see {constant class}}
787 \addtoindexx{class of attribute value!exprloc|see {exprloc class}}
788 \addtoindexx{class of attribute value!flag|see {flag class}}
789 \addtoindexx{class of attribute value!lineptr|see {lineptr class}}
790 \addtoindexx{class of attribute value!loclistsptr|see {loclistsptr class}}
791 \addtoindexx{class of attribute value!loclist|see {loclist class}}
792 \addtoindexx{class of attribute value!macptr|see {macptr class}}
793 \addtoindexx{class of attribute value!rnglistsptr|see {rnglistsptr class}}
794 \addtoindexx{class of attribute value!rnglist|see {rnglist class}}
795 \addtoindexx{class of attribute value!reference|see {reference class}}
796 \addtoindexx{class of attribute value!string|see {string class}}
797 \addtoindexx{class of attribute value!stroffsetsptr|see {stroffsetsptr class}}
800 The permissible values
801 \addtoindexx{attribute value classes}
802 for an attribute belong to one or more classes of attribute
804 Each form class may be represented in one or more ways.
805 For example, some attribute values consist
806 of a single piece of constant data.
807 \doublequote{Constant data}
808 is the class of attribute value that those attributes may have.
809 There are several representations of constant data,
810 including fixed length data of one, two, four, eight or 16 bytes
811 in size, and variable length data).
812 The particular representation for any given instance
813 of an attribute is encoded along with the attribute name as
814 part of the information that guides the interpretation of a
815 debugging information entry.
818 Attribute value forms belong
819 \addtoindexx{tag names!list of}
820 to one of the classes shown in Table \referfol{tab:classesofattributevalue}.
822 \begin{longtable}{l|P{11cm}}
823 \caption{Classes of attribute value}
824 \label{tab:classesofattributevalue} \\
825 \hline \bfseries Attribute Class & \bfseries General Use and Encoding \\ \hline
827 \bfseries Attribute Class & \bfseries General Use and Encoding \\ \hline
829 \hline \emph{Continued on next page}
834 \hypertarget{chap:classaddress}{}
835 \livelinki{datarep:classaddress}{address}{address class}
836 &Refers to some location in the address space of the \mbox{described} program.
839 \hypertarget{chap:classaddrptr}{}
840 \livelinki{datarep:classaddrptr}{addrptr}{addrptr class}
842 Specifies a location in the DWARF section that holds
843 a series of machine address values. Certain attributes use
844 one of these addresses by indexing relative to this location.
847 \hypertarget{chap:classblock}{}
848 \livelinki{datarep:classblock}{block}{block class}
849 & An arbitrary number of uninterpreted bytes of data.
850 The number of data bytes may be implicit from context
851 or explicitly specified by an initial unsigned LEB128 value
852 (see Section \refersec{datarep:variablelengthdata})
853 that precedes that number of data bytes.
856 \hypertarget{chap:classconstant}{}
857 \livelinki{datarep:classconstant}{constant}{constant class}
858 &One, two, four, eight or sixteen
859 bytes of uninterpreted data, or data
860 encoded in the variable length format known as LEB128
861 (see Section \refersec{datarep:variablelengthdata}).
864 \hypertarget{chap:classexprloc}{}
865 \livelinki{datarep:classexprloc}{exprloc}{exprloc class}
866 &A DWARF expression for a value or a location in the
867 address space of the described program.
868 A leading unsigned LEB128 value
869 (see Section \refersec{datarep:variablelengthdata})
870 specifies the number of bytes in the expression.
873 \hypertarget{chap:classflag}{}
874 \livelinki{datarep:classflag}{flag}{flag class}
875 &A small constant that indicates the presence or absence
879 \hypertarget{chap:classlineptr}{}
880 \livelinki{datarep:classlineptr}{lineptr}{lineptr class}
881 &Specifies a location in the DWARF section that holds line
886 \hypertarget{chap:classloclist}{}
887 \livelinki{datarep:classloclist}{loclist}{loclist class},
888 \hypertarget{chap:classloclistsptr}{}
889 \livelinki{datarep:classloclistsptr}{loclistsptr}{loclistsptr class}
891 &Specifies a location in the DWARF section that holds location
892 lists, which describe objects whose location can change during
896 \hypertarget{chap:classmacptr}{}
897 \livelinki{datarep:classmacptr}{macptr}{macptr class}
899 a location in the DWARF section that holds macro definition
904 \hypertarget{chap:classrnglist}{}
905 \livelinki{datarep:classrnglist}{rnglist}{rnglist class},
906 \hypertarget{chap:classrnglistsptr}{}
907 \livelinki{datarep:classrnglistsptr}{rnglistsptr}{rnglistsptr class}
909 &Specifies a location in the DWARF section that holds
910 non-contiguous address ranges.
913 \hypertarget{chap:classreference}{}
914 \livelinki{datarep:classreference}{reference}{reference class}
915 &Refers to one of the debugging information
916 entries that \mbox{describe} the program. There are four types of
917 \mbox{reference}. The first is an offset relative to the beginning
918 of the \mbox{compilation} unit in which the reference occurs and must
919 refer to an entry within that same compilation unit. The second
920 type of reference is the offset of a debugging \mbox{information}
921 entry in any compilation unit, including one different from
922 the unit containing the reference. The third type of reference
923 is an indirect reference to a
924 \addtoindexx{type signature}
925 type definition using an 8-byte signature
926 for that type. The fourth type of reference is a reference from within the
927 \dotdebuginfo{} section of the executable or shared object file to
928 a debugging information entry in the \dotdebuginfo{} section of
929 a \addtoindex{supplementary object file}.
932 \hypertarget{chap:classstring}{}
933 \livelinki{datarep:classstring}{string}{string class}
934 & A null-terminated sequence of zero or more
935 (non-null) bytes. Data in this class are generally
936 printable strings. Strings may be represented directly in
937 the debugging \mbox{information} entry or as an offset in a separate
941 \hypertarget{chap:classstroffsetsptr}{}
942 \livelinki{datarep:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class}
943 &Specifies a location in the DWARF section that holds
944 a series of offsets into the DWARF section that holds strings.
945 Certain attributes use one of these offsets by indexing
946 relative to this location. The resulting offset is then
947 used to index into the DWARF string section.
954 \section{Relationship of Debugging Information Entries}
955 \label{chap:relationshipofdebugginginformationentries}
957 A variety of needs can be met by permitting a single
958 \addtoindexx{debugging information entry!ownership relation}
959 debugging information entry to \doublequote{own} an arbitrary number
960 of other debugging entries and by permitting the same debugging
961 information entry to be one of many owned by another debugging
963 This makes it possible, for example, to
964 describe the static \livelink{chap:lexicalblock}{block} structure
965 within a source file,
966 to show the members of a structure, union, or class, and to
967 associate declarations with source files or source files
968 with shared object files.
972 The ownership relationship
973 \addtoindexx{debugging information entry!ownership relation}
975 information entries is achieved naturally because the debugging
976 information is represented as a tree. The nodes of the tree
977 are the debugging information entries themselves.
978 The child entries of any node are exactly those debugging information
979 entries owned by that node.
982 While the ownership relation
983 of the debugging information entries is represented as a
984 tree, other relations among the entries exist, for example,
985 a reference from an entry representing a variable to another
986 entry representing the type of that variable.
988 relations are taken into account, the debugging entries
989 form a graph, not a tree.
993 The tree itself is represented
994 by flattening it in prefix order.
995 Each debugging information
996 entry is defined either to have child entries or not to have
997 child entries (see Section \refersec{datarep:abbreviationstables}).
998 If an entry is defined not
999 to have children, the next physically succeeding entry is a
1001 If an entry is defined to have children, the next
1002 physically succeeding entry is its first child.
1004 children are represented as siblings of the first child.
1005 A chain of sibling entries is terminated by a null entry.
1007 In cases where a producer of debugging information feels that
1008 it\hypertarget{chap:DWATsiblingdebugginginformationentryrelationship}{}
1009 will be important for consumers of that information to
1010 quickly scan chains of sibling entries, while ignoring the
1011 children of individual siblings, that producer may attach a
1012 \addtoindexx{sibling attribute}
1013 \DWATsiblingDEFN{} attribute
1014 to any debugging information entry.
1015 The value of this attribute is a reference to the sibling entry
1016 of the entry to which the attribute is attached.
1018 \section{Target Addresses}
1019 \label{chap:targetaddressableunitsandaddresses}
1020 \label{chap:targetaddresses}
1021 \addtoindexx{size of an address}
1022 \addtoindexx{size of an address|see{\textit{also} \texttt{address\_size}}}
1023 \addtoindexx{address size|see{size of an address}}
1024 \addtoindexx{address size|see{\textit{also} \texttt{address\_size}}}
1026 Addresses, bytes and bits in DWARF use the numbering and direction
1027 conventions that are appropriate to the current language on
1030 Many places in this document refer to the size of an address
1031 on the target architecture (or equivalently, target machine)
1032 to which a DWARF description applies. For processors which
1033 can be configured to have different address sizes or different
1034 instruction sets, the intent is to refer to the configuration
1035 which is either the default for that processor or which is
1036 specified by the object file or executable file which contains
1037 the DWARF information.
1040 For example, if a particular target architecture supports
1041 both 32-bit and 64-bit addresses, the compiler will generate
1042 an object file which specifies that it contains executable
1043 code generated for one or the other of these
1044 \addtoindexx{size of an address}
1046 that case, the DWARF debugging information contained in this
1047 object file will use the same address size.}
1050 \section{DWARF Expressions}
1051 \label{chap:dwarfexpressions}
1052 DWARF expressions describe how to compute a value or
1053 specify a location. They are expressed in
1054 terms of DWARF operations that operate on a stack of values.
1056 A DWARF expression is encoded as a stream of operations,
1057 each consisting of an opcode followed by zero or more literal
1058 operands. The number of operands is implied by the opcode.
1061 general operations that are defined here, operations that are
1062 specific to location descriptions are defined in
1063 Section \refersec{chap:locationdescriptions}.
1065 \subsection{General Operations}
1066 \label{chap:generaloperations}
1067 Each general operation represents a postfix operation on
1068 a simple stack machine.
1069 Each element of the stack has a type and a value, and can represent
1070 a value of any supported base type of the target machine. Instead of
1071 a base type, elements can have a
1072 \definitionx{generic type}\livetarg{chap:generictype}{},
1073 which is an integral type that has the
1074 \addtoindex{size of an address} on the target machine and
1075 unspecified signedness. The value on the top of the stack after
1076 \doublequote{executing} the
1077 \addtoindex{DWARF expression}
1079 \addtoindexx{DWARF expression|see{\textit{also} location description}}
1080 taken to be the result (the address of the object, the
1081 value of the array bound, the length of a dynamic string,
1082 the desired value itself, and so on).
1086 \generictype{} is the same as the unspecified type used for stack operations
1087 defined in \DWARFVersionIV{} and before.
1092 \subsubsection{Literal Encodings}
1093 \label{chap:literalencodings}
1095 \addtoindexx{DWARF expression!literal encodings}
1096 following operations all push a value onto the DWARF
1098 \addtoindexx{DWARF expression!stack operations}
1099 Operations other than \DWOPconsttype{} push a value with the
1100 \generictype, and if the value of a constant in one of these
1101 operations is larger than can be stored in a single stack element,
1102 the value is truncated to the element size and the low-order bits
1103 are pushed on the stack.
1104 \begin{enumerate}[1. ]
1105 \itembfnl{\DWOPlitzeroTARG, \DWOPlitoneTARG, \dots, \DWOPlitthirtyoneTARG}
1106 The \DWOPlitnTARG{} operations encode the unsigned literal values
1107 from 0 through 31, inclusive.
1109 \itembfnl{\DWOPaddrTARG}
1110 The \DWOPaddrNAME{} operation has a single operand that encodes
1111 a machine address and whose size is the \addtoindex{size of an address}
1112 on the target machine.
1114 \itembfnl{\DWOPconstoneuTARG, \DWOPconsttwouTARG, \DWOPconstfouruTARG, \DWOPconsteightuTARG}
1116 The single operand of a \DWOPconstnuNAME{} operation provides a 1,
1117 2, 4, or 8-byte unsigned integer constant, respectively.
1119 \itembfnl{\DWOPconstonesTARG, \DWOPconsttwosTARG, \DWOPconstfoursTARG, \DWOPconsteightsTARG}
1120 The single operand of a \DWOPconstnsNAME{} operation provides a 1,
1121 2, 4, or 8-byte signed integer constant, respectively.
1124 \itembfnl{\DWOPconstuTARG}
1125 The single operand of the \DWOPconstuNAME{} operation provides
1126 an unsigned LEB128\addtoindexx{LEB128!unsigned} integer constant.
1128 \itembfnl{\DWOPconstsTARG}
1129 The single operand of the \DWOPconstsNAME{} operation provides
1130 a signed LEB128\addtoindexx{LEB128!unsigned} integer constant.
1133 \itembfnl{\DWOPaddrxTARG}
1134 The \DWOPaddrxNAME{} operation has a single operand that
1135 encodes an unsigned LEB128\addtoindexx{LEB128!unsigned} value,
1136 which is a zero-based index into the \dotdebugaddr{} section,
1137 where a machine address is stored.
1138 This index is relative to the value of the
1139 \DWATaddrbase{} attribute of the associated compilation unit.
1141 \itembfnl{\DWOPconstxTARG}
1142 The \DWOPconstxNAME{} operation has a single operand that
1143 encodes an unsigned LEB128\addtoindexx{LEB128!unsigned} value,
1144 which is a zero-based
1145 index into the \dotdebugaddr{} section, where a constant, the
1146 size of a machine address, is stored.
1147 This index is relative to the value of the
1148 \DWATaddrbase{} attribute of the associated compilation unit.
1151 \textit{The \DWOPconstxNAME{} operation is provided for constants that
1152 require link-time relocation but should not be
1153 interpreted by the consumer as a relocatable address
1154 (for example, offsets to thread-local storage).}
1157 \itembfnl{\DWOPconsttypeTARG}
1158 The \DWOPconsttypeNAME{} operation takes three operands. The first operand
1159 is an unsigned LEB128 integer that represents the offset of a debugging
1160 information entry in the current compilation unit, which must be a
1161 \DWTAGbasetype{} entry that provides the type of the constant provided. The
1162 second operand is 1-byte unsigned integer that specifies the size of the
1163 constant value, which is the same as the size of the base type referenced
1164 by the first operand. The third operand is a
1165 sequence of bytes of the given size that is
1166 interpreted as a value of the referenced type.
1168 \textit{While the size of the constant can be inferred from the base type
1169 definition, it is encoded explicitly into the operation so that the
1170 operation can be parsed easily without reference to the \dotdebuginfo{}
1176 \subsubsection{Register Values}
1177 \label{chap:registervalues}
1178 The following operations push a value onto the stack that is either the
1179 contents of a register or the result of adding the contents of a register
1180 to a given signed offset.
1181 \addtoindexx{DWARF expression!register based addressing}
1182 \DWOPregvaltype{} pushes the contents
1183 of the register together with the given base type, while the other operations
1184 push the result of adding the contents of a register to a given
1185 signed offset together with the \generictype.
1188 \begin{enumerate}[1. ]
1189 \itembfnl{\DWOPfbregTARG}
1190 The \DWOPfbregNAME{} operation provides a
1191 signed LEB128\addtoindexx{LEB128!signed} offset
1192 from the address specified by the location description in the
1193 \DWATframebase{} attribute of the current function.
1195 \textit{This is typically a stack pointer register plus or minus some offset.}
1197 \itembfnl{\DWOPbregzeroTARG, \DWOPbregoneTARG, \dots, \DWOPbregthirtyoneTARG}
1198 The single operand of the \DWOPbregnTARG{}
1200 a signed LEB128\addtoindexx{LEB128!signed} offset from
1201 the contents of the specified register.
1203 \itembfnl{\DWOPbregxTARG}
1204 The \DWOPbregxNAME{} operation provides the sum of two values specified
1205 by its two operands. The first operand is a register number
1206 which is specified by an unsigned LEB128\addtoindexx{LEB128!unsigned}
1207 number. The second operand is a signed LEB128\addtoindexx{LEB128!signed} offset.
1210 \itembfnl{\DWOPregvaltypeTARG}
1211 The \DWOPregvaltypeNAME{} operation provides the contents of
1212 a given register interpreted as a value of a given type. The first
1213 operand is an unsigned LEB128\addtoindexx{LEB128!unsigned} number,
1214 which identifies a register whose contents is to
1215 be pushed onto the stack. The second operand is an
1216 unsigned LEB128\addtoindexx{LEB128!unsigned} number
1217 that represents the offset of a debugging information entry in the current
1218 compilation unit, which must be a \DWTAGbasetype{} entry that provides the
1219 type of the value contained in the specified register.
1224 \subsubsection{Stack Operations}
1225 \label{chap:stackoperations}
1227 \addtoindexx{DWARF expression!stack operations}
1228 operations manipulate the DWARF stack. Operations
1229 that index the stack assume that the top of the stack (most
1230 recently added entry) has index 0.
1232 Each entry on the stack has an associated type.
1235 \begin{enumerate}[1. ]
1236 \itembfnl{\DWOPdupTARG}
1237 The \DWOPdupNAME{} operation duplicates the value (including its
1238 type identifier) at the top of the stack.
1240 \itembfnl{\DWOPdropTARG}
1241 The \DWOPdropNAME{} operation pops the value (including its type
1242 identifier) at the top of the stack.
1244 \itembfnl{\DWOPpickTARG}
1245 The single operand of the \DWOPpickNAME{} operation provides a
1246 1-byte index. A copy of the stack entry (including its
1247 type identifier) with the specified
1248 index (0 through 255, inclusive) is pushed onto the stack.
1250 \itembfnl{\DWOPoverTARG}
1251 The \DWOPoverNAME{} operation duplicates the entry currently second
1252 in the stack at the top of the stack.
1253 This is equivalent to a
1254 \DWOPpick{} operation, with index 1.
1257 \itembfnl{\DWOPswapTARG}
1258 The \DWOPswapNAME{} operation swaps the top two stack entries.
1259 The entry at the top of the stack (including its type identifier)
1260 becomes the second stack entry, and the second entry (including
1261 its type identifier) becomes the top of the stack.
1263 \itembfnl{\DWOProtTARG}
1264 The \DWOProtNAME{} operation rotates the first three stack
1265 entries. The entry at the top of the stack (including its
1266 type identifier) becomes the third stack entry, the second
1267 entry (including its type identifier) becomes the top of
1268 the stack, and the third entry (including its type identifier)
1269 becomes the second entry.
1271 \itembfnl{\DWOPderefTARG}
1272 The \DWOPderefNAME{} operation pops the top stack entry and
1273 treats it as an address. The popped value must have an integral type.
1274 The value retrieved from that address is pushed,
1275 and has the \generictype{}.
1276 The size of the data retrieved from the
1277 \addtoindexi{dereferenced}{address!dereference operator}
1278 address is the \addtoindex{size of an address} on the target machine.
1281 \itembfnl{\DWOPderefsizeTARG}
1282 The \DWOPderefsizeNAME{} operation behaves like the
1284 operation: it pops the top stack entry and treats it as an
1285 address. The popped value must have an integral type.
1286 The value retrieved from that address is pushed,
1287 and has the \generictype{}.
1288 In the \DWOPderefsizeNAME{} operation, however, the size in bytes
1289 of the data retrieved from the dereferenced address is
1290 specified by the single operand. This operand is a 1-byte
1291 unsigned integral constant whose value may not be larger
1292 than the size of the \generictype. The data
1293 retrieved is zero extended to the size of an address on the
1294 target machine before being pushed onto the expression stack.
1296 \itembfnl{\DWOPdereftypeTARG}
1297 The \DWOPdereftypeNAME{} operation behaves like the \DWOPderefsize{} operation:
1298 it pops the top stack entry and treats it as an address.
1299 The popped value must have an integral type.
1300 The value retrieved from that address is pushed together with a type identifier.
1301 In the \DWOPdereftypeNAME{} operation, the size in
1302 bytes of the data retrieved from the dereferenced address is specified by
1303 the first operand. This operand is a 1-byte unsigned integral constant whose
1304 value which is the same as the size of the base type referenced
1305 by the second operand.
1306 The second operand is an unsigned LEB128 integer that
1307 represents the offset of a debugging information entry in the current
1308 compilation unit, which must be a \DWTAGbasetype{} entry that provides the
1309 type of the data pushed.
1311 \textit{While the size of the pushed value could be inferred from the base
1312 type definition, it is encoded explicitly into the operation so that the
1313 operation can be parsed easily without reference to the \dotdebuginfo{}
1317 \itembfnl{\DWOPxderefTARG}
1318 The \DWOPxderefNAME{} operation provides an extended dereference
1319 mechanism. The entry at the top of the stack is treated as an
1320 address. The second stack entry is treated as an \doublequote{address
1321 space identifier} for those architectures that support
1322 \addtoindexi{multiple}{address space!multiple}
1324 Both of these entries must have integral type identifiers.
1325 The top two stack elements are popped,
1326 and a data item is retrieved through an implementation-defined
1327 address calculation and pushed as the new stack top together with the
1328 \generictype{} identifier.
1329 The size of the data retrieved from the
1330 \addtoindexi{dereferenced}{address!dereference operator}
1331 address is the size of the \generictype.
1334 \itembfnl{\DWOPxderefsizeTARG}
1335 The \DWOPxderefsizeNAME{} operation behaves like the
1336 \DWOPxderef{} operation. The entry at the top of the stack is
1337 treated as an address. The second stack entry is treated as
1338 an \doublequote{address space identifier} for those architectures
1340 \addtoindexi{multiple}{address space!multiple}
1342 Both of these entries must have integral type identifiers.
1344 elements are popped, and a data item is retrieved through an
1345 implementation\dash defined address calculation and pushed as the
1346 new stack top. In the \DWOPxderefsizeNAME{} operation, however,
1347 the size in bytes of the data retrieved from the
1348 \addtoindexi{dereferenced}{address!dereference operator}
1349 address is specified by the single operand. This operand is a
1350 1-byte unsigned integral constant whose value may not be larger
1351 than the \addtoindex{size of an address} on the target machine. The data
1352 retrieved is zero extended to the \addtoindex{size of an address} on the
1353 target machine before being pushed onto the expression stack together
1354 with the \generictype{} identifier.
1356 \itembfnl{\DWOPxdereftypeTARG}
1357 The \DWOPxdereftypeNAME{} operation behaves like the \DWOPxderefsize{}
1358 operation: it pops the top two stack entries, treats them as an address and
1359 an address space identifier, and pushes the value retrieved. In the
1360 \DWOPxdereftypeNAME{} operation, the size in bytes of the data retrieved from
1361 the dereferenced address is specified by the first operand. This operand is
1362 a 1-byte unsigned integral constant whose value
1363 value which is the same as the size of the base type referenced
1364 by the second operand. The second
1365 operand is an unsigned LEB128 integer that represents the offset of a
1366 debugging information entry in the current compilation unit, which must be a
1367 \DWTAGbasetype{} entry that provides the type of the data pushed.
1370 \itembfnl{\DWOPpushobjectaddressTARG}
1371 The \DWOPpushobjectaddressNAME{}
1372 operation pushes the address
1373 of the object currently being evaluated as part of evaluation
1374 of a user presented expression. This object may correspond
1375 to an independent variable described by its own debugging
1376 information entry or it may be a component of an array,
1377 structure, or class whose address has been dynamically
1378 determined by an earlier step during user expression
1381 \textit{This operator provides explicit functionality
1382 (especially for arrays involving descriptors) that is analogous
1383 to the implicit push of the base
1384 \addtoindexi{address}{address!implicit push of base}
1385 of a structure prior to evaluation of a
1386 \DWATdatamemberlocation{}
1387 to access a data member of a structure. For an example, see
1388 Appendix \refersec{app:aggregateexamples}.}
1391 \itembfnl{\DWOPformtlsaddressTARG}
1392 The \DWOPformtlsaddressNAME{}
1393 operation pops a value from the stack, which must have an
1394 integral type identifier, translates this
1395 value into an address in the
1396 \addtoindex{thread-local storage}
1397 for a thread, and pushes the address
1398 onto the stack together with the \generictype{} identifier.
1399 The meaning of the value on the top of the stack prior to this
1400 operation is defined by the run-time environment. If the run-time
1401 environment supports multiple thread-local storage
1402 \nolink{blocks} for a single thread, then the \nolink{block}
1403 corresponding to the executable or shared
1404 library containing this DWARF expression is used.
1406 \textit{Some implementations of
1407 \addtoindex{C}, \addtoindex{C++}, \addtoindex{Fortran}, and other
1408 languages, support a
1409 thread-local storage class. Variables with this storage class
1410 have distinct values and addresses in distinct threads, much
1411 as automatic variables have distinct values and addresses in
1412 each function invocation. Typically, there is a single \nolink{block}
1413 of storage containing all thread\dash local variables declared in
1414 the main executable, and a separate \nolink{block} for the variables
1415 declared in each shared library. Each
1416 thread\dash local variable can then be accessed in its block using an
1417 identifier. This identifier is typically an offset into the block and
1418 pushed onto the DWARF stack by one of the
1419 \DWOPconstnx{} operations prior to the
1420 \DWOPformtlsaddress{} operation.
1421 Computing the address of
1422 the appropriate \nolink{block} can be complex (in some cases, the
1423 compiler emits a function call to do it), and difficult
1424 to describe using ordinary DWARF location descriptions.
1425 Instead of forcing complex thread-local storage calculations into
1426 the DWARF expressions, the \DWOPformtlsaddress{} allows the consumer
1427 to perform the computation based on the run-time environment.}
1430 \itembfnl{\DWOPcallframecfaTARG}
1431 The \DWOPcallframecfaNAME{}
1432 operation pushes the value of the
1433 CFA, obtained from the Call Frame Information
1434 (see Section \refersec{chap:callframeinformation}).
1436 \textit{Although the value of \DWATframebase{}
1437 can be computed using other DWARF expression operators,
1438 in some cases this would require an extensive location list
1439 because the values of the registers used in computing the
1440 CFA change during a subroutine. If the
1441 Call Frame Information
1442 is present, then it already encodes such changes, and it is
1443 space efficient to reference that.}
1446 \textit{Examples illustrating many of these stack operations are
1447 found in Appendix \refersec{app:dwarfstackoperationexamples}.}
1450 \subsubsection{Arithmetic and Logical Operations}
1451 \addtoindexx{DWARF expression!arithmetic operations}
1452 \addtoindexx{DWARF expression!logical operations}
1453 The following provide arithmetic and logical operations.
1454 Operands of an operation with two operands
1455 must have the same type,
1456 either the same base type or
1459 The result of the operation which is pushed back has the same type
1460 as the type of the operand(s).
1462 If the type of the operands is the \generictype,
1463 except as otherwise specified, the arithmetic operations
1464 perform addressing arithmetic, that is, unsigned arithmetic that is performed
1465 modulo one plus the largest representable address (for example, 0x100000000
1466 when the \addtoindex{size of an address} is 32 bits).
1468 Operations other than \DWOPabs{},
1469 \DWOPdiv{}, \DWOPminus{}, \DWOPmul{}, \DWOPneg{} and \DWOPplus{}
1470 require integral types of the operand (either integral base type
1471 or the \generictype). Operations do not cause an exception
1475 \begin{enumerate}[1. ]
1476 \itembfnl{\DWOPabsTARG}
1477 The \DWOPabsNAME{} operation pops the top stack entry, interprets
1478 it as a signed value and pushes its absolute value. If the
1479 absolute value cannot be represented, the result is undefined.
1482 \itembfnl{\DWOPandTARG}
1483 The \DWOPandNAME{} operation pops the top two stack values, performs
1484 a bitwise and operation on the two, and pushes the result.
1486 \itembfnl{\DWOPdivTARG}
1487 The \DWOPdivNAME{} operation pops the top two stack values, divides the former second entry by
1488 the former top of the stack using signed division, and pushes the result.
1490 \itembfnl{\DWOPminusTARG}
1491 The \DWOPminusNAME{} operation pops the top two stack values, subtracts the former top of the
1492 stack from the former second entry, and pushes the result.
1494 \itembfnl{\DWOPmodTARG}
1495 The \DWOPmodNAME{} operation pops the top two stack values and pushes the result of the
1496 calculation: former second stack entry modulo the former top of the stack.
1499 \itembfnl{\DWOPmulTARG}
1500 The \DWOPmulNAME{} operation pops the top two stack entries, multiplies them together, and
1504 \itembfnl{\DWOPnegTARG}
1505 The \DWOPnegNAME{} operation pops the top stack entry, interprets
1506 it as a signed value and pushes its negation. If the negation
1507 cannot be represented, the result is undefined.
1509 \itembfnl{\DWOPnotTARG}
1510 The \DWOPnotNAME{} operation pops the top stack entry, and pushes
1511 its bitwise complement.
1513 \itembfnl{\DWOPorTARG}
1514 The \DWOPorNAME{} operation pops the top two stack entries, performs
1515 a bitwise or operation on the two, and pushes the result.
1517 \itembfnl{\DWOPplusTARG}
1518 The \DWOPplusNAME{} operation pops the top two stack entries,
1519 adds them together, and pushes the result.
1522 \itembfnl{\DWOPplusuconstTARG}
1523 The \DWOPplusuconstNAME{} operation pops the top stack entry,
1524 adds it to the unsigned LEB128\addtoindexx{LEB128!unsigned}
1526 interpreted as the same type as the operand popped from the
1527 top of the stack and pushes the result.
1529 \textit{This operation is supplied specifically to be
1530 able to encode more field offsets in two bytes than can be
1532 \doublequote{\DWOPlitn~\DWOPplus.}}
1535 \itembfnl{\DWOPshlTARG}
1536 The \DWOPshlNAME{} operation pops the top two stack entries,
1537 shifts the former second entry left (filling with zero bits)
1538 by the number of bits specified by the former top of the stack,
1539 and pushes the result.
1541 \itembfnl{\DWOPshrTARG}
1542 The \DWOPshrNAME{} operation pops the top two stack entries,
1543 shifts the former second entry right logically (filling with
1544 zero bits) by the number of bits specified by the former top
1545 of the stack, and pushes the result.
1548 \itembfnl{\DWOPshraTARG}
1549 The \DWOPshraNAME{} operation pops the top two stack entries,
1550 shifts the former second entry right arithmetically (divide
1551 the magnitude by 2, keep the same sign for the result) by
1552 the number of bits specified by the former top of the stack,
1553 and pushes the result.
1555 \itembfnl{\DWOPxorTARG}
1556 The \DWOPxorNAME{} operation pops the top two stack entries,
1557 performs a bitwise exclusive\dash or operation on the two, and
1562 \subsubsection{Control Flow Operations}
1563 \label{chap:controlflowoperations}
1565 \addtoindexx{DWARF expression!control flow operations}
1566 following operations provide simple control of the flow of a DWARF expression.
1567 \begin{enumerate}[1. ]
1568 \itembfnl{\DWOPleTARG, \DWOPgeTARG, \DWOPeqTARG, \DWOPltTARG, \DWOPgtTARG, \DWOPneTARG}
1569 The six relational operators each:
1571 \item pop the top two stack values, which have the same type,
1572 either the same base type or
1576 \item compare the operands:
1578 \textless~former second entry~\textgreater \textless~relational operator~\textgreater \textless~former top entry~\textgreater
1580 \item push the constant value 1 onto the stack
1581 if the result of the operation is true or the
1582 constant value 0 if the result of the operation is false.
1583 The pushed value has the \generictype.
1586 If the operands have the \generictype, the comparisons
1587 are performed as signed operations.
1590 \itembfnl{\DWOPskipTARG}
1591 \DWOPskipNAME{} is an unconditional branch. Its single operand
1592 is a 2-byte signed integer constant. The 2-byte constant is
1593 the number of bytes of the DWARF expression to skip forward
1594 or backward from the current operation, beginning after the
1597 \itembfnl{\DWOPbraTARG}
1598 \DWOPbraNAME{} is a conditional branch. Its single operand is a
1599 2-byte signed integer constant. This operation pops the
1600 top of stack. If the value popped is not the constant 0,
1601 the 2-byte constant operand is the number of bytes of the
1602 DWARF expression to skip forward or backward from the current
1603 operation, beginning after the 2-byte constant.
1605 % The following item does not correctly hyphenate leading
1606 % to an overfull hbox and a visible artifact.
1607 % So we use \- to suggest hyphenation in this rare situation.
1608 \itembfnl{\DWOPcalltwoTARG, \DWOPcallfourTARG, \DWOPcallrefTARG}
1611 and \DWOPcallrefNAME{} perform
1612 DWARF procedure calls during evaluation of a DWARF expression or
1613 location description.
1614 For \DWOPcalltwoNAME{} and \DWOPcallfourNAME{},
1615 the operand is the 2\dash~ or 4-byte unsigned offset, respectively,
1616 of a debugging information entry in the current compilation
1617 unit. The \DWOPcallrefNAME{} operator has a single operand. In the
1618 \thirtytwobitdwarfformat,
1619 the operand is a 4-byte unsigned value;
1620 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1621 (see Section \referfol{datarep:32bitand64bitdwarfformats}).
1622 The operand is used as the offset of a
1623 debugging information entry in a
1625 section which may be contained in an executable or shared object file
1626 other than that containing the operator. For references from
1627 one executable or shared object file to another, the relocation
1628 must be performed by the consumer.
1630 \textit{Operand interpretation of
1631 \DWOPcalltwo, \DWOPcallfour{} and \DWOPcallref{} is exactly like
1632 that for \DWFORMreftwo, \DWFORMreffour{} and \DWFORMrefaddr,
1634 (see Section \refersec{datarep:attributeencodings}).}
1636 These operations transfer control of DWARF expression evaluation to
1637 \addtoindexx{location attribute}
1640 attribute of the referenced debugging information entry. If
1641 there is no such attribute, then there is no effect. Execution
1642 of the DWARF expression of
1643 \addtoindexx{location attribute}
1645 \DWATlocation{} attribute may add
1646 to and/or remove from values on the stack. Execution returns
1647 to the point following the call when the end of the attribute
1648 is reached. Values on the stack at the time of the call may be
1649 used as parameters by the called expression and values left on
1650 the stack by the called expression may be used as return values
1651 by prior agreement between the calling and called expressions.
1654 \subsubsection{Type Conversions}
1655 \label{chap:typeconversions}
1656 The following operations provides for explicit type conversion.
1658 \begin{enumerate}[1. ]
1659 \itembfnl{\DWOPconvertTARG}
1660 The \DWOPconvertNAME{} operation pops the top stack entry, converts it to a
1661 different type, then pushes the result. It takes one operand, which is an
1662 unsigned LEB128 integer that represents the offset of a debugging
1663 information entry in the current compilation unit, or value 0 which
1664 represents the \generictype. If the operand is non-zero, the
1665 referenced entry must be a \DWTAGbasetype{} entry that provides the type
1666 to which the value is converted.
1668 \itembfnl{\DWOPreinterpretTARG}
1669 The \DWOPreinterpretNAME{} operation pops the top stack entry, reinterprets
1670 the bits in its value as a value of a different type, then pushes the
1671 result. It takes one operand, which is an unsigned LEB128 integer that
1672 represents the offset of a debugging information entry in the current
1673 compilation unit, or value 0 which represents the \generictype.
1674 If the operand is non-zero, the referenced entry must be a
1675 \DWTAGbasetype{} entry that provides the type to which the value is converted.
1676 The type of the operand and result type
1680 have the same size in bits.
1685 \subsubsection{Special Operations}
1686 \label{chap:specialoperations}
1688 \addtoindexx{DWARF expression!special operations}
1689 are these special operations currently defined:
1690 \begin{enumerate}[1. ]
1691 \itembfnl{\DWOPnopTARG}
1692 The \DWOPnopNAME{} operation is a place holder. It has no effect
1693 on the location stack or any of its values.
1695 \itembfnl{\DWOPentryvalueTARG}
1696 The \DWOPentryvalueNAME{} operation pushes
1697 the value that the described location held
1698 upon entering the current subprogram. It has two operands: an
1699 unsigned LEB128\addtoindexx{LEB128!unsigned} length, followed by
1700 a block containing a DWARF expression or a register location description
1701 (see Section \refersec{chap:registerlocationdescriptions}).
1702 The length operand specifies the length
1703 in bytes of the block. If the block contains a register location
1704 description, \DWOPentryvalueNAME{} pushes the value that register had upon
1705 entering the current subprogram. If the block contains a DWARF expression,
1706 the DWARF expression is evaluated as if it has been evaluated upon entering
1707 the current subprogram. The DWARF expression
1708 assumes no values are present on the DWARF stack initially and results
1709 in exactly one value being pushed on the DWARF stack when completed.
1711 \DWOPpushobjectaddress{} is not meaningful inside of this DWARF operation.
1714 The values needed to evaluate \DWOPentryvalueNAME{} could be obtained in
1715 several ways. The consumer could suspend execution on entry to the
1716 subprogram, record values needed by \DWOPentryvalueNAME{} expressions within
1717 the subprogram, and then continue; when evaluating \DWOPentryvalueNAME{},
1718 the consumer would use these recorded values rather than the current
1719 values. Or, when evaluating \DWOPentryvalueNAME{}, the consumer could
1720 virtually unwind using the Call Frame Information
1721 (see Section \refersec{chap:callframeinformation})
1722 to recover register values that might have been clobbered since the
1723 subprogram entry point.}
1728 \section{Location Descriptions}
1729 \label{chap:locationdescriptions}
1730 \textit{Debugging information
1731 \addtoindexx{location description}
1733 \addtoindexx{location description|see{\textit{also} DWARF expression}}
1734 provide consumers a way to find
1735 the location of program variables, determine the bounds
1736 of dynamic arrays and strings, and possibly to find the
1737 base address of a subroutine\textquoteright s stack frame or the return
1738 address of a subroutine. Furthermore, to meet the needs of
1739 recent computer architectures and optimization techniques,
1740 debugging information must be able to describe the location of
1741 an object whose location changes over the object\textquoteright s lifetime.}
1743 Information about the location of program objects is provided
1744 by location descriptions. Location descriptions can be either
1746 \begin{enumerate}[1. ]
1747 \item \textit{Single location descriptions},
1749 \addtoindexx{location description!single}
1751 \addtoindexx{single location description}
1752 a language independent representation of
1753 addressing rules of arbitrary complexity built from
1754 DWARF expressions (See Section \refersec{chap:dwarfexpressions})
1756 DWARF operations specific to describing locations. They are
1757 sufficient for describing the location of any object as long
1758 as its lifetime is either static or the same as the
1759 \livelink{chap:lexicalblock}{lexical block} that owns it,
1760 and it does not move during its lifetime.
1764 \item \textit{Location lists}, which are used to
1765 \addtoindexx{location list}
1767 \addtoindexx{location description!use in location list}
1768 objects that have a limited lifetime or change their location
1769 during their lifetime. Location lists are described in
1770 Section \refersec{chap:locationlists} below.
1774 Location descriptions are distinguished in a context sensitive
1775 manner. As the value of an attribute, a location description
1776 is encoded using class \CLASSexprloc{}
1777 and a \addtoindex{location list} is encoded
1779 using class \CLASSloclist{} (which serves as an
1780 index into a separate section containing location lists).
1784 \subsection{Single Location Descriptions}
1785 \label{chap:singlelocationdescriptions}
1786 A single location description is either:
1787 \begin{enumerate}[1. ]
1788 \item A simple location description, representing an object
1789 \addtoindexx{location description!simple}
1791 \addtoindexx{simple location description}
1792 exists in one contiguous piece at the given location, or
1793 \item A composite location description consisting of one or more
1794 \addtoindexx{location description!composite}
1795 simple location descriptions, each of which is followed by
1796 one composition operation. Each simple location description
1797 describes the location of one piece of the object; each
1798 composition operation describes which part of the object is
1799 located there. Each simple location description that is a
1800 DWARF expression is evaluated independently of any others.
1805 \subsubsection{Simple Location Descriptions}
1807 \addtoindexx{location description!simple}
1808 simple location description consists of one
1809 contiguous piece or all of an object or value.
1812 \subsubsubsection{Empty Location Descriptions}
1813 An \addtoindex{empty location description}
1814 consists of a DWARF expression
1815 \addtoindexx{location description!empty}
1816 containing no operations. It represents a piece or all of an
1817 object that is present in the source but not in the object code
1818 (perhaps due to optimization).
1820 \subsubsubsection{Memory Location Descriptions}
1822 \addtoindexx{location description!memory}
1823 memory location description
1824 \addtoindexx{memory location description}
1825 consists of a non-empty DWARF
1827 Section \refersec{chap:dwarfexpressions}),
1828 whose value is the address of
1829 a piece or all of an object or other entity in memory.
1831 \subsubsubsection{Register Location Descriptions}
1832 \label{chap:registerlocationdescriptions}
1833 A register location description consists of a register name
1834 operation, which represents a piece or all of an object
1835 located in a given register.
1837 \textit{Register location descriptions describe an object
1838 (or a piece of an object) that resides in a register, while
1839 the opcodes listed in
1840 Section \refersec{chap:registervalues}
1841 are used to describe an object (or a piece of
1842 an object) that is located in memory at an address that is
1843 contained in a register (possibly offset by some constant). A
1844 register location description must stand alone as the entire
1845 description of an object or a piece of an object.
1848 The following DWARF operations can be used to
1849 specify a register location.
1851 \textit{Note that the register number represents a DWARF specific
1852 mapping of numbers onto the actual registers of a given
1853 architecture. The mapping should be chosen to gain optimal
1854 density and should be shared by all users of a given
1855 architecture. It is recommended that this mapping be defined
1856 by the ABI authoring committee for each architecture.
1858 \begin{enumerate}[1. ]
1859 \itembfnl{\DWOPregzeroTARG, \DWOPregoneTARG, ..., \DWOPregthirtyoneTARG}
1860 The \DWOPregnTARG{} operations encode the names of up to 32
1861 registers, numbered from 0 through 31, inclusive. The object
1862 addressed is in register \textit{n}.
1865 \itembfnl{\DWOPregxTARG}
1866 The \DWOPregxNAME{} operation has a single
1867 unsigned LEB128\addtoindexx{LEB128!unsigned} literal
1868 operand that encodes the name of a register.
1872 \textit{These operations name a register location. To
1873 fetch the contents of a register, it is necessary to use
1874 one of the register based addressing operations, such as
1876 (Section \refersec{chap:registervalues})}.
1878 \subsubsubsection{Implicit Location Descriptions}
1879 An \addtoindex{implicit location description}
1880 represents a piece or all
1881 \addtoindexx{location description!implicit}
1882 of an object which has no actual location but whose contents
1883 are nonetheless either known or known to be undefined.
1885 The following DWARF operations may be used to specify a value
1886 that has no location in the program but is a known constant
1887 or is computed from other locations and values in the program.
1888 \begin{enumerate}[1. ]
1889 \itembfnl{\DWOPimplicitvalueTARG}
1890 The \DWOPimplicitvalueNAME{} operation specifies an immediate value
1891 using two operands: an unsigned LEB128\addtoindexx{LEB128!unsigned}
1892 length, followed by a
1893 sequence of bytes of the given length that contain the value.
1895 \itembfnl{\DWOPstackvalueTARG}
1896 The \DWOPstackvalueNAME{}
1897 operation specifies that the object
1898 does not exist in memory but its value is nonetheless known
1899 and is at the top of the DWARF expression stack. In this form
1900 of location description, the DWARF expression represents the
1901 actual value of the object, rather than its location. The
1902 \DWOPstackvalueNAME{} operation terminates the expression.
1905 \itembfnl{\DWOPimplicitpointerTARG}
1906 \textit{An optimizing compiler may eliminate a pointer, while
1907 still retaining the value that the pointer addressed.
1908 \DWOPimplicitpointerNAME{} allows a producer to describe this value.}
1910 The \DWOPimplicitpointerNAME{} operation specifies that the object
1911 is a pointer that cannot be represented as a real pointer,
1912 even though the value it would point to can be described. In
1913 this form of location description, the DWARF expression refers
1914 to a debugging information entry that represents the actual
1915 value of the object to which the pointer would point. Thus, a
1916 consumer of the debug information would be able to show the
1917 value of the dereferenced pointer, even when it cannot show
1918 the value of the pointer itself.
1921 The \DWOPimplicitpointerNAME{} operation has two operands: a
1922 reference to a debugging information entry that describes
1923 the dereferenced object's value, and a signed number that
1924 is treated as a byte offset from the start of that value.
1925 The first operand is a 4-byte unsigned value in the 32-bit
1926 DWARF format, or an 8-byte unsigned value in the 64-bit
1927 DWARF format (see Section
1928 \refersec{datarep:32bitand64bitdwarfformats}).
1929 The second operand is a
1930 signed LEB128\addtoindexx{LEB128!signed} number.
1932 The first operand is used as the offset of a debugging
1933 information entry in a \dotdebuginfo{} section, which may be
1934 contained in an executable or shared object file other than that
1935 containing the operator. For references from one executable or
1936 shared object file to another, the relocation must be performed
1939 \textit{The debugging information entry referenced by a
1940 \DWOPimplicitpointerNAME{} operation is typically a
1941 \DWTAGvariable{} or \DWTAGformalparameter{} entry whose
1942 \DWATlocation{} attribute gives a second DWARF expression or a
1943 location list that describes the value of the object, but the
1944 referenced entry may be any entry that contains a \DWATlocation{}
1945 or \DWATconstvalue{} attribute (for example, \DWTAGdwarfprocedure).
1946 By using the second DWARF expression, a consumer can
1947 reconstruct the value of the object when asked to dereference
1948 the pointer described by the original DWARF expression
1949 containing the \DWOPimplicitpointer{} operation.}
1953 \textit{DWARF location descriptions
1954 are intended to yield the \textbf{location}
1955 of a value rather than the value itself. An optimizing compiler
1956 may perform a number of code transformations where it becomes
1957 impossible to give a location for a value, but it remains possible
1958 to describe the value itself.
1959 Section \refersec{chap:registerlocationdescriptions}
1960 describes operators that can be used to
1961 describe the location of a value when that value exists in a
1962 register but not in memory. The operations in this section are
1963 used to describe values that exist neither in memory nor in a
1968 \subsubsection{Composite Location Descriptions}
1969 A composite location description describes an object or
1970 value which may be contained in part of a register or stored
1971 in more than one location. Each piece is described by a
1972 composition operation, which does not compute a value nor
1973 store any result on the DWARF stack. There may be one or
1974 more composition operations in a single composite location
1975 description. A series of such operations describes the parts
1976 of a value in memory address order.
1978 Each composition operation is immediately preceded by a simple
1979 location description which describes the location where part
1980 of the resultant value is contained.
1981 \begin{enumerate}[1. ]
1982 \itembfnl{\DWOPpieceTARG}
1983 The \DWOPpieceNAME{} operation takes a
1984 single operand, which is an
1985 unsigned LEB128\addtoindexx{LEB128!unsigned} number.
1986 The number describes the size in bytes
1987 of the piece of the object referenced by the preceding simple
1988 location description. If the piece is located in a register,
1989 but does not occupy the entire register, the placement of
1990 the piece within that register is defined by the ABI.
1992 \textit{Many compilers store a single variable in sets of registers,
1993 or store a variable partially in memory and partially in
1994 registers. \DWOPpieceNAME{} provides a way of describing how large
1995 a part of a variable a particular DWARF location description
1999 \itembfnl{\DWOPbitpieceTARG}
2000 The \DWOPbitpieceNAME{} operation takes two operands.
2001 The first is an unsigned LEB128\addtoindexx{LEB128!unsigned}
2002 number that gives the size in bits
2003 of the piece. The second is an
2004 unsigned LEB128\addtoindexx{LEB128!unsigned} number that
2005 gives the offset in bits from the location defined by the
2006 preceding DWARF location description.
2008 Interpretation of the offset depends on the location description.
2009 If the location description is empty, the offset
2010 doesn\textquoteright{}t matter and
2011 the \DWOPbitpieceNAME{} operation describes a piece consisting
2012 of the given number of bits whose values are undefined. If
2013 the location is a register, the offset is from the least
2014 significant bit end of the register. If the location is a
2015 memory address, the \DWOPbitpieceNAME{} operation describes a
2016 sequence of bits relative to the location whose address is
2017 on the top of the DWARF stack using the bit numbering and
2018 direction conventions that are appropriate to the current
2019 language on the target system. If the location is any implicit
2020 value or stack value, the \DWOPbitpieceNAME{} operation describes
2021 a sequence of bits using the least significant bits of that
2025 \textit{\DWOPbitpieceNAME{} is
2026 used instead of \DWOPpieceNAME{} when
2027 the piece to be assembled into a value or assigned to is not
2028 byte-sized or is not at the start of a register or addressable
2032 \subsection{Location Lists}
2033 \label{chap:locationlists}
2035 Location lists are used in place of location descriptions whenever
2036 the object whose location is being described can change location
2037 during its lifetime. Location lists are contained in a separate
2038 object file section called \dotdebugloclists{} or \dotdebugloclistsdwo{}
2039 (for split DWARF object files).
2041 A location list is indicated by a location or other attribute
2042 whose value is of class \bbeb\CLASSloclist{}
2043 (see Section \refersec{datarep:classesandforms}).
2045 \textit{This location list representation, the \bbeb\CLASSloclist{} class, and the
2046 related \DWATloclistsbase{} attribute are new in \DWARFVersionV.
2047 Together they eliminate most or all of the object language relocations
2048 previously needed for location lists.}
2050 A location list consists of a series of location list entries.
2051 Each location list entry is one of the following kinds:
2053 \item \definition{Bounded location description}.\addtoindexx{bounded location description}
2054 This kind of entry provides a
2055 location description that specifies the location of
2056 an object that is valid over a lifetime bounded
2057 by a starting and ending address. The starting address is the
2058 lowest address of the address range over which the location
2059 is valid. The ending address is the address of the first
2060 location past the highest address of the address range.
2061 When the current PC is within the given range, the location
2062 description may be used to locate the specified object.
2064 There are several kinds of bounded location description
2065 entries which differ in the way that they specify the
2066 starting and ending addresses.
2068 The address ranges defined by the bounded location descriptions
2069 of a location list may overlap. When they do, they describe a
2070 situation in which an object exists simultaneously in more than
2071 one place. If all of the address ranges in a given location
2072 list do not collectively cover the entire range over which the
2073 object in question is defined, and there is no following default
2074 location description, it is assumed that the object is not
2075 available for the portion of the range that is not covered.
2077 \item \definition{Default location description}.\addtoindexx{default location description}
2078 This kind of entry provides a
2079 location description that specifies the location of
2080 an object that is valid when no bounded location description
2083 \item \definition{Base address}.\addtoindexx{base address!of location list}
2084 This kind of entry provides an address to be
2085 used as the base address for beginning and ending address
2086 offsets given in certain kinds of bounded location description.
2087 The applicable base address of a bounded location description
2088 entry is the address specified by the closest preceding base
2089 address entry in the same location list. If there is no
2090 preceding base address entry, then the applicable base address
2091 defaults to the base address of the compilation unit (see
2092 Section \refersec{chap:fullandpartialcompilationunitentries}).
2094 In the case of a compilation unit where all of the machine
2095 code is contained in a single contiguous section, no base
2096 address entry is needed.
2098 \item \definition{End-of-list}.\addtoindexx{end-of-list!of location list}
2099 This kind of entry marks the end of the location list.
2103 A location list consists of a sequence of zero or more bounded
2104 location description or base address entries, optionally followed
2105 by a default location entry, and terminated by an end-of-list
2108 Each location list entry begins with a single byte identifying
2109 the kind of that entry, followed by zero or more operands depending
2112 In the descriptions that follow, these terms are used for operands:
2115 \item A \definitionx{counted location description} operand consists
2116 of a two-byte unsigned integer giving the length of the location
2117 description (see Section \refersec{chap:singlelocationdescriptions})
2118 that immediately follows.
2120 \item An \definitionx{address index} operand is the index of an address
2121 in the \dotdebugaddr{} section. This index is relative to the
2122 value of the \DWATaddrbase{} attribute of the associated
2123 compilation unit. The address given by this kind
2124 of operand is *not* relative to the compilation unit base address.
2126 \item A \definition{target address} operand is an address on the target
2127 machine. (Its size is the same as used for attribute values of
2128 class \CLASSaddress, specifically, \DWFORMaddr.)
2132 The following entry kinds are defined for use in both
2133 split or non-split units:
2135 \begin{enumerate}[1. ]
2136 \itembfnl{\DWLLEendoflistTARG}
2137 An end-of-list entry contains no further data.
2139 \textit{A series of this kind of entry may be used for padding or
2140 alignment purposes.}
2142 \itembfnl{\DWLLEbaseaddressxTARG}
2143 This is a form of base address entry that has one unsigned
2144 LEB128 operand. The operand value is an address index that
2145 indicates the applicable base address used by \DWLLEoffsetpair{}
2148 \itembfnl{\DWLLEstartxendxTARG}
2149 This is a form of bounded location description entry that
2150 has two unsigned LEB128 operands. The operand values are
2151 address indices. These indicate the
2152 starting and ending addresses, respectively, that define
2153 the address range for which this location is valid.
2154 These operands are followed by a counted location description.
2156 \itembfnl{\DWLLEstartxlengthTARG}
2157 This is a form of bounded location description that has two
2158 unsigned ULEB operands. The first value is an address index
2159 that indicates the beginning of the address range over
2160 which the location is valid.
2161 The second value is the length of the range.
2162 These operands are followed by a counted location description.
2164 \itembfnl{\DWLLEoffsetpairTARG}
2165 This is a form of bounded location description entry that
2166 has two unsigned LEB128 operands. The values of these
2167 operands are the starting and ending offsets, respectively,
2168 relative to the applicable base address, that define the
2169 address range for which this location is valid.
2170 These operands are followed by a counted location description.
2172 \itembfnl{\DWLLEdefaultlocationTARG}
2173 This entry has no range operands that express a range of
2174 addresses. The only operand is a counted location description.
2178 The following kinds of location list entries are defined for
2179 use only in non-split DWARF units:
2181 \begin{enumerate}[1. ]
2182 \addtocounter{enumi}{6}
2183 \itembfnl{\DWLLEbaseaddressTARG}
2184 A base address entry has one target address operand.
2185 This address is used as the base address when interpreting
2186 offsets in subsequent location list entries of kind
2189 \itembfnl{\DWLLEstartendTARG}
2190 This is a form of bounded location description entry that
2191 has two target address operands. These indicate the
2192 starting and ending addresses, respectively, that define
2193 the address range for which the location is valid.
2194 These operands are followed by a counted location description.
2196 \itembfnl{\DWLLEstartlengthTARG}
2197 This is a form of bounded location description entry that
2198 has one target address operand value and an unsigned LEB128
2199 integer operand value. The address is the beginning address
2200 of the range over which the location description is valid, and
2201 the length is the number of bytes in that range.
2202 These operands are followed by a counted location description.
2208 \section{Types of Program Entities}
2209 \label{chap:typesofprogramentities}
2210 \hypertarget{chap:DWATtypetypeofdeclaration}{}
2211 Any debugging information entry describing a declaration that
2213 \addtoindexx{type attribute}
2214 a \DWATtypeDEFN{} attribute, whose value is a
2215 reference to another debugging information entry. The entry
2216 referenced may describe a base type, that is, a type that is
2217 not defined in terms of other data types, or it may describe a
2218 user-defined type, such as an array, structure or enumeration.
2219 Alternatively, the entry referenced may describe a type
2220 modifier, such as constant, packed, pointer, reference or
2221 volatile, which in turn will reference another entry describing
2222 a type or type modifier (using a
2223 \DWATtypeNAME{} attribute\addtoindexx{type attribute} of its
2224 own). See Chapter \referfol{chap:typeentries}
2225 for descriptions of the entries describing
2226 base types, user-defined types and type modifiers.
2230 \section{Accessibility of Declarations}
2231 \label{chap:accessibilityofdeclarations}
2232 \textit{Some languages, notably \addtoindex{C++} and
2233 \addtoindex{Ada}, have the concept of
2234 the accessibility of an object or of some other program
2235 entity. The accessibility specifies which classes of other
2236 program objects are permitted access to the object in question.}
2238 The accessibility of a declaration
2239 is\hypertarget{chap:DWATaccessibilityattribute}{}
2241 \DWATaccessibilityDEFN{}\addtoindexx{accessibility attribute}
2242 attribute, whose value is a constant drawn from the set of codes
2243 listed in Table \refersec{tab:accessibilitycodes}.
2245 \begin{simplenametable}[1.9in]{Accessibility codes}{tab:accessibilitycodes}
2246 \DWACCESSpublicTARG{} \\
2247 \DWACCESSprivateTARG{} \\
2248 \DWACCESSprotectedTARG{} \\
2249 \end{simplenametable}
2252 \section{Visibility of Declarations}
2253 \label{chap:visibilityofdeclarations}
2255 \textit{Several languages (such as \addtoindex{Modula-2})
2256 have the concept of the visibility of a declaration. The
2257 visibility specifies which declarations are to be
2258 visible outside of the entity in which they are
2261 The\hypertarget{chap:DWATvisibilityvisibilityofdeclaration}{}
2262 visibility of a declaration is represented
2263 by a \DWATvisibilityDEFN{}
2264 attribute\addtoindexx{visibility attribute}, whose value is a
2265 constant drawn from the set of codes listed in
2266 Table \refersec{tab:visibilitycodes}.
2268 \begin{simplenametable}[1.5in]{Visibility codes}{tab:visibilitycodes}
2269 \DWVISlocalTARG{} \\
2270 \DWVISexportedTARG{} \\
2271 \DWVISqualifiedTARG{} \\
2272 \end{simplenametable}
2275 \section{Virtuality of Declarations}
2276 \label{chap:virtualityofdeclarations}
2277 \textit{\addtoindex{C++} provides for virtual and pure virtual structure or class
2278 member functions and for virtual base classes.}
2280 The\hypertarget{chap:DWATvirtualityvirtualityindication}{}
2281 virtuality of a declaration is represented by a
2282 \DWATvirtualityDEFN{}
2283 attribute\addtoindexx{virtuality attribute}, whose value is a constant drawn
2284 from the set of codes listed in
2285 Table \refersec{tab:virtualitycodes}.
2287 \begin{simplenametable}[2.5in]{Virtuality codes}{tab:virtualitycodes}
2288 \DWVIRTUALITYnoneTARG{} \\
2289 \DWVIRTUALITYvirtualTARG{} \\
2290 \DWVIRTUALITYpurevirtualTARG{} \\
2291 \end{simplenametable}
2294 \section{Artificial Entries}
2295 \label{chap:artificialentries}
2296 \textit{A compiler may wish to generate debugging information entries
2297 for objects or types that were not actually declared in the
2298 source of the application. An example is a formal parameter
2299 entry to represent the hidden
2300 \texttt{this} parameter\index{this parameter@\texttt{this} parameter}
2301 that most \addtoindex{C++} implementations pass as the first argument
2302 to non-static member functions.}
2304 Any debugging information entry representing the
2305 \addtoindexx{artificial attribute}
2306 declaration of an object or type artificially generated by
2307 a compiler and not explicitly declared by the source
2308 program\hypertarget{chap:DWATartificialobjectsortypesthat}{}
2310 \DWATartificialDEFN{} attribute,
2311 which is a \livelink{chap:classflag}{flag}.
2314 \section{Segmented Addresses}
2315 \label{chap:segmentedaddresses}
2316 \textit{In some systems, addresses are specified as offsets within a
2318 \addtoindexx{address space!segmented}
2320 \addtoindexx{segmented addressing|see{address space}}
2321 rather than as locations within a single flat
2322 \addtoindexx{address space!flat}
2325 Any debugging information entry that contains a description
2326 of\hypertarget{chap:DWATsegmentaddressinginformation}{}
2327 the location of an object or subroutine may have a
2328 \DWATsegmentDEFN{} attribute,
2329 \addtoindexx{segment attribute}
2330 whose value is a location
2331 description. The description evaluates to the segment selector
2332 of the item being described. If the entry containing the
2333 \DWATsegmentNAME{} attribute has a
2337 \DWATentrypc{} attribute,
2338 \addtoindexx{entry PC attribute}
2341 description that evaluates to an address, then those address
2342 values represent the offset portion of the address within
2343 the segment specified
2344 \addtoindexx{segment attribute}
2345 by \DWATsegmentNAME.
2348 \DWATsegmentNAME{} attribute, it inherits
2349 \addtoindexx{segment attribute}
2350 the segment value from its parent entry. If none of the
2351 entries in the chain of parents for this entry back to
2352 its containing compilation unit entry have
2353 \DWATsegmentNAME{} attributes,
2354 then the entry is assumed to exist within a flat
2356 Similarly, if the entry has a
2357 \DWATsegmentNAME{} attribute
2358 \addtoindexx{segment attribute}
2359 containing an empty location description, that
2360 entry is assumed to exist within a
2361 \addtoindexi{flat}{address space!flat}
2364 \textit{Some systems support different
2365 classes of addresses\addtoindexx{address class}.
2366 The address class may affect the way a pointer is dereferenced
2367 or the way a subroutine is called.}
2370 Any debugging information entry representing a pointer or
2371 reference type or a subroutine or subroutine type may
2374 attribute, whose value is an integer
2375 constant. The set of permissible values is specific to
2376 each target architecture. The value \DWADDRnoneTARG,
2378 is common to all encodings, and means that no address class
2382 \textit {For example, the Intel386 \texttrademark\ processor might use the following values:}
2385 \caption{Example address class codes}
2386 \label{tab:inteladdressclasstable}
2388 \begin{tabular}{l|c|l}
2390 Name&Value&Meaning \\
2392 \textit{DW\_ADDR\_none}& 0 & \textit{no class specified} \\
2393 \textit{DW\_ADDR\_near16}& 1 & \textit{16-bit offset, no segment} \\
2394 \textit{DW\_ADDR\_far16}& 2 & \textit{16-bit offset, 16-bit segment} \\
2395 \textit{DW\_ADDR\_huge16}& 3 & \textit{16-bit offset, 16-bit segment} \\
2396 \textit{DW\_ADDR\_near32}& 4 & \textit{32-bit offset, no segment} \\
2397 \textit{DW\_ADDR\_far32}& 5 & \textit{32-bit offset, 16-bit segment} \\
2403 \section{Non-Defining Declarations and Completions}
2404 \label{chap:nondefiningdeclarationsandcompletions}
2405 A debugging information entry representing a program entity
2406 typically represents the defining declaration of that
2407 entity. In certain contexts, however, a debugger might need
2408 information about a declaration of an entity that is not
2409 \addtoindexx{incomplete declaration}
2410 also a definition, or is otherwise incomplete, to evaluate
2411 an\hypertarget{chap:DWATdeclarationincompletenondefiningorseparateentitydeclaration}{}
2412 expression correctly.
2415 \textit{As an example, consider the following fragment of \addtoindex{C} code:}
2429 \textit{\addtoindex{C} scoping rules require that the
2430 value of the variable \texttt{x} passed to the function
2431 \texttt{g} is the value of the global \texttt{float}
2432 variable \texttt{x} rather than of the local \texttt{int}
2433 variable \texttt{x}.}
2435 \subsection{Non-Defining Declarations}
2436 A debugging information entry that
2437 represents a non-defining
2438 \addtoindexx{non-defining declaration}
2440 \addtoindex{incomplete declaration}
2441 of a program entity has a
2442 \addtoindexx{declaration attribute}
2443 \DWATdeclarationDEFN{} attribute, which is a
2444 \livelink{chap:classflag}{flag}.
2446 \textit{A non-defining type declaration may nonetheless have
2447 children as illustrated in Section
2448 \refersec{app:declarationscompletingnondefiningdeclarations}.}
2451 \subsection{Declarations Completing Non-Defining Declarations}
2452 \hypertarget{chap:DWATspecificationincompletenondefiningorseparatedeclaration}{}
2453 A debugging information entry that represents a declaration
2454 that completes another (earlier) non-defining declaration may have a
2455 \DWATspecificationDEFN{}
2456 attribute whose value is a \livelink{chap:classreference}{reference} to
2457 the debugging information entry representing the non-defining declaration.
2458 A debugging information entry with a
2459 \DWATspecificationNAME{}
2460 attribute does not need to duplicate information provided by the
2461 debugging information entry referenced by that specification attribute.
2463 When the non-defining declaration is contained within a type that has
2464 been placed in a separate type unit (see Section \refersec{chap:typeunitentries}),
2465 the \DWATspecification{} attribute cannot refer directly to the entry in
2466 the type unit. Instead, the current compilation unit may contain a
2467 \doublequote{skeleton} declaration of the type, which contains only the relevant
2468 declaration and its ancestors as necessary to provide the context
2469 (including containing types and namespaces). The \DWATspecification{}
2470 attribute would then be a reference to the declaration entry within
2471 the skeleton declaration tree. The debugging information entry for the
2472 top-level type in the skeleton tree may contain a \DWATsignature{}
2473 attribute whose value is the type signature
2474 (see Section \refersec{datarep:typesignaturecomputation}).
2477 Not all attributes of the debugging information entry referenced by a
2478 \DWATspecification{} attribute
2479 apply to the referring debugging information entry.
2480 For\addtoindexx{declaration attribute}
2484 \addtoindexx{declaration attribute}
2486 \addtoindexx{declaration attribute}
2488 \addtoindexx{sibling attribute}
2492 \section{Declaration Coordinates}
2493 \label{chap:declarationcoordinates}
2494 \livetargi{chap:declarationcoordinates}{}{declaration coordinates}
2495 \textit{It is sometimes useful in a debugger to be able to associate
2496 a declaration with its occurrence in the program source.}
2498 Any debugging information entry representing
2499 the declaration of an object, module, subprogram or type may have
2500 \DWATdeclfileDEFN,\hypertarget{chap:DWATdeclfilefilecontainingsourcedeclaration}{}
2501 \addtoindexx{declaration file attribute}
2502 \DWATdecllineDEFN\hypertarget{chap:DWATdecllinelinenumberofsourcedeclaration}{}
2503 \addtoindexx{declaration line attribute} and
2504 \DWATdeclcolumnDEFN\hypertarget{chap:DWATdeclcolumncolumnpositionofsourcedeclaration}{}
2505 \addtoindexx{declaration column attribute}
2506 attributes, each of whose value is an unsigned
2507 \livelink{chap:classconstant}{integer constant}.
2510 \addtoindexx{declaration file attribute}
2514 \addtoindexx{file containing declaration}
2516 a file number from the line number information table for the
2517 compilation unit containing the debugging information entry and
2518 represents the source file in which the declaration appeared
2519 (see Section \refersec{chap:linenumberinformation}).
2520 The value 0 indicates that no source file
2524 \addtoindexx{declaration line attribute}
2525 the \DWATdeclline{} attribute represents
2526 the source line number at which the first character of
2527 the identifier of the declared object appears. The value 0
2528 indicates that no source line has been specified.
2531 \addtoindexx{declaration column attribute}
2532 the \DWATdeclcolumn{} attribute represents
2533 the source column number at which the first character of
2534 the identifier of the declared object appears. The value 0
2535 indicates that no column has been specified.
2537 \section{Identifier Names}
2538 \label{chap:identifiernames}
2539 Any\hypertarget{chap:DWATnamenameofdeclaration}{}
2540 debugging information entry
2541 \addtoindexx{identifier names}
2543 \addtoindexx{names!identifier}
2544 a program entity that has been given a name may have a
2546 attribute\addtoindexx{name attribute}, whose value of
2547 class \CLASSstring{} represents the name.
2548 A debugging information entry containing
2549 no name attribute, or containing a name attribute whose value
2550 consists of a name containing a single null byte, represents
2551 a program entity for which no name was given in the source.
2553 \textit{Because the names of program objects described by DWARF are
2554 the names as they appear in the source program, implementations
2555 of language translators that use some form of mangled name
2556 \addtoindexx{mangled names}
2557 (as do many implementations of \addtoindex{C++}) should use the
2558 unmangled form of the name in the
2559 \DWATname{} attribute,
2560 \addtoindexx{name attribute}
2561 including the keyword operator (in names such as \doublequote{operator +}),
2562 if present. See also
2563 Section \referfol{chap:linkagenames} regarding the use of
2564 \DWATlinkagename{} for
2565 \addtoindex{mangled names}.
2566 Sequences of multiple whitespace characters may be compressed.}
2568 \textit{For additional discussion, see the Best Practices section
2570 (\url{http://wiki.dwarfstd.org/index.php?title=Best_Practices}.)}
2572 \section{Data Locations and DWARF Procedures}
2573 \hypertarget{chap:DWATlocationdataobjectlocation}{}
2574 Any debugging information entry describing a data object (which
2575 includes variables and parameters) or
2576 \livelink{chap:commonblockentry}{common blocks}
2577 may have a \DWATlocationDEFN{} attribute,
2578 \addtoindexx{location attribute}
2579 whose value is a location description
2580 (see Section \refersec{chap:locationdescriptions}).
2583 A \addtoindex{DWARF procedure} is represented by any
2584 debugging information entry that has a
2585 \DWATlocationNAME{} attribute.\addtoindexx{location attribute}
2586 If a suitable entry is not otherwise available,
2587 a DWARF procedure can be represented using a debugging
2588 information entry \addtoindexx{DWARF procedure entry}
2589 with the tag \DWTAGdwarfprocedureTARG{} together with a
2590 \DWATlocationNAME{} attribute.\addtoindexx{location attribute}
2592 A DWARF procedure is called by a \DWOPcalltwo, \DWOPcallfour{}
2593 or \DWOPcallref{} DWARF expression operator
2594 (see Section \refersec{chap:controlflowoperations}).
2597 \section{Code Addresses, Ranges and Base Addresses}
2598 \label{chap:codeaddressesandranges}
2599 Any debugging information entry describing an entity that has
2600 a machine code address or range of machine code addresses,
2601 which includes compilation units, module initialization,
2602 subroutines, lexical \nolink{blocks},
2603 try/catch \nolink{blocks} (see Section \refersec{chap:tryandcatchblockentries}),
2604 labels and the like, may have
2606 \item \hypertarget{chap:DWATlowpccodeaddressorrangeofaddresses}{}
2607 A \DWATlowpcDEFN{} attribute for a single address,
2609 \item \hypertarget{chap:DWAThighpccontiguousrangeofcodeaddresses}{}
2610 A \DWATlowpcDEFN{}\addtoindexx{low PC attribute}
2611 and \DWAThighpcDEFN{}\addtoindexx{high PC attribute}
2612 pair of attributes for a single contiguous range of
2615 \item \hypertarget{chap:DWATrangesnoncontiguousrangeofcodeaddresses}{}
2616 A \DWATrangesDEFN{} attribute\addtoindexx{ranges attribute}
2617 for a non-contiguous range of addresses.
2620 If an entity has no associated machine code,
2621 none of these attributes are specified.
2624 The \definitionx{base address} of the scope for any of the
2625 debugging information entries listed above is given by either the
2626 \DWATlowpcNAME{}\livetargi{chap:DWATlowpcbaseaddressofscope}{}{base address of scope}
2627 attribute or the first address in the first range entry
2628 in the list of ranges given by the \DWATrangesNAME{} attribute.
2629 If there is no such attribute, the base address is undefined.
2631 \subsection{Single Address}
2632 \label{chap:singleaddress}
2633 When there is a single address associated with an entity,
2634 such as a label or alternate entry point of a subprogram,
2635 the entry has a \DWATlowpc{} attribute whose value is the
2636 address for the entity.
2639 \subsection{Contiguous Address Range}
2640 \label{chap:contiguousaddressranges}
2641 When the set of addresses of a debugging information entry can
2642 be described as a single contiguous range, the entry may
2643 \addtoindexx{high PC attribute}
2644 \addtoindexx{low PC attribute}
2645 have a \DWATlowpc{} and \DWAThighpc{} pair of attributes.
2646 The value of the \DWATlowpc{} attribute is the address of the
2647 first instruction associated with the entity. If the value of
2648 the \DWAThighpc{} is of class address, it is the
2649 address of the first location past the last instruction
2650 associated with the entity; if it is of class constant, the
2651 value is an unsigned integer offset which when added to the
2652 low PC gives the address of the first location past the last
2653 instruction associated with the entity.
2655 \textit{The high PC value
2656 may be beyond the last valid instruction in the executable.}
2658 \subsection{Non-Contiguous Address Ranges}
2659 \label{chap:noncontiguousaddressranges}
2661 Range lists are used when the set of addresses for a debugging
2662 information entry cannot be described as a single contiguous
2663 range.\addtoindexx{non-contiguous address ranges}
2664 Range lists are contained in a separate object file section
2665 called \dotdebugrnglists or \dotdebugrnglistsdwo (in split units).
2667 A range list is identified by a \DWATranges{}\addtoindexx{ranges attribute}
2668 or other attribute whose value is of class \bbeb\CLASSrnglist{}
2669 (see Section \refersec{datarep:classesandforms}).
2671 \textit{This range list representation, the \bbeb\CLASSrnglist{} class, and the
2672 related \DWATrnglistsbase{} attribute are new in \DWARFVersionV.
2673 Together they eliminate most or all of the object language relocations
2674 previously needed for range lists.}
2676 Each range list entry is one of the following kinds:
2678 \item \definition{Bounded range}.\addtoindexx{bounded range}
2679 This kind of entry defines an address range
2680 that is included in the range list. The starting address is
2681 the lowest address of the address range. The ending address
2682 is the address of the first location past the highest address
2683 of the address range.
2685 There are several kinds of bounded range entries which specify
2686 the starting and ending addresses in different ways.
2688 \item \definition{Base address}.\addtoindexx{base address!of range list}
2689 This kind of entry provides an address to be
2690 used as the base address for the beginning and ending
2691 address offsets given in certain bounded range entries. The
2692 applicable base address of a range list entry is
2693 determined by the closest preceding base address
2694 entry in the same range list. If there is no preceding
2695 base address entry, then the applicable base address
2696 defaults to the base address of the compilation unit (see
2697 Section \refersec{chap:fullandpartialcompilationunitentries}).
2699 In the case of a compilation unit where all of the machine
2700 code is contained in a single contiguous section, no base
2701 address entry is needed.
2703 \item \definition{End-of-list}.\addtoindexx{end-of-list!of range list}
2704 This kind of entry marks the end of the range list.
2708 Each range list consists of a sequence of zero or more bounded
2709 range or base address entries, terminated by an end-of-list entry.
2711 A range list containing only an end-of-list entry describes an
2712 empty scope (which contains no instructions).
2714 Bounded range entries in a range list may not overlap. There is
2715 no requirement that the entries be ordered in any particular way.
2717 A bounded range entry whose beginning and ending address offsets
2718 are equal (including zero) indicates an empty range and may be
2721 Each range list entry begins with a single byte identifying the kind
2722 of that entry, followed by zero or more operands depending on the
2725 In the descriptions that follow, the term \definitionx{address index}
2726 means the index of an address in the \dotdebugaddr{} section. This
2727 index is relative to the value of the \DWATaddrbase{} attribute
2728 of the associated compilation unit. The address given by this kind
2729 of operand is \emph{not} relative to the compilation unit base
2732 The following entry kinds are defined for use in both
2733 split or non-split units:
2734 \begin{enumerate}[1. ]
2735 \itembfnl{\DWRLEendoflistTARG}
2736 An end-of-list entry contains no further data.
2738 \textit{A series of this kind of entry may be used for padding or
2739 alignment purposes.}
2741 \itembfnl{\DWRLEbaseaddressxTARG}
2742 A base address entry has one unsigned LEB128 operand.
2743 The operand value is an address index that indicates
2744 the applicable base address used by following \DWRLEoffsetpair{}
2747 \itembfnl{\DWRLEstartxendxTARG}
2748 This is a form of bounded range entry that
2749 has two unsigned LEB128 operands. The operand values are
2750 address indices that indicate the
2751 starting and ending addresses, respectively, that define
2754 \itembfnl{\DWRLEstartxlengthTARG}
2755 This is a form of bounded location description that
2756 has two unsigned ULEB operands. The first value is an address index
2757 that indicates the beginning of the address range.
2758 The second value is the length of the range.
2760 \itembfnl{\DWRLEoffsetpairTARG}
2761 This is a form of bounded range entry that
2762 has two unsigned LEB128 operands. The values of these
2763 operands are the starting and ending offsets, respectively,
2764 relative to the applicable base address, that define the
2769 The following kinds of range entry may be used only in non-split
2772 \begin{enumerate}[1. ]
2773 \addtocounter{enumi}{5}
2774 \itembfnl{\DWRLEbaseaddressTARG}
2775 A base address entry has one target address operand.
2776 This operand is the same size as used in \DWFORMaddr.
2777 This address is used as the base address when interpreting
2778 offsets in subsequent location list entries of kind
2781 \itembfnl{\DWRLEstartendTARG}
2782 This is a form of bounded range entry that
2783 has two target address operands. Each
2784 operand is the same size as used in \DWFORMaddr.
2785 These indicate the starting and ending addresses,
2786 respectively, that define the address range for which
2787 the following location is valid.
2789 \itembfnl{\DWRLEstartlengthTARG}
2790 This is a form of bounded range entry that
2791 has one target address operand value and an unsigned LEB128
2792 integer length operand value. The address is the beginning address
2793 of the range over which the location description is valid, and
2794 the length is the number of bytes in that range.
2800 \section{Entry Address}
2801 \label{chap:entryaddress}
2802 \textit{The entry or first executable instruction generated
2803 for an entity, if applicable, is often the lowest addressed
2804 instruction of a contiguous range of instructions. In other
2805 cases, the entry address needs to be specified explicitly.}
2807 Any debugging information entry describing an entity that has
2808 a range of code addresses, which includes compilation units,
2809 module initialization, subroutines,
2810 \livelink{chap:lexicalblock}{lexical \nolink{blocks}},
2811 \livelink{chap:tryandcatchblockentries}{try/catch \nolink{blocks}},
2812 and the like, may have a \DWATentrypcDEFN{} attribute
2813 \addtoindexx{entry PC address} to indicate the
2814 \definitionx{entry address} which is the address of the
2815 instruction where execution
2819 within that range\hypertarget{chap:entryaddressofscope}{}
2821 If the value of the \DWATentrypcNAME{} attribute is of
2822 class \CLASSaddress{} that address is the entry address;
2823 or, if it is of class
2824 \CLASSconstant, the value is an unsigned integer offset which,
2825 when added to the base address of the function, gives the entry
2829 If no \DWATentrypcNAME{} attribute is present,
2830 then the entry address is assumed to be the same as the
2831 base address of the containing scope.
2834 \section{Static and Dynamic Values of Attributes}
2835 \label{chap:staticanddynamicvaluesofattributes}
2837 Some attributes that apply to types specify a property (such
2838 as the lower bound of an array) that is an integer value,
2839 where the value may be known during compilation or may be
2840 computed dynamically during execution.
2844 attributes is determined based on the class as follows:
2846 \item For a \livelink{chap:classconstant}{constant}, the value
2847 of the constant is the value of the attribute.
2849 \item For a \livelink{chap:classreference}{reference}, the
2850 value is a reference to another debugging information entry.
2853 \renewcommand{\itemsep}{0cm}
2854 \item describe a constant which is the attribute value,
2855 \item describe a variable which contains the attribute value, or
2856 \item contain a \DWATlocation{} attribute whose value is a
2857 DWARF expression which computes the attribute value
2858 (for example, a \DWTAGdwarfprocedure{} entry).
2861 \item For an \livelink{chap:classexprloc}{exprloc}, the value
2862 is interpreted as a DWARF expression; evaluation of the expression
2863 yields the value of the attribute.
2868 \section{Entity Descriptions}
2869 \textit{Some debugging information entries may describe entities
2870 in the program that are artificial, or which otherwise have a
2871 \doublequote{name} that is not a valid identifier in the
2872 programming language.
2873 This attribute provides a means for the producer to indicate
2874 the purpose or usage of the containing debugging infor}
2876 Generally, any debugging information entry that
2877 has,\hypertarget{chap:DWATdescriptionartificialnameordescription}{}
2878 or may have, a \DWATname{} attribute, may also have a
2879 \addtoindexx{description attribute}
2880 \DWATdescriptionDEFN{} attribute whose value is a
2881 null-terminated string providing a description of the entity.
2883 \textit{It is expected that a debugger will
2884 display these descriptions as part of
2885 displaying other properties of an entity.}
2888 \section{Byte and Bit Sizes}
2889 \label{chap:byteandbitsizes}
2890 % Some trouble here with hbox full, so we try optional word breaks.
2891 Many debugging information entries allow either a
2892 \DWATbytesizeNAME{} attribute or a
2893 \DWATbitsizeNAME{} attribute,
2894 whose \livelink{chap:classconstant}{integer constant} value
2895 (see Section \ref{chap:staticanddynamicvaluesofattributes})
2897 amount of storage. The value of the
2898 \DWATbytesizeDEFN{} attribute
2899 is interpreted in bytes and the value of the
2901 attribute is interpreted in bits. The
2902 \DWATstringlengthbytesize{} and
2903 \DWATstringlengthbitsize{}
2904 attributes are similar.
2906 In addition, the \livelink{chap:classconstant}{integer constant}
2907 value of a \DWATbytestride{} attribute is interpreted
2908 in bytes and the \livelink{chap:classconstant}{integer constant} value of a
2910 attribute is interpreted in bits.
2912 \section{Linkage Names}
2913 \label{chap:linkagenames}
2914 \textit{Some language implementations, notably
2915 \addtoindex{C++} and similar
2916 languages, make use of implementation-defined names within
2917 object files that are different from the \addtoindex{identifier names}
2918 (see Section \refersec{chap:identifiernames}) of entities as they
2919 appear in the source. Such names, sometimes known as
2920 \addtoindex{mangled names}\addtoindexx{names!mangled},
2921 are used in various ways, such as: to encode additional
2922 information about an entity, to distinguish multiple entities
2923 that have the same name, and so on. When an entity has an
2924 associated distinct linkage name it may sometimes be useful
2925 for a producer to include this name in the DWARF description
2926 of the program to facilitate consumer access to and use of
2927 object file information about an entity and/or information
2928 that is encoded in the linkage name itself.
2931 % Some trouble maybe with hbox full, so we try optional word breaks.
2932 A debugging information entry may have a
2933 \DWATlinkagenameDEFN{}\hypertarget{chap:DWATlinkagenameobjectfilelinkagenameofanentity}{}
2934 attribute\addtoindexx{linkage name attribute}
2935 whose value is a null-terminated string containing the
2936 object file linkage name associated with the corresponding entity.
2939 \section{Template Parameters}
2940 \label{chap:templateparameters}
2941 \textit{In \addtoindex{C++}, a template is a generic definition
2942 of a class, function, member function, or typedef (alias).
2943 A template has formal parameters that
2944 can be types or constant values; the class, function,
2945 member function, or typedef is instantiated differently for each
2946 distinct combination of type or value actual parameters. DWARF does
2947 not represent the generic template definition, but does represent each
2950 A debugging information entry that represents a
2951 \addtoindex{template instantiation}
2952 will contain child entries describing the actual template parameters.
2953 The containing entry and each of its child entries reference a template
2954 parameter entry in any circumstance where the template definition
2955 referenced a formal template parameter.
2957 A template type parameter is represented by a debugging information
2959 \addtoindexx{template type parameter entry}
2960 \DWTAGtemplatetypeparameterTARG.
2961 A template value parameter is represented by a debugging information
2963 \addtoindexx{template value parameter entry}
2964 \DWTAGtemplatevalueparameterTARG.
2965 The actual template parameter entries appear in the same order as the
2966 corresponding template formal parameter declarations in the
2970 A type or value parameter entry may have a \DWATname{} attribute,
2971 \addtoindexx{name attribute}
2973 null-terminated string containing the name of the corresponding
2974 formal parameter. The entry may also have a
2975 \DWATdefaultvalue{} attribute, which is a flag indicating
2976 that the value corresponds to the default argument for the
2979 A\addtoindexx{formal type parameter|see{template type parameter entry}}
2980 template type parameter entry has a
2981 \DWATtype{} attribute\addtoindexx{type attribute}
2982 describing the actual type by which the formal is replaced.
2984 A template value parameter entry has a \DWATtype{} attribute
2985 describing the type of the parameterized value.
2986 The entry also has an attribute giving the
2987 actual compile-time or run-time constant value
2988 of the value parameter for this instantiation.
2990 \DWATconstvalueDEFN{} attribute,
2991 \addtoindexx{constant value attribute}
2992 \livetarg{chap:DWATconstvaluetemplatevalueparameter}{}
2993 whose value is the compile-time constant value
2994 as represented on the target architecture, or a
2995 \DWATlocation{} attribute, whose value is a
2996 single location description for the run-time constant address.
2999 \label{chap:alignment}
3000 \livetarg{chap:DWATalignmentnondefault}{}
3001 A debugging information entry may have a
3002 \DWATalignmentDEFN{} attribute\addtoindexx{alignment attribute}
3003 whose value of class \CLASSconstant{} is
3004 a positive, non-zero, integer describing the
3005 alignment of the entity.
3007 \textit{For example, an alignment attribute whose value is 8 indicates
3008 that the entity to which it applies occurs at an address that is a
3009 multiple of eight (not a multiple of $2^8$ or 256).}