1 \chapter{General Description}
2 \label{chap:generaldescription}
3 \section{The Debugging Information Entry (DIE)}
4 \label{chap:thedebuggingentrydie}
6 \addtoindexx{debugging information entry}
8 \addtoindexx{DIE|see{debugging information entry}}
9 a series of debugging information entries (DIEs) to
11 representation of a source program.
12 Each debugging information entry consists of an identifying
13 \addtoindex{tag} and a series of
14 \addtoindex{attributes}.
15 An entry, or group of entries together, provide a description of a
17 \addtoindex{entity} in the source program.
18 The tag specifies the class to which an entry belongs
19 and the attributes define the specific characteristics of the entry.
22 \addtoindexx{tag names|see{debugging information entry}}
23 is listed in Table \refersec{tab:tagnames}.
24 The debugging information entries they identify are
25 described in Chapters 3, 4 and 5.
27 % These each need to link to definition page: FIXME
33 \autocols[0pt]{c}{2}{l}{
34 \DWTAGaccessdeclaration,
42 \DWTAGcommoninclusion,
50 \DWTAGenumerationtype,
53 \DWTAGformalparameter,
55 \DWTAGgenericsubrange,
56 \DWTAGimporteddeclaration,
60 \DWTAGinlinedsubroutine,
72 \DWTAGptrtomembertype,
75 \DWTAGrvaluereferencetype,
84 \DWTAGtemplatetypeparameter,
85 \DWTAGtemplatevalueparameter,
91 \DWTAGunspecifiedparameters,
92 \DWTAGunspecifiedtype,
103 \textit{The debugging information entry descriptions
104 in Sections 3, 4 and 5 generally include mention of
105 most, but not necessarily all, of the attributes
106 that are normally or possibly used with the entry.
107 Some attributes, whose applicability tends to be
108 pervasive and invariant across many kinds of
109 debugging information entries, are described in
110 this section and not necessarily mentioned in all
111 contexts where they may be appropriate.
114 the \livelink{chap:declarationcoordinates}{declaration coordinates}, and
118 The debugging information entries are contained in the
119 \dotdebuginfo{} sections of an object file.
122 Optionally, debugging information may be partitioned such
123 that the majority of the debugging information can remain in
124 individual object files without being processed by the
125 linker. These debugging information entries are contained in
126 the \dotdebuginfodwo{} sections. These
127 sections may be placed in the object file but marked so that
128 the linker ignores them, or they may be placed in a separate
129 DWARF object file that resides alongside the normal object
130 file. See Section \refersec{datarep:splitdwarfobjects} and
131 Appendix \refersec{app:splitdwarfobjectsinformative} for details.
134 \section{Attribute Types}
135 \label{chap:attributetypes}
136 Each attribute value is characterized by an attribute name.
137 \addtoindexx{attribute duplication}
138 No more than one attribute with a given name may appear in any
139 debugging information entry.
140 There are no limitations on the
141 \addtoindexx{attribute ordering}
142 ordering of attributes within a debugging information entry.
144 The attributes are listed in Table \refersec{tab:attributenames}.
146 The permissible values
147 \addtoindexx{attribute value classes}
148 for an attribute belong to one or more classes of attribute
150 Each form class may be represented in one or more ways.
151 For example, some attribute values consist
152 of a single piece of constant data.
153 \doublequote{Constant data}
154 is the class of attribute value that those attributes may have.
155 There are several representations of constant data,
156 however (one, two, ,four, or eight bytes, and variable length
158 The particular representation for any given instance
159 of an attribute is encoded along with the attribute name as
160 part of the information that guides the interpretation of a
161 debugging information entry.
163 Attribute value forms belong
164 \addtoindexx{tag names!list of}
165 to one of the classes shown in Table \refersec{tab:classesofattributevalue}.
167 \setlength{\extrarowheight}{0.1cm}
168 \addtoindexx{attributes!list of}
169 \begin{longtable}{l|p{9cm}}
170 \caption{Attribute names} \label{tab:attributenames} \\
171 \hline \bfseries Attribute&\bfseries Identifies or Specifies \\ \hline
173 \bfseries Attribute&\bfseries Identifies or Specifies \\ \hline
175 \hline \emph{Continued on next page}
179 \DWATabstractoriginTARG
180 &\livelinki{chap:DWATabstractorigininlineinstance}{Inline instances of inline subprograms} {inline instances of inline subprograms} \\
181 % Heren livelink we cannot use \dash or \dash{}.
182 &\livelinki{chap:DWATabstractoriginoutoflineinstance}{Out-of-line instances of inline subprograms}{out-of-line instances of inline subprograms} \\
183 \DWATaccessibilityTARG
184 &\livelink{chap:DWATaccessibilitycandadadeclarations}{C++ and Ada declarations} \addtoindexx{Ada} \\
185 &\livelink{chap:DWATaccessibilitycppbaseclasses}{C++ base classes} \\
186 &\livelink{chap:DWATaccessibilitycppinheritedmembers}{C++ inherited members} \\
187 \DWATaddressclassTARG
188 &\livelinki{chap:DWATadressclasspointerorreferencetypes}{Pointer or reference types}{pointer or reference types} \\
189 &\livelinki{chap:DWATaddressclasssubroutineorsubroutinetype}{Subroutine or subroutine type}{subroutine or subroutine type} \\
191 &\livelinki{chap:DWATaddrbaseforaddresstable}{Base offset for address table}{address table} \\
193 &\livelinki{chap:DWATallocatedallocationstatusoftypes}{Allocation status of types}{allocation status of types} \\
195 &\livelinki{chap:DWATartificialobjectsortypesthat}{Objects or types that are not actually declared in the source}{objects or types that are not actually declared in the source} \\
196 \DWATassociatedTARG{}
197 &\livelinki{chap:DWATassociatedassociationstatusoftypes}{Association status of types}{association status of types} \\
199 &\livelinki{chap:DWATbasetypesprimitivedatatypesofcompilationunit}{Primitive data types of compilation unit}{primitive data types of compilation unit} \\
200 \DWATbinaryscaleTARG{}
201 &\livelinki{chap:DWATbinaryscalebinaryscalefactorforfixedpointtype}{Binary scale factor for fixed-point type}{binary scale factor for fixed-point type} \\
203 &\livelinki{chap:DWATbitoffsetbasetypebitlocation}{Base type bit location}{base type bit location} \\
204 &\livelinki{chap:DWATbitoffsetdatamemberbitlocation}{Data member bit location}{data member bit location} \\
206 &\livelinki{chap:DWATbitsizebasetypebitsize}{Base type bit size}{base type bit size} \\
207 &\livelinki{chap:DWATbitsizedatamemberbitsize}{Data member bit size}{data member bit size} \\
209 &\livelinki{chap:DWATbitstridearrayelementstrideofarraytype}{Array element stride (of array type)}{array element stride (of array type)} \\
210 &\livelinki{chap:DWATbitstridesubrangestridedimensionofarraytype}{Subrange stride (dimension of array type)}{subrange stride (dimension of array type)} \\
211 &\livelinki{chap:DWATbitstrideenumerationstridedimensionofarraytype}{Enumeration stride (dimension of array type)}{enumeration stride (dimension of array type)} \\
213 &\livelinki{chap:DWATbytesizedataobjectordatatypesize}{Data object or data type size}{data object or data type size} \\
214 \DWATbytestrideTARG{}
215 &\livelinki{chap:DWATbytestridearrayelementstrideofarraytype}{Array element stride (of array type)}{array element stride (of array type)} \\
216 &\livelinki{chap:DWATbytestridesubrangestridedimensionofarraytype}{Subrange stride (dimension of array type)}{subrange stride (dimension of array type)} \\
217 &\livelinki{chap:DWATbytestrideenumerationstridedimensionofarraytype}{Enumeration stride (dimension of array type)}{enumeration stride (dimension of array type)} \\
218 \DWATcallcolumnTARG{}
219 &\livelinki{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}{Column position of inlined subroutine call}{column position of inlined subroutine call}\\
221 &\livelinki{chap:DWATcallfilefilecontaininginlinedsubroutinecall}{File containing inlined subroutine call}{file containing inlined subroutine call} \\
223 &\livelinki{chap:DWATcalllinelinenumberofinlinedsubroutinecall}{Line number of inlined subroutine call}{line number of inlined subroutine call} \\
224 \DWATcallingconventionTARG{}
225 &\livelinki{chap:DWATcallingconventionsubprogramcallingconvention}{Subprogram calling convention}{subprogram calling convention} \\
226 \DWATcommonreferenceTARG
227 &\livelinki{chap:commonreferencecommonblockusage}{Common block usage}{common block usage} \\
229 &\livelinki{chap:DWATcompdircompilationdirectory}{Compilation directory}{compilation directory} \\
231 &\livelinki{chap:DWATconstvalueconstantobject}{Constant object}{constant object} \\
232 &\livelinki{chap:DWATconstvalueenumerationliteralvalue}{Enumeration literal value}{enumeration literal value} \\
233 &\livelinki{chap:DWATconstvaluetemplatevalueparameter}{Template value parameter}{template value parameter} \\
235 &\livelinki{chap:DWATconstexprcompiletimeconstantobject}{Compile-time constant object}{compile-time constant object} \\
236 &\livelinki{chap:DWATconstexprcompiletimeconstantfunction}{Compile-time constant function}{compile-time constant function} \\
237 \DWATcontainingtypeTARG
238 &\livelinki{chap:DWATcontainingtypecontainingtypeofpointertomembertype}{Containing type of pointer to member type}{containing type of pointer to member type} \\
240 &\livelinki{chap:DWATcountelementsofsubrangetype}{Elements of subrange type}{elements ofbreg subrange type} \\
241 \DWATdatabitoffsetTARG
242 &\livelinki{chap:DWATdatabitoffsetbasetypebitlocation}{Base type bit location}{base type bit location} \\
243 &\livelinki{chap:DWATdatabitoffsetdatamemberbitlocation}{Data member bit location}{data member bit location} \\
244 \DWATdatalocationTARG{}
245 &\livelinki{chap:DWATdatalocationindirectiontoactualdata}{Indirection to actual data}{indirection to actual data} \\
246 \DWATdatamemberlocationTARG
247 &\livelinki{chap:DWATdatamemberlocationdatamemberlocation}{Data member location}{data member location} \\
248 &\livelinki{chap:DWATdatamemberlocationinheritedmemberlocation}{Inherited member location}{inherited member location} \\
249 \DWATdecimalscaleTARG
250 &\livelinki{chap:DWATdecimalscaledecimalscalefactor}{Decimal scale factor}{decimal scale factor} \\
252 &\livelinki{chap:DWATdecimalsigndecimalsignrepresentation}{Decimal sign representation}{decimal sign representation} \\
254 &\livelinki{chap:DWATdeclcolumncolumnpositionofsourcedeclaration}{Column position of source declaration}{column position of source declaration} \\
256 &\livelinki{chap:DWATdeclfilefilecontainingsourcedeclaration}{File containing source declaration}{file containing source declaration} \\
258 &\livelinki{chap:DWATdecllinelinenumberofsourcedeclaration}{Line number of source declaration}{line number of source declaration} \\
260 &\livelinki{chap:DWATdeclarationincompletenondefiningorseparateentitydeclaration}{Incomplete, non-defining, or separate entity declaration}{incomplete, non-defining, or separate entity declaration} \\
261 \DWATdefaultvalueTARG
262 &\livelinki{chap:DWATdefaultvaluedefaultvalueofparameter}{Default value of parameter}{default value of parameter} \\
263 \DWATdescriptionTARG{}
264 &\livelinki{chap:DWATdescriptionartificialnameordescription}{Artificial name or description}{artificial name or description} \\
266 &\livelinki{chap:DWATdigitcountdigitcountforpackeddecimalornumericstringtype}{Digit count for packed decimal or numeric string type}{digit count for packed decimal or numeric string type} \\
268 &\livelinki{chap:DWATdiscrdiscriminantofvariantpart}{Discriminant of variant part}{discriminant of variant part} \\
270 &\livelinki{chap:DWATdiscrlistlistofdiscriminantvalues}{List of discriminant values}{list of discriminant values} \\
272 &\livelinki{chap:DWATdiscrvaluediscriminantvalue}{Discriminant value}{discriminant value} \\
274 &\livelinki{chap:DWATdwoidforunit}{Signature for compilation unit}{split DWARF object file!unit signature} \\
276 &\livelinki{chap:DWATdwonameforunit}{Name of split DWARF object file}{split DWARF object file!object file name} \\
278 &\livelinki{chap:DWATelementalelementalpropertyofasubroutine}{Elemental property of a subroutine}{elemental property of a subroutine} \\
280 &\livelinki{chap:DWATencodingencodingofbasetype}{Encoding of base type}{encoding of base type} \\
282 &\livelinki{chap:DWATendianityendianityofdata}{Endianity of data}{endianity of data} \\
284 &\livelinki{chap:entryaddressofscope}{Entry address of a scope (compilation unit, \mbox{subprogram,} and so on)}{} \\
286 &\livelinki{chap:DWATenumclasstypesafeenumerationdefinition}{Type safe enumeration definition}{type safe enumeration definition}\\
288 &\livelinki{chap:DWATexplicitexplicitpropertyofmemberfunction}{Explicit property of member function}{explicit property of member function}\\
290 &\livelinki{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}{Previous namespace extension or original namespace}{previous namespace extension or original namespace}\\
292 &\livelinki{chap:DWATexternalexternalsubroutine}{External subroutine}{external subroutine} \\
293 &\livelinki{chap:DWATexternalexternalvariable}{External variable}{external variable} \\
295 &\livelinki{chap:DWATframebasesubroutineframebaseaddress}{Subroutine frame base address}{subroutine frame base address} \\
297 &\livelinki{chap:DWATfriendfriendrelationship}{Friend relationship}{friend relationship} \\
299 &\livelinki{chap:DWAThighpccontiguousrangeofcodeaddresses}{Contiguous range of code addresses}{contiguous range of code addresses} \\
300 \DWATidentifiercaseTARG
301 &\livelinki{chap:DWATidentifiercaseidentifiercaserule}{Identifier case rule}{identifier case rule} \\
303 &\livelinki{chap:DWATimportimporteddeclaration}{Imported declaration}{imported declaration} \\
304 &\livelinki{chap:DWATimportimportedunit}{Imported unit}{imported unit} \\
305 &\livelinki{chap:DWATimportnamespacealias}{Namespace alias}{namespace alias} \\
306 &\livelinki{chap:DWATimportnamespaceusingdeclaration}{Namespace using declaration}{namespace using declaration} \\
307 &\livelinki{chap:DWATimportnamespaceusingdirective}{Namespace using directive}{namespace using directive} \\
309 &\livelinki{chap:DWATinlineabstracttinstance}{Abstract instance}{abstract instance} \\
310 &\livelinki{chap:DWATinlineinlinedsubroutine}{Inlined subroutine}{inlined subroutine} \\
312 &\livelinki{chap:DWATisoptionaloptionalparameter}{Optional parameter}{optional parameter} \\
314 &\livelinki{chap:DWATlanguageprogramminglanguage}{Programming language}{programming language} \\
316 &\livelinki{chap:DWATlinkagenameobjectfilelinkagenameofanentity}{Object file linkage name of an entity}{object file linkage name of an entity}\\
318 &\livelinki{chap:DWATlocationdataobjectlocation}{Data object location}{data object location}\\
320 &\livelinki{chap:DWATlowpccodeaddressorrangeofaddresses}{Code address or range of addresses}{code address or range of addresses}\\
322 &\livelinki{chap:DWATlowerboundlowerboundofsubrange}{Lower bound of subrange}{lower bound of subrange} \\
324 &\livelinki{chap:DWATmacroinfomacroinformation}{Macro information (for pre-\DWARFVersionV{} compatibility)} {macro information (legacy)} \\
326 &\livelinki{chap:DWATmacrosmacroinformation}{Macro information} {macro information} (\texttt{\#define}, \texttt{\#undef}, and so on)\\
327 \DWATmainsubprogramTARG
328 &\livelinki{chap:DWATmainsubprogrammainorstartingsubprogram}{Main or starting subprogram}{main or starting subprogram} \\
329 &\livelinki{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}{Unit containing main or starting subprogram}{unit containing main or starting subprogram}\\
331 &\livelinki{chap:DWATmutablemutablepropertyofmemberdata}{Mutable property of member data}{mutable property of member data} \\
333 &\livelinki{chap:DWATnamenameofdeclaration}{Name of declaration}{name of declaration}\\
334 &\livelinki{chap:DWATnamepathnameofcompilationsource}{Path name of compilation source}{path name of compilation source} \\
335 \DWATnamelistitemTARG
336 &\livelinki{chap:DWATnamelistitemnamelistitem}{Namelist item}{namelist item}\\
337 \DWATobjectpointerTARG
338 &\livelinki{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}{Object (\texttt{this}, \texttt{self}) pointer of member function}{object (\texttt{this}, \texttt{self}) pointer of member function}\\
340 &\livelinki{chap:DWATorderingarrayrowcolumnordering}{Array row/column ordering} {array row/column ordering}\\
341 \DWATpicturestringTARG
342 &\livelinki{chap:DWATpicturestringpicturestringfornumericstringtype}{Picture string for numeric string type}{picture string for numeric string type} \\
344 &\livelinki{chap:DWATprioritymodulepriority}{Module priority}{module priority}\\
346 &\livelinki{chap:DWATproducercompileridentification}{Compiler identification}{compiler identification}\\
348 &\livelinki{chap:DWATprototypedsubroutineprototype}{Subroutine prototype}{subroutine prototype}\\
350 &\livelinki{chap:DWATpurepurepropertyofasubroutine}{Pure property of a subroutine}{pure property of a subroutine} \\
352 &\livelinki{chap:DWATrangesnoncontiguousrangeofcodeaddresses}{Non-contiguous range of code addresses}{non-contiguous range of code addresses} \\
354 &\livelinki{chap:DWATrangesbaseforrangelists}{Base offset for range lists}{Ranges lists} \\
356 &\livelinki{chap:DWATrankofdynamicarray}{Dynamic number of array dimensions}{dynamic number of array dimensions} \\
358 &\livelinki{chap:DWATrecursiverecursivepropertyofasubroutine}{Recursive property of a subroutine}{recursive property of a subroutine} \\
360 &\livelink{chap:DWATreferenceofnonstaticmember}{\&-qualified non-static member function} \\
362 &\livelinki{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}{Subroutine return address save location}{subroutine return address save location} \\
363 \DWATrvaluereferenceTARG
364 &\livelink{chap:DWATrvaluereferenceofnonstaticmember}{\&\&-qualified non-static member function} \\
367 &\livelinki{chap:DWATsegmentaddressinginformation}{Addressing information}{addressing information} \\
369 &\livelinki{chap:DWATsiblingdebugginginformationentryrelationship}{Debugging information entry relationship}{debugging information entry relationship} \\
371 &\livelinki{chap:DWATsmallscalefactorforfixedpointtype}{Scale factor for fixed-point type}{scale factor for fixed-point type} \\
373 &\livelinki{chap:DWATsignaturetypesignature}{Type signature}{type signature}\\
374 \DWATspecificationTARG
375 &\livelinki{chap:DWATspecificationincompletenondefiningorseparatedeclaration}{Incomplete, non-defining, or separate declaration corresponding to a declaration}{incomplete, non-defining, or separate declaration corresponding to a declaration} \\
377 &\livelinki{chap:DWATstartscopeobjectdeclaration}{Object declaration}{object declaration}\\
378 &\livelinki{chap:DWATstartscopetypedeclaration}{Type declaration}{type declaration}\\
380 &\livelinki{chap:DWATstaticlinklocationofuplevelframe}{Location of uplevel frame}{location of uplevel frame} \\
382 &\livelinki{chap:DWATstmtlistlinenumberinformationforunit}{Line number information for unit}{line number information for unit}\\
383 \DWATstringlengthTARG
384 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}{String length of string type}{string length of string type}
386 \DWATstringlengthbitsizeTARG
387 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}{Size of string length of string type}{string length of string type!size of}
389 \DWATstringlengthbytesizeTARG
390 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}{Size of string length of string type}{string length of string type!size of}
392 \DWATstroffsetsbaseTARG
393 &\livelinki{chap:DWATstroffsetbaseforindirectstringtable}{Base of string offsets table}{string offsets table} \\
394 \DWATthreadsscaledTARG
395 &\livelink{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}{UPC array bound THREADS scale factor}\\
397 &\livelinki{chap:DWATtrampolinetargetsubroutine}{Target subroutine}{target subroutine of trampoline} \\
399 &\livelinki{chap:DWATtypetypeofdeclaration}{Type of declaration}{type of declaration} \\
400 &\livelinki{chap:DWATtypetypeofsubroutinereturn}{Type of subroutine return}{type of subroutine return} \\
402 &\livelinki{chap:DWATupperboundupperboundofsubrange}{Upper bound of subrange}{upper bound of subrange} \\
404 &\livelinki{chap:DWATuselocationmemberlocationforpointertomembertype}{Member location for pointer to member type}{member location for pointer to member type} \\
405 \DWATuseUTFeightTARG\addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
406 &\livelinki{chap:DWATuseUTF8compilationunitusesutf8strings}{Compilation unit uses UTF-8 strings}{compilation unit uses UTF-8 strings} \\
407 \DWATvariableparameterTARG
408 &\livelinki{chap:DWATvariableparameternonconstantparameterflag}{Non-constant parameter flag}{non-constant parameter flag} \\
410 &\livelinki{chap:DWATvirtualityvirtualityindication}{Virtuality indication}{virtuality indication} \\
411 &\livelinki{chap:DWATvirtualityvirtualityofbaseclass}{Virtuality of base class} {virtuality of base class} \\
412 &\livelinki{chap:DWATvirtualityvirtualityoffunction}{Virtuality of function}{virtuality of function} \\
414 &\livelinki{chap:DWATvisibilityvisibilityofdeclaration}{Visibility of declaration}{visibility of declaration} \\
415 \DWATvtableelemlocationTARG
416 &\livelinki{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}{Virtual function vtable slot}{virtual function vtable slot}\\
419 \addtoindexx{address|see {\textit{also} address class}}
420 \addtoindexx{addrptr|see {\textit{also} addrptr class}}
421 \addtoindexx{block|see {\textit{also} block class}}
422 \addtoindexx{constant|see {\textit{also} constant class}}
423 \addtoindexx{exprloc|see {\textit{also} exprloc class}}
424 \addtoindexx{flag|see {\textit{also} flag class}}
425 \addtoindexx{lineptr|see {\textit{also} lineptr class}}
426 \addtoindexx{loclistptr|see {\textit{also} loclistptr class}}
427 \addtoindexx{macptr|see {\textit{also} macptr class}}
428 \addtoindexx{rangelistptr|see {\textit{also} rangelistptr class}}
429 \addtoindexx{reference|see {\textit{also} reference class}}
430 \addtoindexx{string|see {\textit{also} string class}}
431 \addtoindexx{stroffsetsptr|see {\textit{also} stroffsetsptr class}}
433 \addtoindexx{class of attribute value!address|see {address class}}
434 \addtoindexx{class of attribute value!addrptr|see {addrptr class}}
435 \addtoindexx{class of attribute value!block|see {block class}}
436 \addtoindexx{class of attribute value!constant|see {constant class}}
437 \addtoindexx{class of attribute value!exprloc|see {exprloc class}}
438 \addtoindexx{class of attribute value!flag|see {flag class}}
439 \addtoindexx{class of attribute value!lineptr|see {lineptr class}}
440 \addtoindexx{class of attribute value!loclistptr|see {loclistptr class}}
441 \addtoindexx{class of attribute value!macptr|see {macptr class}}
442 \addtoindexx{class of attribute value!rangelistptr|see {rangelistptr class}}
443 \addtoindexx{class of attribute value!reference|see {reference class}}
444 \addtoindexx{class of attribute value!string|see {string class}}
445 \addtoindexx{class of attribute value!stroffsetsptr|see {stroffsetsptr class}}
448 \begin{longtable}{l|p{11cm}}
449 \caption{Classes of attribute value}
450 \label{tab:classesofattributevalue} \\
451 \hline \bfseries Attribute Class & \bfseries General Use and Encoding \\ \hline
453 \bfseries Attribute Class & \bfseries General Use and Encoding \\ \hline
455 \hline \emph{Continued on next page}
460 \hypertarget{chap:classaddress}{}
461 \livelinki{datarep:classaddress}{address}{address class}
462 &Refers to some location in the address space of the described program.
465 \hypertarget{chap:classaddrptr}{}
466 \livelinki{datarep:classaddrptr}{addrptr}{addrptr class}
467 &Refers to a base location in the DWARF section that holds
468 a series of machine address values. Certain attributes refer
469 one of these addresses by indexing relative to this base
473 \hypertarget{chap:classblock}{}
474 \livelinki{datarep:classblock}{block}{block class}
475 & An arbitrary number of uninterpreted bytes of data.
478 \hypertarget{chap:classconstant}{}
479 \livelinki{datarep:classconstant}{constant}{constant class}
480 &One, two, four or eight bytes of uninterpreted data, or data
481 encoded in the variable length format known as LEB128
482 (see Section \refersec{datarep:variablelengthdata}).
484 \textit{Most constant values are integers of one kind or
485 another (codes, offsets, counts, and so on); these are
486 sometimes called \doublequote{integer constants} for emphasis.}
487 \addtoindexx{integer constant}
488 \addtoindexx{constant class!integer}
491 \hypertarget{chap:classexprloc}{}
492 \livelinki{datarep:classexprloc}{exprloc}{exprloc class}
493 &A DWARF expression or location description.
496 \hypertarget{chap:classflag}{}
497 \livelinki{datarep:classflag}{flag}{flag class}
498 &A small constant that indicates the presence or absence of an attribute.
501 \hypertarget{chap:classlineptr}{}
502 \livelinki{datarep:classlineptr}{lineptr}{lineptr class}
503 &Refers to a location in the DWARF section that holds line number information.
506 \hypertarget{chap:classloclistptr}{}
507 \livelinki{datarep:classloclistptr}{loclistptr}{loclistptr class}
508 &Refers to a location in the DWARF section that holds location lists, which
509 describe objects whose location can change during their lifetime.
512 \hypertarget{chap:classmacptr}{}
513 \livelinki{datarep:classmacptr}{macptr}{macptr class}
514 & Refers to a location in the DWARF section that holds macro definition
518 \hypertarget{chap:classrangelistptr}{}
519 \livelinki{datarep:classrangelistptr}{rangelistptr}{rangelistptr class}
520 & Refers to a location in the DWARF section that holds non\dash contiguous address ranges.
523 \hypertarget{chap:classreference}{}
524 \livelinki{datarep:classreference}{reference}{reference class}
525 & Refers to one of the debugging information
526 entries that describe the program. There are three types of
527 reference. The first is an offset relative to the beginning
528 of the compilation unit in which the reference occurs and must
529 refer to an entry within that same compilation unit. The second
530 type of reference is the offset of a debugging information
531 entry in any compilation unit, including one different from
532 the unit containing the reference. The third type of reference
533 is an indirect reference to a
534 \addtoindexx{type signature}
535 type definition using a 64\dash bit signature
539 \hypertarget{chap:classstring}{}
540 \livelinki{datarep:classstring}{string}{string class}
541 & A null\dash terminated sequence of zero or more
542 (non\dash null) bytes. Data in this class are generally
543 printable strings. Strings may be represented directly in
544 the debugging information entry or as an offset in a separate
548 \hypertarget{chap:classstroffsetsptr}{}
549 \livelinki{datarep:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class}
550 &Refers to a base location in the DWARF section that holds
551 a series of offsets in the DWARF section that holds strings.
552 Certain attributes refer one of these offets by indexing
553 relative to this base location. The resulting offset is then
554 used to index into the DWARF string section.
561 \section{Relationship of Debugging Information Entries}
562 \label{chap:relationshipofdebugginginformationentries}
564 A variety of needs can be met by permitting a single
565 \addtoindexx{debugging information entry!ownership relation}
566 debugging information entry to \doublequote{own} an arbitrary number
567 of other debugging entries and by permitting the same debugging
568 information entry to be one of many owned by another debugging
570 This makes it possible, for example, to
571 describe the static \livelink{chap:lexicalblock}{block} structure
572 within a source file,
573 to show the members of a structure, union, or class, and to
574 associate declarations with source files or source files
579 The ownership relation
580 \addtoindexx{debugging information entry!ownership relation}
582 information entries is achieved naturally because the debugging
583 information is represented as a tree.
584 The nodes of the tree
585 are the debugging information entries themselves.
587 entries of any node are exactly those debugging information
588 entries owned by that node.
591 While the ownership relation
592 of the debugging information entries is represented as a
593 tree, other relations among the entries exist, for example,
594 a reference from an entry representing a variable to another
595 entry representing the type of that variable.
597 relations are taken into account, the debugging entries
598 form a graph, not a tree.
602 The tree itself is represented
603 by flattening it in prefix order.
604 Each debugging information
605 entry is defined either to have child entries or not to have
606 child entries (see Section \refersec{datarep:abbreviationstables}).
607 If an entry is defined not
608 to have children, the next physically succeeding entry is a
610 If an entry is defined to have children, the next
611 physically succeeding entry is its first child.
613 children are represented as siblings of the first child.
614 A chain of sibling entries is terminated by a null entry.
616 In cases where a producer of debugging information feels that
617 \hypertarget{chap:DWATsiblingdebugginginformationentryrelationship}{}
618 it will be important for consumers of that information to
619 quickly scan chains of sibling entries, while ignoring the
620 children of individual siblings, that producer may attach
621 \addtoindexx{sibling attribute}
623 \DWATsibling{} attribute
624 to any debugging information entry.
626 value of this attribute is a reference to the sibling entry
627 of the entry to which the attribute is attached.
630 \section{Target Addresses}
631 \label{chap:targetaddresses}
632 Many places in this document
634 \addtoindexx{address size|see{size of an address}}
637 \addtoindexi{address}{size of an address}
638 on the target architecture (or equivalently, target machine)
639 to which a DWARF description applies. For processors which
640 can be configured to have different address sizes or different
641 instruction sets, the intent is to refer to the configuration
642 which is either the default for that processor or which is
643 specified by the object file or executable file which contains
644 the DWARF information.
647 For example, if a particular target architecture supports
648 both 32\dash bit and 64\dash bit addresses, the compiler will generate
649 an object file which specifies that it contains executable
650 code generated for one or the other of these
651 \addtoindexx{size of an address}
653 that case, the DWARF debugging information contained in this
654 object file will use the same address size.
658 Architectures which have multiple instruction sets are
659 supported by the isa entry in the line number information
660 (see Section \refersec{chap:statemachineregisters}).
663 \section{DWARF Expressions}
664 \label{chap:dwarfexpressions}
665 DWARF expressions describe how to compute a value or name a
666 location during debugging of a program.
667 They are expressed in
668 terms of DWARF operations that operate on a stack of values.
670 All DWARF operations are encoded as a stream of opcodes that
671 are each followed by zero or more literal operands.
673 of operands is determined by the opcode.
676 general operations that are defined here, operations that are
677 specific to location descriptions are defined in
678 Section \refersec{chap:locationdescriptions}.
680 \subsection{General Operations}
681 \label{chap:generaloperations}
682 Each general operation represents a postfix operation on
683 a simple stack machine. Each element of the stack is the
684 \addtoindex{size of an address} on the target machine.
686 top of the stack after \doublequote{executing} the
687 \addtoindex{DWARF expression}
689 \addtoindexx{DWARF expression|see{location description}}
690 taken to be the result (the address of the object, the
691 value of the array bound, the length of a dynamic string,
692 the desired value itself, and so on).
694 \subsubsection{Literal Encodings}
695 \label{chap:literalencodings}
697 \addtoindexx{DWARF expression!literal encodings}
698 following operations all push a value onto the DWARF
700 \addtoindexx{DWARF expression!stack operations}
701 If the value of a constant in one of these operations
702 is larger than can be stored in a single stack element, the
703 value is truncated to the element size and the low\dash order bits
704 are pushed on the stack.
705 \begin{enumerate}[1. ]
706 \itembfnl{\DWOPlitzeroTARG, \DWOPlitoneTARG, \dots, \DWOPlitthirtyoneTARG}
707 The \DWOPlitnTARG{} operations encode the unsigned literal values
708 from 0 through 31, inclusive.
710 \itembfnl{\DWOPaddrTARG}
711 The \DWOPaddrNAME{} operation has a single operand that encodes
712 a machine address and whose size is the \addtoindex{size of an address}
713 on the target machine.
715 \itembfnl{\DWOPconstoneuTARG, \DWOPconsttwouTARG, \DWOPconstfouruTARG, \DWOPconsteightuTARG}
717 The single operand of a \DWOPconstnuNAME{} operation provides a 1,
718 2, 4, or 8\dash byte unsigned integer constant, respectively.
720 \itembfnl{\DWOPconstonesTARG, \DWOPconsttwosTARG, \DWOPconstfoursTARG, \DWOPconsteightsTARG}
721 The single operand of a \DWOPconstnsNAME{} operation provides a 1,
722 2, 4, or 8\dash byte signed integer constant, respectively.
724 \itembfnl{\DWOPconstuTARG}
725 The single operand of the \DWOPconstuNAME{} operation provides
726 an unsigned LEB128 integer constant.
728 \itembfnl{\DWOPconstsTARG}
729 The single operand of the \DWOPconstsNAME{} operation provides
730 a signed LEB128 integer constant.
733 \itembfnl{\DWOPaddrxTARG}
734 The \DWOPaddrxNAME{} operation has a single operand that
735 encodes an unsigned LEB128 value, which is a zero-based
736 index into the \dotdebugaddr{} section, where a machine
738 This index is relative to the value of the
739 \DWATaddrbase{} attribute of the associated compilation unit.
741 \itembfnl{\DWOPconstxTARG}
742 The \DWOPconstxNAME{} operation has a single operand that
743 encodes an unsigned LEB128 value, which is a zero-based
744 index into the \dotdebugaddr{} section, where a constant, the
745 size of a machine address, is stored.
746 This index is relative to the value of the
747 \DWATaddrbase{} attribute of the associated compilation unit.
749 \textit{The \DWOPconstxNAME{} operation is provided for constants that
750 require link-time relocation but should not be
751 interpreted by the consumer as a relocatable address
752 (for example, offsets to thread-local storage).}
757 \subsubsection{Register Based Addressing}
758 \label{chap:registerbasedaddressing}
759 The following operations push a value onto the stack that is
760 \addtoindexx{DWARF expression!register based addressing}
761 the result of adding the contents of a register to a given
763 \begin{enumerate}[1. ]
764 \itembfnl{\DWOPfbregTARG}
765 The \DWOPfbregTARG{} operation provides a signed LEB128 offset
766 from the address specified by the location description in the
767 \DWATframebase{} attribute of the current function. (This
768 is typically a \doublequote{stack pointer} register plus or minus
769 some offset. On more sophisticated systems it might be a
770 location list that adjusts the offset according to changes
771 in the stack pointer as the PC changes.)
773 \itembfnl{\DWOPbregzeroTARG, \DWOPbregoneTARG, \dots, \DWOPbregthirtyoneTARG}
774 The single operand of the \DWOPbregnTARG{}
776 a signed LEB128 offset from
777 the specified register.
779 \itembfnl{\DWOPbregxTARG{} }
780 The \DWOPbregxINDX{} operation has two operands: a register
781 which is specified by an unsigned LEB128 number, followed by
782 a signed LEB128 offset.
787 \subsubsection{Stack Operations}
788 \label{chap:stackoperations}
790 \addtoindexx{DWARF expression!stack operations}
791 operations manipulate the DWARF stack. Operations
792 that index the stack assume that the top of the stack (most
793 recently added entry) has index 0.
794 \begin{enumerate}[1. ]
795 \itembfnl{\DWOPdupTARG}
796 The \DWOPdupTARG{} operation duplicates the value at the top of the stack.
798 \itembfnl{\DWOPdropTARG}
799 The \DWOPdropTARG{} operation pops the value at the top of the stack.
801 \itembfnl{\DWOPpickTARG}
802 The single operand of the \DWOPpickTARG{} operation provides a
803 1\dash byte index. A copy of the stack entry with the specified
804 index (0 through 255, inclusive) is pushed onto the stack.
806 \itembfnl{\DWOPoverTARG}
807 The \DWOPoverTARG{} operation duplicates the entry currently second
808 in the stack at the top of the stack.
809 This is equivalent to
810 a \DWOPpick{} operation, with index 1.
812 \itembfnl{\DWOPswapTARG}
813 The \DWOPswapTARG{} operation swaps the top two stack entries.
814 The entry at the top of the
815 stack becomes the second stack entry,
816 and the second entry becomes the top of the stack.
818 \itembfnl{\DWOProtTARG}
819 The \DWOProtTARG{} operation rotates the first three stack
820 entries. The entry at the top of the stack becomes the third
821 stack entry, the second entry becomes the top of the stack,
822 and the third entry becomes the second entry.
824 \itembfnl{\DWOPderefTARG}
826 operation pops the top stack entry and
827 treats it as an address. The value
828 retrieved from that address is pushed.
829 The size of the data retrieved from the
830 \addtoindexi{dereferenced}{address!dereference operator}
831 address is the \addtoindex{size of an address} on the target machine.
834 \itembfnl{\DWOPderefsizeTARG}
835 The \DWOPderefsizeTARG{} operation behaves like the
837 operation: it pops the top stack entry and treats it as an
838 address. The value retrieved from that address is pushed. In
839 the \DWOPderefsizeINDX{} operation, however, the size in bytes
840 of the data retrieved from the dereferenced address is
841 specified by the single operand. This operand is a 1\dash byte
842 unsigned integral constant whose value may not be larger
843 than the \addtoindex{size of an address} on the target machine. The data
844 retrieved is zero extended to the size of an address on the
845 target machine before being pushed onto the expression stack.
848 \itembfnl{\DWOPxderefTARG}
849 The \DWOPxderefTARG{} operation provides an extended dereference
850 mechanism. The entry at the top of the stack is treated as an
851 address. The second stack entry is treated as an \doublequote{address
852 space identifier} for those architectures that support
853 \addtoindexi{multiple}{address space!multiple}
854 address spaces. The top two stack elements are popped,
855 and a data item is retrieved through an implementation-defined
856 address calculation and pushed as the new stack top. The size
857 of the data retrieved from the
858 \addtoindexi{dereferenced}{address!dereference operator}
860 \addtoindex{size of an address} on the target machine.
862 \itembfnl{\DWOPxderefsizeTARG}
863 The \DWOPxderefsizeTARG{} operation behaves like the
864 \DWOPxderef{} operation. The entry at the top of the stack is
865 treated as an address. The second stack entry is treated as
866 an \doublequote{address space identifier} for those architectures
868 \addtoindexi{multiple}{address space!multiple}
869 address spaces. The top two stack
870 elements are popped, and a data item is retrieved through an
871 implementation\dash defined address calculation and pushed as the
872 new stack top. In the \DWOPxderefsizeINDX{} operation, however,
873 the size in bytes of the data retrieved from the
874 \addtoindexi{dereferenced}{address!dereference operator}
875 address is specified by the single operand. This operand is a
876 1\dash byte unsigned integral constant whose value may not be larger
877 than the \addtoindex{size of an address} on the target machine. The data
878 retrieved is zero extended to the \addtoindex{size of an address} on the
879 target machine before being pushed onto the expression stack.
881 \itembfnl{\DWOPpushobjectaddressTARG}
882 The \DWOPpushobjectaddressTARG{}
883 operation pushes the address
884 of the object currently being evaluated as part of evaluation
885 of a user presented expression. This object may correspond
886 to an independent variable described by its own debugging
887 information entry or it may be a component of an array,
888 structure, or class whose address has been dynamically
889 determined by an earlier step during user expression
892 \textit{This operator provides explicit functionality
893 (especially for arrays involving descriptors) that is analogous
894 to the implicit push of the base
895 \addtoindexi{address}{address!implicit push of base}
896 of a structure prior to evaluation of a
897 \DWATdatamemberlocation{}
898 to access a data member of a structure. For an example, see
899 Appendix \refersec{app:aggregateexamples}.}
902 \itembfnl{\DWOPformtlsaddressTARG}
903 The \DWOPformtlsaddressTARG{}
904 operation pops a value from the stack, translates this
905 value into an address in the
906 \addtoindexx{thread-local storage}
907 thread\dash local storage for a thread, and pushes the address
909 The meaning of the value on the top of the stack prior to this
910 operation is defined by the run-time environment. If the run-time
911 environment supports multiple thread\dash local storage
912 \nolink{blocks} for a single thread, then the \nolink{block}
913 corresponding to the executable or shared
914 library containing this DWARF expression is used.
916 \textit{Some implementations of
917 \addtoindex{C} and \addtoindex{C++} support a
918 thread\dash local storage class. Variables with this storage class
919 have distinct values and addresses in distinct threads, much
920 as automatic variables have distinct values and addresses in
921 each function invocation. Typically, there is a single \nolink{block}
922 of storage containing all thread\dash local variables declared in
923 the main executable, and a separate \nolink{block} for the variables
924 declared in each shared library.
925 Each thread\dash local variable can then be accessed in its block using an
926 identifier. This identifier is typically an offset into the block and pushed
927 onto the DWARF stack by one of the
928 \DWOPconstnx{} operations prior to the
929 \DWOPformtlsaddress{} operation.
930 Computing the address of
931 the appropriate \nolink{block} can be complex (in some cases, the
932 compiler emits a function call to do it), and difficult
933 to describe using ordinary DWARF location descriptions.
934 Instead of forcing complex thread-local storage calculations into
935 the DWARF expressions, the \DWOPformtlsaddress{} allows the consumer
936 to perform the computation based on the run-time environment.}
938 \itembfnl{\DWOPcallframecfaTARG}
939 The \DWOPcallframecfaTARG{}
940 operation pushes the value of the
941 CFA, obtained from the Call Frame Information
942 (see Section \refersec{chap:callframeinformation}).
944 \textit{Although the value of \DWATframebase{}
945 can be computed using other DWARF expression operators,
946 in some cases this would require an extensive location list
947 because the values of the registers used in computing the
948 CFA change during a subroutine. If the
949 Call Frame Information
950 is present, then it already encodes such changes, and it is
951 space efficient to reference that.}
954 \subsubsection{Arithmetic and Logical Operations}
956 \addtoindexx{DWARF expression!arithmetic operations}
958 \addtoindexx{DWARF expression!logical operations}
959 provide arithmetic and logical operations. Except
960 as otherwise specified, the arithmetic operations perform
961 addressing arithmetic, that is, unsigned arithmetic that is
962 performed modulo one plus the largest representable address
963 (for example, 0x100000000 when the
964 \addtoindex{size of an address} is 32 bits).
965 Such operations do not cause an exception on overflow.
968 \begin{enumerate}[1. ]
969 \itembfnl{\DWOPabsTARG}
970 The \DWOPabsTARG{} operation pops the top stack entry, interprets
971 it as a signed value and pushes its absolute value. If the
972 absolute value cannot be represented, the result is undefined.
975 \itembfnl{\DWOPandTARG}
976 The \DWOPandTARG{} operation pops the top two stack values, performs
977 a bitwise and operation on the two, and pushes the result.
979 \itembfnl{\DWOPdivTARG}
980 The \DWOPdivTARG{} operation pops the top two stack values, divides the former second entry by
981 the former top of the stack using signed division, and pushes the result.
983 \itembfnl{\DWOPminusTARG}
984 The \DWOPminusTARG{} operation pops the top two stack values, subtracts the former top of the
985 stack from the former second entry, and pushes the result.
987 \itembfnl{\DWOPmodTARG}
988 The \DWOPmodTARG{} operation pops the top two stack values and pushes the result of the
989 calculation: former second stack entry modulo the former top of the stack.
991 \itembfnl{\DWOPmulTARG}
992 The \DWOPmulTARG{} operation pops the top two stack entries, multiplies them together, and
995 \itembfnl{\DWOPnegTARG}
996 The \DWOPnegTARG{} operation pops the top stack entry, interprets
997 it as a signed value and pushes its negation. If the negation
998 cannot be represented, the result is undefined.
1000 \itembfnl{\DWOPnotTARG}
1001 The \DWOPnotTARG{} operation pops the top stack entry, and pushes
1002 its bitwise complement.
1004 \itembfnl{\DWOPorTARG}
1005 The \DWOPorTARG{} operation pops the top two stack entries, performs
1006 a bitwise or operation on the two, and pushes the result.
1008 \itembfnl{\DWOPplusTARG}
1009 The \DWOPplusTARG{} operation pops the top two stack entries,
1010 adds them together, and pushes the result.
1013 \itembfnl{\DWOPplusuconstTARG}
1014 The \DWOPplusuconstTARG{} operation pops the top stack entry,
1015 adds it to the unsigned LEB128 constant operand and pushes
1018 \textit{This operation is supplied specifically to be
1019 able to encode more field offsets in two bytes than can be
1021 \doublequote{\DWOPlitn~\DWOPplus.}}
1024 \itembfnl{\DWOPshlTARG}
1025 The \DWOPshlTARG{} operation pops the top two stack entries,
1026 shifts the former second entry left (filling with zero bits)
1027 by the number of bits specified by the former top of the stack,
1028 and pushes the result.
1030 \itembfnl{\DWOPshrTARG}
1031 The \DWOPshrTARG{} operation pops the top two stack entries,
1032 shifts the former second entry right logically (filling with
1033 zero bits) by the number of bits specified by the former top
1034 of the stack, and pushes the result.
1037 \itembfnl{\DWOPshraTARG}
1038 The \DWOPshraTARG{} operation pops the top two stack entries,
1039 shifts the former second entry right arithmetically (divide
1040 the magnitude by 2, keep the same sign for the result) by
1041 the number of bits specified by the former top of the stack,
1042 and pushes the result.
1044 \itembfnl{\DWOPxorTARG}
1045 The \DWOPxorTARG{} operation pops the top two stack entries,
1046 performs a bitwise exclusive\dash or operation on the two, and
1051 \subsubsection{Control Flow Operations}
1052 \label{chap:controlflowoperations}
1054 \addtoindexx{DWARF expression!control flow operations}
1055 following operations provide simple control of the flow of a DWARF expression.
1056 \begin{enumerate}[1. ]
1057 \itembfnl{\DWOPleTARG, \DWOPgeTARG, \DWOPeqTARG, \DWOPltTARG, \DWOPgtTARG, \DWOPneTARG}
1058 The six relational operators each:
1060 \item pop the top two stack values,
1062 \item compare the operands:
1064 \textless~former second entry~\textgreater \textless~relational operator~\textgreater \textless~former top entry~\textgreater
1066 \item push the constant value 1 onto the stack
1067 if the result of the operation is true or the
1068 constant value 0 if the result of the operation is false.
1071 Comparisons are performed as signed operations. The six
1072 operators are \DWOPleINDX{} (less than or equal to), \DWOPgeINDX{}
1073 (greater than or equal to), \DWOPeqINDX{} (equal to), \DWOPltINDX{} (less
1074 than), \DWOPgtINDX{} (greater than) and \DWOPneINDX{} (not equal to).
1077 \itembfnl{\DWOPskipTARG}
1078 \DWOPskipTARG{} is an unconditional branch. Its single operand
1079 is a 2\dash byte signed integer constant. The 2\dash byte constant is
1080 the number of bytes of the DWARF expression to skip forward
1081 or backward from the current operation, beginning after the
1082 2\dash byte constant.
1084 \itembfnl{\DWOPbraTARG}
1085 \DWOPbraTARG{} is a conditional branch. Its single operand is a
1086 2\dash byte signed integer constant. This operation pops the
1087 top of stack. If the value popped is not the constant 0,
1088 the 2\dash byte constant operand is the number of bytes of the
1089 DWARF expression to skip forward or backward from the current
1090 operation, beginning after the 2\dash byte constant.
1092 % The following item does not correctly hyphenate leading
1093 % to an overfull hbox and a visible artifact.
1094 % So we use \- to suggest hyphenation in this rare situation.
1095 \itembfnl{\DWOPcalltwoTARG, \DWOPcallfourTARG, \DWOPcallrefTARG}
1098 and \DWOPcallrefINDX{} perform
1099 subroutine calls during evaluation of a DWARF expression or
1100 location description.
1101 For \DWOPcalltwoINDX{} and \DWOPcallfour{},
1102 the operand is the 2\dash~ or 4\dash byte unsigned offset, respectively,
1103 of a debugging information entry in the current compilation
1104 unit. The \DWOPcallref{} operator has a single operand. In the
1105 \thirtytwobitdwarfformat,
1106 the operand is a 4\dash byte unsigned value;
1107 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
1108 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1109 The operand is used as the offset of a
1110 debugging information entry in a
1112 section which may be contained in a shared object or executable
1113 other than that containing the operator. For references from
1114 one shared object or executable to another, the relocation
1115 must be performed by the consumer.
1117 \textit{Operand interpretation of
1118 \DWOPcalltwo, \DWOPcallfour{} and \DWOPcallref{} is exactly like
1119 that for \DWFORMreftwo, \DWFORMreffour{} and \DWFORMrefaddr,
1121 (see Section \refersec{datarep:attributeencodings}).
1124 These operations transfer
1125 control of DWARF expression evaluation to
1126 \addtoindexx{location attribute}
1129 attribute of the referenced debugging information entry. If
1130 there is no such attribute, then there is no effect. Execution
1131 of the DWARF expression of
1132 \addtoindexx{location attribute}
1134 \DWATlocation{} attribute may add
1135 to and/or remove from values on the stack. Execution returns
1136 to the point following the call when the end of the attribute
1137 is reached. Values on the stack at the time of the call may be
1138 used as parameters by the called expression and values left on
1139 the stack by the called expression may be used as return values
1140 by prior agreement between the calling and called expressions.
1144 \subsubsection{Special Operations}
1146 \addtoindexx{DWARF expression!special operations}
1147 is one special operation currently defined:
1148 \begin{enumerate}[1. ]
1149 \itembfnl{\DWOPnopTARG}
1150 The \DWOPnopTARG{} operation is a place holder. It has no effect
1151 on the location stack or any of its values.
1154 \subsection{Example Stack Operations}
1156 \addtoindexx{DWARF expression!examples}
1157 stack operations defined in
1158 Section \refersec{chap:stackoperations}.
1159 are fairly conventional, but the following
1160 examples illustrate their behavior graphically.}
1162 \begin{longtable}[c]{rrcrr}
1163 \multicolumn{2}{c}{Before} & Operation & \multicolumn{2}{c}{After} \\
1167 0& 17& \DWOPdup{} &0 &17 \\
1169 2& 1000 & & 2 & 29\\
1173 0 & 17 & \DWOPdrop{} & 0 & 29 \\
1174 1 &29 & & 1 & 1000 \\
1178 0 & 17 & \DWOPpick, 2 & 0 & 1000 \\
1184 0&17& \DWOPover&0&29 \\
1190 0&17& \DWOPswap{} &0&29 \\
1192 2&1000 & & 2&1000 \\
1195 0&17&\DWOProt{} & 0 &29 \\
1196 1&29 & & 1 & 1000 \\
1197 2& 1000 & & 2 & 17 \\
1200 \section{Location Descriptions}
1201 \label{chap:locationdescriptions}
1202 \textit{Debugging information
1203 \addtoindexx{location description}
1205 \addtoindexx{location description|see{\textit{also} DWARF expression}}
1206 provide consumers a way to find
1207 the location of program variables, determine the bounds
1208 of dynamic arrays and strings, and possibly to find the
1209 base address of a subroutine\textquoteright s stack frame or the return
1210 address of a subroutine. Furthermore, to meet the needs of
1211 recent computer architectures and optimization techniques,
1212 debugging information must be able to describe the location of
1213 an object whose location changes over the object\textquoteright s lifetime.}
1215 Information about the location of program objects is provided
1216 by location descriptions. Location descriptions can be either
1218 \begin{enumerate}[1. ]
1219 \item \textit{Single location descriptions},
1221 \addtoindexx{location description!single}
1223 \addtoindexx{single location description}
1224 a language independent representation of
1225 addressing rules of arbitrary complexity built from
1226 DWARF expressions (See Section \refersec{chap:dwarfexpressions})
1228 DWARF operations specific to describing locations. They are
1229 sufficient for describing the location of any object as long
1230 as its lifetime is either static or the same as the
1231 \livelink{chap:lexicalblock}{lexical block} that owns it,
1232 and it does not move during its lifetime.
1234 Single location descriptions are of two kinds:
1235 \begin{enumerate}[a) ]
1236 \item Simple location descriptions, which describe the location
1237 \addtoindexx{location description!simple}
1238 of one contiguous piece (usually all) of an object. A simple
1239 location description may describe a location in addressable
1240 memory, or in a register, or the lack of a location (with or
1241 without a known value).
1243 \item Composite location descriptions, which describe an
1244 \addtoindexx{location description!composite}
1245 object in terms of pieces each of which may be contained in
1246 part of a register or stored in a memory location unrelated
1250 \item \textit{Location lists}, which are used to
1251 \addtoindexx{location list}
1253 \addtoindexx{location description!use in location list}
1254 objects that have a limited lifetime or change their location
1255 during their lifetime. Location lists are described in
1256 Section \refersec{chap:locationlists} below.
1260 Location descriptions are distinguished in a context sensitive
1261 manner. As the value of an attribute, a location description
1263 \addtoindexx{exprloc class}
1264 class \livelink{chap:classexprloc}{exprloc}
1265 and a location list is encoded
1266 using class \livelink{chap:classloclistptr}{loclistptr}
1268 \addtoindex{loclistptr}
1269 serves as an offset into a
1271 \addtoindexx{location list}
1272 location list table).
1275 \subsection{Single Location Descriptions}
1276 A single location description is either:
1277 \begin{enumerate}[1. ]
1278 \item A simple location description, representing an object
1279 \addtoindexx{location description!simple}
1281 \addtoindexx{simple location description}
1282 exists in one contiguous piece at the given location, or
1283 \item A composite location description consisting of one or more
1284 \addtoindexx{location description!composite}
1285 simple location descriptions, each of which is followed by
1286 one composition operation. Each simple location description
1287 describes the location of one piece of the object; each
1288 composition operation describes which part of the object is
1289 located there. Each simple location description that is a
1290 DWARF expression is evaluated independently of any others
1291 (as though on its own separate stack, if any).
1296 \subsubsection{Simple Location Descriptions}
1299 \addtoindexx{location description!simple}
1300 simple location description consists of one
1301 contiguous piece or all of an object or value.
1304 \subsubsubsection{Memory Location Descriptions}
1306 \addtoindexx{location description!memory}
1307 memory location description
1308 \addtoindexx{memory location description}
1309 consists of a non\dash empty DWARF
1311 Section \refersec{chap:dwarfexpressions}
1312 ), whose value is the address of
1313 a piece or all of an object or other entity in memory.
1315 \subsubsubsection{Register Location Descriptions}
1316 \label{chap:registerlocationdescriptions}
1317 A register location description consists of a register name
1318 operation, which represents a piece or all of an object
1319 located in a given register.
1321 \textit{Register location descriptions describe an object
1322 (or a piece of an object) that resides in a register, while
1323 the opcodes listed in
1324 Section \refersec{chap:registerbasedaddressing}
1325 are used to describe an object (or a piece of
1326 an object) that is located in memory at an address that is
1327 contained in a register (possibly offset by some constant). A
1328 register location description must stand alone as the entire
1329 description of an object or a piece of an object.
1332 The following DWARF operations can be used to name a register.
1335 \textit{Note that the register number represents a DWARF specific
1336 mapping of numbers onto the actual registers of a given
1337 architecture. The mapping should be chosen to gain optimal
1338 density and should be shared by all users of a given
1339 architecture. It is recommended that this mapping be defined
1340 by the ABI authoring committee for each architecture.
1342 \begin{enumerate}[1. ]
1343 \itembfnl{\DWOPregzeroTARG, \DWOPregoneTARG, ..., \DWOPregthirtyoneTARG}
1344 The \DWOPregnTARG{} operations encode the names of up to 32
1345 registers, numbered from 0 through 31, inclusive. The object
1346 addressed is in register \textit{n}.
1349 \itembfnl{\DWOPregxTARG}
1350 The \DWOPregxTARG{} operation has a single unsigned LEB128 literal
1351 operand that encodes the name of a register.
1355 \textit{These operations name a register location. To
1356 fetch the contents of a register, it is necessary to use
1357 one of the register based addressing operations, such as
1359 (Section \refersec{chap:registerbasedaddressing})}.
1361 \subsubsubsection{Implicit Location Descriptions}
1362 An \addtoindex{implicit location description}
1363 represents a piece or all
1364 \addtoindexx{location description!implicit}
1365 of an object which has no actual location but whose contents
1366 are nonetheless either known or known to be undefined.
1368 The following DWARF operations may be used to specify a value
1369 that has no location in the program but is a known constant
1370 or is computed from other locations and values in the program.
1372 The following DWARF operations may be used to specify a value
1373 that has no location in the program but is a known constant
1374 or is computed from other locations and values in the program.
1375 \begin{enumerate}[1. ]
1376 \itembfnl{\DWOPimplicitvalueTARG}
1377 The \DWOPimplicitvalueTARG{}
1378 operation specifies an immediate value
1379 using two operands: an unsigned LEB128 length, followed by
1380 %FIXME: should this block be a reference? To what?
1381 a \nolink{block} representing the value in the memory representation
1382 of the target machine. The length operand gives the length
1383 in bytes of the \nolink{block}.
1385 \itembfnl{\DWOPstackvalueTARG}
1386 The \DWOPstackvalueTARG{}
1387 operation specifies that the object
1388 does not exist in memory but its value is nonetheless known
1389 and is at the top of the DWARF expression stack. In this form
1390 of location description, the DWARF expression represents the
1391 actual value of the object, rather than its location. The
1392 \DWOPstackvalueINDX{} operation terminates the expression.
1394 \itembfnl{\DWOPimplicitpointerTARG}
1395 The \DWOPimplicitpointerNAME{} operation specifies that the object
1396 is a pointer that cannot be represented as a real pointer,
1397 even though the value it would point to can be described. In
1398 this form of location description, the DWARF expression refers
1399 to a debugging information entry that represents the actual
1400 value of the object to which the pointer would point. Thus, a
1401 consumer of the debug information would be able to show the
1402 value of the dereferenced pointer, even when it cannot show
1403 the value of the pointer itself.
1406 The \DWOPimplicitpointerNAME{} operation has two operands: a
1407 reference to a debugging information entry that describes
1408 the dereferenced object's value, and a signed number that
1409 is treated as a byte offset from the start of that value.
1410 The first operand is a 4-byte unsigned value in the 32-bit
1411 DWARF format, or an 8-byte unsigned value in the 64-bit
1412 DWARF format (see Section
1413 \refersec{datarep:32bitand64bitdwarfformats}).
1414 The second operand is a \addtoindex{signed LEB128} number.
1416 The first operand is used as the offset of a debugging
1417 information entry in a \dotdebuginfo{} section, which may be
1418 contained in a shared object or executable other than that
1419 containing the operator. For references from one shared object
1420 or executable to another, the relocation must be performed by
1423 \textit{The debugging information entry referenced by a
1424 \DWOPimplicitpointerNAME{} operation is typically a
1425 \DWTAGvariable{} or \DWTAGformalparameter{} entry whose
1426 \DWATlocation{} attribute gives a second DWARF expression or a
1427 location list that describes the value of the object, but the
1428 referenced entry may be any entry that contains a \DWATlocation{}
1429 or \DWATconstvalue{} attribute (for example, \DWTAGdwarfprocedure).
1430 By using the second DWARF expression, a consumer can
1431 reconstruct the value of the object when asked to dereference
1432 the pointer described by the original DWARF expression
1433 containing the \DWOPimplicitpointer{} operation.}
1437 \textit{DWARF location expressions are intended to yield the \textbf{location}
1438 of a value rather than the value itself. An optimizing compiler
1439 may perform a number of code transformations where it becomes
1440 impossible to give a location for a value, but remains possible
1441 to describe the value itself.
1442 Section \refersec{chap:registerlocationdescriptions}
1443 describes operators that can be used to
1444 describe the location of a value when that value exists in a
1445 register but not in memory. The operations in this section are
1446 used to describe values that exist neither in memory nor in a
1449 \paragraph{Empty Location Descriptions}
1451 An \addtoindex{empty location description}
1452 consists of a DWARF expression
1453 \addtoindexx{location description!empty}
1454 containing no operations. It represents a piece or all of an
1455 object that is present in the source but not in the object code
1456 (perhaps due to optimization).
1459 \subsubsection{Composite Location Descriptions}
1460 A composite location description describes an object or
1461 value which may be contained in part of a register or stored
1462 in more than one location. Each piece is described by a
1463 composition operation, which does not compute a value nor
1464 store any result on the DWARF stack. There may be one or
1465 more composition operations in a single composite location
1466 description. A series of such operations describes the parts
1467 of a value in memory address order.
1469 Each composition operation is immediately preceded by a simple
1470 location description which describes the location where part
1471 of the resultant value is contained.
1472 \begin{enumerate}[1. ]
1473 \itembfnl{\DWOPpieceTARG}
1474 The \DWOPpieceTARG{} operation takes a
1475 single operand, which is an
1476 unsigned LEB128 number. The number describes the size in bytes
1477 of the piece of the object referenced by the preceding simple
1478 location description. If the piece is located in a register,
1479 but does not occupy the entire register, the placement of
1480 the piece within that register is defined by the ABI.
1482 \textit{Many compilers store a single variable in sets of registers,
1483 or store a variable partially in memory and partially in
1484 registers. \DWOPpieceINDX{} provides a way of describing how large
1485 a part of a variable a particular DWARF location description
1488 \itembfnl{\DWOPbitpieceTARG}
1489 The \DWOPbitpieceTARG{}
1490 operation takes two operands. The first
1491 is an unsigned LEB128 number that gives the size in bits
1492 of the piece. The second is an unsigned LEB128 number that
1493 gives the offset in bits from the location defined by the
1494 preceding DWARF location description.
1496 Interpretation of the
1497 offset depends on the kind of location description. If the
1498 location description is empty, the offset doesn\textquoteright t matter and
1499 the \DWOPbitpieceINDX{} operation describes a piece consisting
1500 of the given number of bits whose values are undefined. If
1501 the location is a register, the offset is from the least
1502 significant bit end of the register. If the location is a
1503 memory address, the \DWOPbitpieceINDX{} operation describes a
1504 sequence of bits relative to the location whose address is
1505 on the top of the DWARF stack using the bit numbering and
1506 direction conventions that are appropriate to the current
1507 language on the target system. If the location is any implicit
1508 value or stack value, the \DWOPbitpieceINDX{} operation describes
1509 a sequence of bits using the least significant bits of that
1513 \textit{\DWOPbitpieceINDX{} is
1514 used instead of \DWOPpieceINDX{} when
1515 the piece to be assembled into a value or assigned to is not
1516 byte-sized or is not at the start of a register or addressable
1522 \subsubsection{Example Single Location Descriptions}
1524 Here are some examples of how DWARF operations are used to form location descriptions:
1525 % Probably the only place that this will be used, so not in dwarf.tex?
1526 \newcommand{\descriptionitemnl}[1]{\item[#1]\mbox{}\\}
1528 \descriptionitemnl{\DWOPregthree}
1529 The value is in register 3.
1531 \descriptionitemnl{\DWOPregx{} 54}
1532 The value is in register 54.
1534 \descriptionitemnl{\DWOPaddr{} 0x80d0045c}
1535 The value of a static variable is at machine address 0x80d0045c.
1537 \descriptionitemnl{\DWOPbregeleven{} 44}
1538 Add 44 to the value in register 11 to get the address of an automatic
1541 \descriptionitemnl{\DWOPfbreg{} -50}
1542 Given a \DWATframebase{} value of
1543 \doublequote{\DWOPbregthirtyone{} 64,} this example
1544 computes the address of a local variable that is -50 bytes from a
1545 logical frame pointer that is computed by adding 64 to the current
1546 stack pointer (register 31).
1548 \descriptionitemnl{\DWOPbregx{} 54 32 \DWOPderef}
1549 A call-by-reference parameter whose address is in the word 32 bytes
1550 from where register 54 points.
1552 \descriptionitemnl{\DWOPplusuconst{} 4}
1553 A structure member is four bytes from the start of the structure
1554 instance. The base address is assumed to be already on the stack.
1556 \descriptionitemnl{\DWOPregthree{} \DWOPpiece{} 4 \DWOPregten{} \DWOPpiece{} 2}
1557 A variable whose first four bytes reside in register 3 and whose next
1558 two bytes reside in register 10.
1560 \descriptionitemnl{\DWOPregzero{} \DWOPpiece{} 4 \DWOPpiece{} 4 \DWOPfbreg{} -12 \DWOPpiece{} 4}
1561 A twelve byte value whose first four bytes reside in register zero,
1562 whose middle four bytes are unavailable (perhaps due to optimization),
1563 and whose last four bytes are in memory, 12 bytes before the frame
1566 \descriptionitemnl{\DWOPbregone{} 0 \DWOPbregtwo{} 0 \DWOPplus{} \DWOPstackvalue{} }
1567 Add the contents of r1 and r2 to compute a value. This value is the
1568 \doublequote{contents} of an otherwise anonymous location.
1571 \descriptionitemnl{\DWOPlitone{} \DWOPstackvalue{} \DWOPpiece{} 4 }
1572 \vspace{-0.1\parsep}
1573 \descriptionitemnl{\DWOPbregthree 0 \DWOPbregfour 0 \DWOPplus{} \DWOPstackvalue{} \DWOPpiece{} 4}
1574 The object value is found in an anonymous (virtual) location whose
1575 value consists of two parts, given in memory address order: the 4 byte
1576 value 1 followed by the four byte value computed from the sum of the
1577 contents of r3 and r4.
1581 \subsection{Location Lists}
1582 \label{chap:locationlists}
1583 There are two forms of location lists. The first form
1584 is intended for use in other than a split DWARF object,
1585 while the second is intended for use in a split DWARF object
1586 (see Section \refersec{datarep:splitdwarfobjects}). The two
1587 forms are otherwise equivalent.
1589 \textit{The form for split DWARF objects is new in \DWARFVersionV.}
1591 \subsubsection{Location Lists in Non-split Objects}
1592 \label{chap:locationlistsinnonsplitobjects}
1594 \addtoindexx{location list}
1595 are used in place of location expressions
1596 whenever the object whose location is being described
1597 can change location during its lifetime.
1599 \addtoindexx{location list}
1600 are contained in a separate object file section called
1601 \dotdebugloc{}. A location list is indicated by a location
1602 attribute whose value is an offset from the beginning of
1603 the \dotdebugloc{} section to the first byte of the list for the
1606 Each entry in a location list is either a location
1607 \addtoindexi{list}{address selection|see{base address selection}}
1610 \addtoindexi{base}{base address selection entry!in location list}
1611 address selection entry,
1612 \addtoindexx{location list!base address selection entry}
1614 \addtoindexx{end of list entry!in location list}
1617 A location list entry has two forms:
1618 a normal location list entry and a default location list entry.
1621 \addtoindexx{location list!normal entry}
1622 normal location list entry consists of:
1623 \begin{enumerate}[1. ]
1624 \item A beginning address offset.
1625 This address offset has the \addtoindex{size of an address} and is
1626 relative to the applicable base address of the compilation
1627 unit referencing this location list. It marks the beginning
1629 \addtoindexi{range}{address range!in location list}
1630 over which the location is valid.
1632 \item An ending address offset. This address offset again
1633 has the \addtoindex{size of an address} and is relative to the applicable
1634 base address of the compilation unit referencing this location
1635 list. It marks the first address past the end of the address
1636 range over which the location is valid. The ending address
1637 must be greater than or equal to the beginning address.
1639 \textit{A location list entry (but not a base address selection or
1640 end of list entry) whose beginning
1641 and ending addresses are equal has no effect
1642 because the size of the range covered by such
1645 \item A 2-byte length describing the length of the location
1646 description that follows.
1648 \item A \addtoindex{single location description}
1649 describing the location of the object over the range specified by
1650 the beginning and end addresses.
1654 The applicable base address of a normal
1655 location list entry is
1656 \addtoindexx{location list!base address selection entry}
1657 determined by the closest preceding base address selection
1658 entry (see below) in the same location list. If there is
1659 no such selection entry, then the applicable base address
1660 defaults to the base address of the compilation unit (see
1661 Section \refersec{chap:normalandpartialcompilationunitentries}).
1663 \textit{In the case of a compilation unit where all of
1664 the machine code is contained in a single contiguous section,
1665 no base address selection entry is needed.}
1667 Address ranges defined by normal location list entries
1668 may overlap. When they do, they describe a
1669 situation in which an object exists simultaneously in more than
1670 one place. If all of the address ranges in a given location
1671 list do not collectively cover the entire range over which the
1672 object in question is defined, it is assumed that the object is
1673 not available for the portion of the range that is not covered.
1675 A default location list entry consists of:
1676 \addtoindexx{location list!default entry}
1677 \begin{enumerate}[1. ]
1679 \item The value of the largest representable address offset (for
1680 example, \wffffffff when the size of an address is 32 bits).
1681 \item A simple location description describing the location of the
1682 object when there is no prior normal location list entry
1683 that applies in the same location list.
1686 A default location list entry is independent of any applicable
1687 base address (except to the extent to which base addresses
1688 affect prior normal location list entries).
1690 A default location list entry must be the last location list
1691 entry of a location list except for the terminating end of list
1694 A default location list entry describes an unlimited number
1695 (zero, one or more) of address ranges, none of which overlap
1696 any of the address ranges defined earlier in the same location
1697 list. Further, all such address ranges have the same simple
1702 \addtoindexi{address}{address selection|see{base address selection}}
1703 \addtoindexx{location list!base address selection entry}
1705 \addtoindexi{entry}{base address selection entry!in location list}
1707 \begin{enumerate}[1. ]
1708 \item The value of the largest representable
1709 address offset (for example, \wffffffff when the size of
1710 an address is 32 bits).
1711 \item An address, which defines the
1712 appropriate base address for use in interpreting the beginning
1713 and ending address offsets of subsequent entries of the location list.
1716 \textit{A base address selection entry
1717 affects only the list in which it is contained.}
1720 The end of any given location list is marked by an
1721 \addtoindexx{location list!end of list entry}
1722 end of list entry, which consists of a 0 for the beginning address
1723 offset and a 0 for the ending address offset. A location list
1725 \addtoindexx{end of list entry!in location list}
1726 end of list entry describes an object that
1727 exists in the source code but not in the executable program.
1729 Neither a base address selection entry nor an end of list
1730 entry includes a location description.
1732 \textit{When a DWARF consumer is parsing and decoding a location
1733 list, it must recognize the beginning and ending address
1734 offsets of (0, 0) for an end of list entry and (0, \doublequote{-1}) for
1735 a default location list entry prior to applying any base
1736 address. Any other pair of offsets beginning with 0 is a
1737 valid normal location list entry. Next, it must recognize the
1738 beginning address offset of \doublequote{-1} for a base address selection
1739 entry prior to applying any base address. The current base
1740 address is not applied to the subsequent value (although there
1741 may be an underlying object language relocation that affects
1744 \textit{A base address selection entry and an end of list
1745 entry for a location list are identical to a base address
1746 selection entry and end of list entry, respectively, for a
1747 \addtoindex{range list}
1748 (see Section \refersec{chap:noncontiguousaddressranges})
1750 and representation.}
1752 \subsubsection{Location Lists in Split Objects}
1753 \label{chap:locationlistsinsplitobjects}
1754 In a split DWARF object (see
1755 Section \refersec{datarep:splitdwarfobjects}),
1756 location lists are contained in the \dotdebuglocdwo{} section.
1758 Each entry in the location list
1759 begins with a type code, which is a single byte that
1760 identifies the type of entry. There are five types of entries:
1762 \itembfnl{\DWLLEendoflistentryTARG}
1763 This entry indicates the end of a location list, and
1764 contains no further data.
1766 \itembfnl{\DWLLEbaseaddressselectionentryTARG}
1767 This entry contains an unsigned LEB128 value immediately
1768 following the type code. This value is the index of an
1769 address in the \dotdebugaddr{} section, which is then used as
1770 the base address when interpreting offsets in subsequent
1771 location list entries of type \DWLLEoffsetpairentry.
1772 This index is relative to the value of the
1773 \DWATaddrbase{} attribute of the associated compilation unit.
1775 \itembfnl{\DWLLEstartendentryTARG}
1776 This entry contains two unsigned LEB128 values
1777 immediately following the type code. These values are the
1778 indices of two addresses in the \dotdebugaddr{} section.
1779 These indices are relative to the value of the
1780 \DWATaddrbase{} attribute of the associated compilation unit.
1781 These indicate the starting and ending addresses,
1782 respectively, that define the address range for which
1783 this location is valid. The starting and ending addresses
1784 given by this type of entry are not relative to the
1785 compilation unit base address. A single location
1786 description follows the fields that define the address range.
1788 \itembfnl{\DWLLEstartlengthentryTARG}
1789 This entry contains one unsigned LEB128 value and a 4-byte
1790 unsigned value immediately following the type code. The
1791 first value is the index of an address in the \dotdebugaddr{}
1792 section, which marks the beginning of the address range
1793 over which the location is valid.
1794 This index is relative to the value of the
1795 \DWATaddrbase{} attribute of the associated compilation unit.
1796 The starting address given by this
1797 type of entry is not relative to the compilation unit
1798 base address. The second value is the
1799 length of the range. A single location
1800 description follows the fields that define the address range.
1802 \itembfnl{\DWLLEoffsetpairentryTARG}
1803 This entry contains two 4-byte unsigned values
1804 immediately following the type code. These values are the
1805 starting and ending offsets, respectively, relative to
1806 the applicable base address, that define the address
1807 range for which this location is valid. A single location
1808 description follows the fields that define the address range.
1812 \section{Types of Program Entities}
1813 \label{chap:typesofprogramentities}
1815 \hypertarget{chap:DWATtypetypeofdeclaration}{}
1816 debugging information entry describing a declaration that
1818 \addtoindexx{type attribute}
1819 a \DWATtype{} attribute, whose value is a
1820 reference to another debugging information entry. The entry
1821 referenced may describe a base type, that is, a type that is
1822 not defined in terms of other data types, or it may describe a
1823 user-defined type, such as an array, structure or enumeration.
1824 Alternatively, the entry referenced may describe a type
1825 modifier, such as constant, packed, pointer, reference or
1826 volatile, which in turn will reference another entry describing
1827 a type or type modifier (using
1828 \addtoindexx{type attribute}
1829 a \DWATtype{} attribute of its
1831 Section \referfol{chap:typeentries}
1832 for descriptions of the entries describing
1833 base types, user-defined types and type modifiers.
1837 \section{Accessibility of Declarations}
1838 \label{chap:accessibilityofdeclarations}
1839 \textit{Some languages, notably C++ and
1840 \addtoindex{Ada}, have the concept of
1841 the accessibility of an object or of some other program
1842 entity. The accessibility specifies which classes of other
1843 program objects are permitted access to the object in question.}
1845 The accessibility of a declaration is
1846 \hypertarget{chap:DWATaccessibilitycandadadeclarations}{}
1848 \DWATaccessibility{}
1850 \addtoindexx{accessibility attribute}
1851 value is a constant drawn from the set of codes listed in Table
1852 \refersec{tab:accessibilitycodes}.
1854 \begin{simplenametable}[1.9in]{Accessibility codes}{tab:accessibilitycodes}
1855 \DWACCESSpublicTARG{} \\
1856 \DWACCESSprivateTARG{} \\
1857 \DWACCESSprotectedTARG{} \\
1858 \end{simplenametable}
1860 \section{Visibility of Declarations}
1861 \label{chap:visibilityofdeclarations}
1863 \textit{Several languages (such as \addtoindex{Modula-2})
1864 have the concept of the visibility of a declaration. The
1865 visibility specifies which declarations are to be
1866 visible outside of the entity in which they are
1870 \hypertarget{chap:DWATvisibilityvisibilityofdeclaration}{}
1871 visibility of a declaration is represented
1872 by a \DWATvisibility{}
1873 attribute\addtoindexx{visibility attribute}, whose value is a
1874 constant drawn from the set of codes listed in
1875 Table \refersec{tab:visibilitycodes}.
1877 \begin{simplenametable}[1.5in]{Visibility codes}{tab:visibilitycodes}
1878 \DWVISlocalTARG{} \\
1879 \DWVISexportedTARG{} \\
1880 \DWVISqualifiedTARG{} \\
1881 \end{simplenametable}
1883 \section{Virtuality of Declarations}
1884 \label{chap:virtualityofdeclarations}
1885 \textit{C++ provides for virtual and pure virtual structure or class
1886 member functions and for virtual base classes.}
1889 \hypertarget{chap:DWATvirtualityvirtualityindication}{}
1890 virtuality of a declaration is represented by a
1892 attribute\addtoindexx{virtuality attribute}, whose value is a constant drawn
1893 from the set of codes listed in
1894 Table \refersec{tab:virtualitycodes}.
1896 \begin{simplenametable}[2.5in]{Virtuality codes}{tab:virtualitycodes}
1897 \DWVIRTUALITYnoneTARG{} \\
1898 \DWVIRTUALITYvirtualTARG{} \\
1899 \DWVIRTUALITYpurevirtualTARG{} \\
1900 \end{simplenametable}
1902 \section{Artificial Entries}
1903 \label{chap:artificialentries}
1904 \textit{A compiler may wish to generate debugging information entries
1905 for objects or types that were not actually declared in the
1906 source of the application. An example is a formal parameter
1907 %FIXME: The word 'this' should be rendered like a variant italic,
1908 %FIXME: not as a quoted name. Changed to tt font--RB
1909 entry to represent the
1910 \texttt{this} parameter\index{this parameter@\texttt{this} parameter}
1911 hidden \texttt{this} parameter that most C++
1912 implementations pass as the first argument to non-static member
1915 Any debugging information entry representing the
1916 \addtoindexx{artificial attribute}
1917 declaration of an object or type artificially generated by
1918 a compiler and not explicitly declared by the source program
1919 \hypertarget{chap:DWATartificialobjectsortypesthat}{}
1921 \DWATartificial{} attribute,
1922 which is a \livelink{chap:classflag}{flag}.
1924 \section{Segmented Addresses}
1925 \label{chap:segmentedaddresses}
1926 \textit{In some systems, addresses are specified as offsets within a
1928 \addtoindexx{address space!segmented}
1930 \addtoindexx{segmented addressing|see{address space}}
1931 rather than as locations within a single flat
1932 \addtoindexx{address space!flat}
1935 Any debugging information entry that contains a description
1936 \hypertarget{chap:DWATsegmentaddressinginformation}{}
1937 of the location of an object or subroutine may have a
1938 \DWATsegment{} attribute,
1939 \addtoindexx{segment attribute}
1940 whose value is a location
1941 description. The description evaluates to the segment selector
1942 of the item being described. If the entry containing the
1943 \DWATsegment{} attribute has a
1947 \DWATentrypc{} attribute,
1948 \addtoindexx{entry pc attribute}
1951 description that evaluates to an address, then those address
1952 values represent the offset portion of the address within
1953 the segment specified
1954 \addtoindexx{segment attribute}
1958 \DWATsegment{} attribute, it inherits
1959 \addtoindexx{segment attribute}
1960 the segment value from its parent entry. If none of the
1961 entries in the chain of parents for this entry back to
1962 its containing compilation unit entry have
1963 \DWATsegment{} attributes,
1964 then the entry is assumed to exist within a flat
1966 Similarly, if the entry has a
1967 \DWATsegment{} attribute
1968 \addtoindexx{segment attribute}
1969 containing an empty location description, that
1970 entry is assumed to exist within a
1971 \addtoindexi{flat}{address space!flat}
1974 \textit{Some systems support different classes of
1976 \addtoindexx{address class!attribute}.
1978 address class may affect the way a pointer is dereferenced
1979 or the way a subroutine is called.}
1982 Any debugging information entry representing a pointer or
1983 reference type or a subroutine or subroutine type may
1986 attribute, whose value is an integer
1987 constant. The set of permissible values is specific to
1988 each target architecture. The value \DWADDRnoneTARG,
1990 is common to all encodings, and means that no address class
1993 \textit {For example, the Intel386 \texttrademark\ processor might use the following values:}
1996 \caption{Example address class codes}
1997 \label{tab:inteladdressclasstable}
1999 \begin{tabular}{l|c|l}
2001 Name&Value&Meaning \\
2003 \textit{DW\_ADDR\_none}& 0 & \textit{no class specified} \\
2004 \textit{DW\_ADDR\_near16}& 1 & \textit{16\dash bit offset, no segment} \\
2005 \textit{DW\_ADDR\_far16}& 2 & \textit{16\dash bit offset, 16\dash bit segment} \\
2006 \textit{DW\_ADDR\_huge16}& 3 & \textit{16\dash bit offset, 16\dash bit segment} \\
2007 \textit{DW\_ADDR\_near32}& 4 & \textit{32\dash bit offset, no segment} \\
2008 \textit{DW\_ADDR\_far32}& 5 & \textit{32\dash bit offset, 16\dash bit segment} \\
2014 \section{Non-Defining Declarations and Completions}
2015 \label{nondefiningdeclarationsandcompletions}
2016 A debugging information entry representing a program entity
2017 typically represents the defining declaration of that
2018 entity. In certain contexts, however, a debugger might need
2019 information about a declaration of an entity that is not
2020 \addtoindexx{incomplete declaration}
2021 also a definition, or is otherwise incomplete, to evaluate
2022 \hypertarget{chap:DWATdeclarationincompletenondefiningorseparateentitydeclaration}{}
2023 an expression correctly.
2026 \textit{As an example, consider the following fragment of \addtoindex{C} code:}
2040 \textit{\addtoindex{C} scoping rules require that the
2041 value of the variable x passed to the function g is the value of the
2042 global variable x rather than of the local version.}
2044 \subsection{Non-Defining Declarations}
2045 A debugging information entry that
2046 represents a non-defining
2047 \addtoindexx{non-defining declaration}
2049 \addtoindex{incomplete declaration}
2050 of a program entity has a
2051 \addtoindexx{declaration attribute}
2052 \DWATdeclaration{} attribute, which is a
2053 \livelink{chap:classflag}{flag}.
2055 \subsection{Declarations Completing Non-Defining Declarations}
2056 A debugging information entry that represents a
2057 \hypertarget{chap:DWATspecificationincompletenondefiningorseparatedeclaration}{}
2058 declaration that completes another (earlier)
2059 non\dash defining declaration may have a
2060 \DWATspecification{}
2061 attribute whose value is a \livelink{chap:classreference}{reference} to
2062 the debugging information entry representing the non-defining declaration. A debugging
2063 information entry with a
2064 \DWATspecification{}
2065 attribute does not need to duplicate information
2066 provided by the debugging information entry referenced by that specification attribute.
2068 It is not the case that all attributes of the debugging information entry referenced by a
2069 \DWATspecification{} attribute
2070 apply to the referring debugging information entry.
2073 \addtoindexx{declaration attribute}
2077 \addtoindexx{declaration attribute}
2078 clearly cannot apply to a
2079 \addtoindexx{declaration attribute}
2081 \addtoindexx{sibling attribute}
2086 \section{Declaration Coordinates}
2087 \label{chap:declarationcoordinates}
2088 \livetargi{chap:declarationcoordinates}{}{declaration coordinates}
2089 \textit{It is sometimes useful in a debugger to be able to associate
2090 a declaration with its occurrence in the program source.}
2092 Any debugging information
2093 \hypertarget{chap:DWATdeclfilefilecontainingsourcedeclaration}{}
2095 \hypertarget{chap:DWATdecllinelinenumberofsourcedeclaration}{}
2097 \hypertarget{chap:DWATdeclcolumncolumnpositionofsourcedeclaration}{}
2099 \addtoindexx{line number of declaration}
2100 declaration of an object, module, subprogram or
2101 \addtoindex{declaration column attribute}
2103 \addtoindex{declaration file attribute}
2105 \addtoindex{declaration line attribute}
2110 attributes each of whose value is an unsigned
2111 \livelink{chap:classconstant}{integer constant}.
2114 \addtoindexx{declaration file attribute}
2118 \addtoindexx{file containing declaration}
2120 a file number from the line number information table for the
2121 compilation unit containing the debugging information entry and
2122 represents the source file in which the declaration appeared
2123 (see Section \refersec{chap:linenumberinformation}).
2124 The value 0 indicates that no source file
2128 \addtoindexx{declaration line attribute}
2129 the \DWATdeclline{} attribute represents
2130 the source line number at which the first character of
2131 the identifier of the declared object appears. The value 0
2132 indicates that no source line has been specified.
2135 \addtoindexx{declaration column attribute}
2136 the \DWATdeclcolumn{} attribute represents
2137 the source column number at which the first character of
2138 the identifier of the declared object appears. The value 0
2139 indicates that no column has been specified.
2141 \section{Identifier Names}
2142 \label{chap:identifiernames}
2144 \hypertarget{chap:DWATnamenameofdeclaration}{}
2145 debugging information entry
2146 \addtoindexx{identifier names}
2148 \addtoindexx{names!identifier}
2150 that has been given a name may have a
2151 \DWATname{} attribute,
2153 \addtoindexx{name attribute}
2154 value is a \livelink{chap:classstring}{string}
2155 representing the name as it appears in
2156 the source program. A debugging information entry containing
2157 no name attribute, or containing a name attribute whose value
2158 consists of a name containing a single null byte, represents
2159 a program entity for which no name was given in the source.
2161 \textit{Because the names of program objects described by DWARF are the
2162 names as they appear in the source program, implementations
2163 of language translators that use some form of mangled name
2164 \addtoindexx{mangled names}
2165 (as do many implementations of C++) should use the unmangled
2166 form of the name in the
2167 DWARF \DWATname{} attribute,
2168 \addtoindexx{name attribute}
2169 including the keyword operator (in names such as \doublequote{operator +}),
2170 if present. See also
2171 Section \referfol{chap:linkagenames} regarding the use
2172 of \DWATlinkagename{} for
2173 \addtoindex{mangled names}.
2175 multiple whitespace characters may be compressed.}
2177 \section{Data Locations and DWARF Procedures}
2178 Any debugging information entry describing a data object (which
2179 \hypertarget{chap:DWATlocationdataobjectlocation}{}
2180 includes variables and parameters) or
2181 \livelink{chap:commonblockentry}{common blocks}
2183 \addtoindexx{location attribute}
2185 \DWATlocation{} attribute,
2186 \addtoindexx{location attribute}
2187 whose value is a location description
2188 (see Section \refersec{chap:locationdescriptions}).
2192 \addtoindex{DWARF procedure}
2193 is represented by any
2194 kind of debugging information entry that has
2195 \addtoindexx{location attribute}
2199 \addtoindexx{location attribute}
2200 If a suitable entry is not otherwise available,
2201 a DWARF procedure can be represented using a debugging
2202 \addtoindexx{DWARF procedure entry}
2203 information entry with the
2204 tag \DWTAGdwarfprocedureTARG{}
2206 \addtoindexx{location attribute}
2207 a \DWATlocation{} attribute.
2210 is called by a \DWOPcalltwo,
2213 DWARF expression operator
2214 (see Section \refersec{chap:controlflowoperations}).
2217 \section{Code Addresses and Ranges}
2218 \label{chap:codeaddressesandranges}
2219 Any debugging information entry describing an entity that has
2220 a machine code address or range of machine code addresses,
2221 which includes compilation units, module initialization,
2222 \hypertarget{chap:DWATrangesnoncontiguousrangeofcodeaddresses}{}
2223 subroutines, ordinary \nolink{blocks},
2224 try/catch \nolink{blocks} (see Section\refersec{chap:tryandcatchblockentries}),
2225 labels and the like, may have
2227 \item A \DWATlowpc{} attribute for
2228 \hypertarget{chap:DWATlowpccodeaddressorrangeofaddresses}{}
2231 \item A \DWATlowpc{}
2232 \addtoindexx{low PC attribute}
2235 \addtoindexx{high PC attribute}
2236 \hypertarget{chap:DWAThighpccontiguousrangeofcodeaddresses}{}
2237 pair of attributes for
2238 a single contiguous range of
2241 \item A \DWATranges{} attribute
2242 \addtoindexx{ranges attribute}
2243 for a non-contiguous range of addresses.
2246 In addition, a non-contiguous range of
2247 addresses may also be specified for the
2248 \DWATstartscope{} attribute.
2249 \addtoindexx{start scope attribute}
2251 If an entity has no associated machine code,
2252 none of these attributes are specified.
2254 \subsection{Single Address}
2255 When there is a single address associated with an entity,
2256 such as a label or alternate entry point of a subprogram,
2257 the entry has a \DWATlowpc{} attribute whose value is the
2258 relocated address for the entity.
2260 \textit{While the \DWATentrypc{}
2261 attribute might also seem appropriate for this purpose,
2262 historically the \DWATlowpc{} attribute was used before the
2263 \DWATentrypc{} was introduced
2264 (in \addtoindex{DWARF Version 3}). There is
2265 insufficient reason to change this.}
2268 \subsection{Continuous Address Range}
2269 \label{chap:contiguousaddressranges}
2270 When the set of addresses of a debugging information entry can
2271 be described as a single contiguous range, the entry
2272 \addtoindexx{high PC attribute}
2274 \addtoindexx{low PC attribute}
2277 \DWAThighpc{} pair of attributes.
2280 \DWATlowpc{} attribute
2281 is the relocated address of the
2282 first instruction associated with the entity. If the value of
2283 the \DWAThighpc{} is of class address, it is the relocated
2284 address of the first location past the last instruction
2285 associated with the entity; if it is of class constant, the
2286 value is an unsigned integer offset which when added to the
2287 low PC gives the address of the first location past the last
2288 instruction associated with the entity.
2290 \textit{The high PC value
2291 may be beyond the last valid instruction in the executable.}
2294 The presence of low and high PC attributes for an entity
2295 implies that the code generated for the entity is contiguous
2296 and exists totally within the boundaries specified by those
2297 two attributes. If that is not the case, no low and high PC
2298 attributes should be produced.
2300 \subsection{Non\dash Contiguous Address Ranges}
2301 \label{chap:noncontiguousaddressranges}
2302 When the set of addresses of a debugging information entry
2303 \addtoindexx{non-contiguous address ranges}
2304 cannot be described as a single contiguous range, the entry has
2305 a \DWATranges{} attribute
2306 \addtoindexx{ranges attribute}
2307 whose value is of class \livelink{chap:classrangelistptr}{rangelistptr}
2308 and indicates the beginning of a \addtoindex{range list}.
2310 a \DWATstartscope{} attribute
2311 \addtoindexx{start scope attribute}
2312 may have a value of class
2313 \livelink{chap:classrangelistptr}{rangelistptr} for the same reason.
2315 Range lists are contained in a separate object file section called
2316 \dotdebugranges{}. A
2317 \addtoindex{range list} is indicated by a
2318 \DWATranges{} attribute whose
2319 \addtoindexx{ranges attribute}
2320 value is represented as an offset from the beginning of the
2321 \dotdebugranges{} section to the beginning of the
2322 \addtoindex{range list}.
2324 If the current compilation unit contains a \DWATrangesbase{}
2325 attribute, the value of that attribute establishes a base
2326 offset within the \dotdebugranges{} section for the compilation
2327 unit. The offset given by the \DWATranges{} attribute is
2328 relative to that base.
2330 \textit{The \DWATrangesbase{} attribute is new in \addtoindex{DWARF Version 5}.
2331 The advantage of this attribute is that is reduces the number of
2332 object language relocations needed for references to the \dotdebugranges{}
2333 section from one for each reference to a single relocation that
2334 applies for the entire compilation unit.}
2336 Each entry in a \addtoindex{range list} is either a
2337 \addtoindex{range list} entry,
2338 \addtoindexx{base address selection entry!in range list}
2339 a base address selection entry, or an
2340 \addtoindexx{end of list entry!in range list}
2343 A \addtoindex{range list} entry consists of:
2344 \begin{enumerate}[1. ]
2345 \item A beginning address offset. This address offset has the
2346 \addtoindex{size of an address} and is relative to
2347 the applicable base address of the compilation unit referencing this
2348 \addtoindex{range list}.
2351 \addtoindexi{address}{address range!in range list}
2354 \item An ending address offset. This address offset again has the
2355 \addtoindex{size of an address} and is relative
2356 to the applicable base address of the compilation unit referencing
2357 this \addtoindex{range list}.
2359 first address past the end of the address range.
2360 The ending address must be greater than or
2361 equal to the beginning address.
2363 \textit{A \addtoindex{range list} entry (but not a base address selection or end of list entry) whose beginning and
2364 ending addresses are equal has no effect because the size of the range covered by such an
2368 The applicable base address of a \addtoindex{range list} entry
2370 by the closest preceding base address selection entry (see
2371 below) in the same range list. If there is no such selection
2372 entry, then the applicable base address defaults to the base
2373 address of the compilation unit
2374 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2376 \textit{In the case of a compilation unit where all of the machine
2377 code is contained in a single contiguous section, no base
2378 address selection entry is needed.}
2380 Address range entries in
2381 a \addtoindex{range list} may not overlap.
2382 There is no requirement that
2383 the entries be ordered in any particular way.
2386 A base address selection entry consists of:
2387 \begin{enumerate}[1. ]
2388 \item The value of the largest representable address offset (for example, \wffffffff when the size of
2389 an address is 32 bits).
2391 \item An address, which defines the appropriate base address for use in interpreting the beginning
2392 and ending address offsets of subsequent entries of the location list.
2394 \textit{A base address selection entry
2395 affects only the list in which it is contained.}
2398 The end of any given \addtoindex{range list} is marked by an
2399 \addtoindexx{end of list entry!in range list}
2401 which consists of a 0 for the beginning address
2402 offset and a 0 for the ending address offset.
2403 A \addtoindex{range list}
2404 containing only an end of list entry describes an empty scope
2405 (which contains no instructions).
2407 \textit{A base address selection entry and an
2408 \addtoindexx{end of list entry!in range list}
2409 end of list entry for
2410 a \addtoindex{range list}
2411 are identical to a base address selection entry
2412 and end of list entry, respectively, for a location list
2413 (see Section \refersec{chap:locationlists})
2414 in interpretation and representation.}
2418 \section{Entry Address}
2419 \label{chap:entryaddress}
2420 \textit{The entry or first executable instruction generated
2421 for an entity, if applicable, is often the lowest addressed
2422 instruction of a contiguous range of instructions. In other
2423 cases, the entry address needs to be specified explicitly.}
2425 Any debugging information entry describing an entity that has
2426 a range of code addresses, which includes compilation units,
2427 module initialization, subroutines,
2428 ordinary \livelink{chap:lexicalblock}{block},
2429 try/catch \nolink{blocks} (see Section
2430 \refersec{chap:tryandcatchblockentries}),
2431 and the like, may have a \DWATentrypcNAME{} attribute to
2432 indicate the first executable instruction within that range
2433 \hypertarget{chap:entryaddressofscope}{}
2434 of addresses. The value of the \DWATentrypcNAME{} attribute is a
2435 relocated address if the
2436 value of \DWATentrypcNAME{} is of class address; or if it is of class
2437 constant, the value is an unsigned integer offset which, when
2438 added to the base address of the function, gives the entry
2441 The base address of the containing scope is given by either the
2442 \DWATlowpc{} attribute, or the first range entry in the list of
2443 ranges given by the \DWATranges{} attribute.
2444 If no \DWATentrypcNAME{} attribute is present,
2445 then the entry address is assumed to be the same as the
2446 value of the \DWATlowpc{} attribute, if present; otherwise,
2447 the entry address is unknown.
2449 \section{Static and Dynamic Values of Attributes}
2450 \label{chap:staticanddynamicvaluesofattributes}
2452 Some attributes that apply to types specify a property (such
2453 as the lower bound of an array) that is an integer value,
2454 where the value may be known during compilation or may be
2455 computed dynamically during execution.
2458 attributes is determined based on the class as follows:
2460 \item For a \livelink{chap:classconstant}{constant}, the value of the constant is the value of
2463 \item For a \livelink{chap:classreference}{reference}, the
2464 value is a DWARF procedure that computes the value of the attribute.
2466 \item For an \livelink{chap:classexprloc}{exprloc}, the value is interpreted as a
2468 evaluation of the expression yields the value of
2473 Whether an attribute value can be dynamic depends on the
2474 rules of the applicable programming language.
2477 \textit{The applicable attributes include:
2489 (and possibly others).}
2492 \section{Entity Descriptions}
2493 \textit{Some debugging information entries may describe entities
2494 in the program that are artificial, or which otherwise are
2495 \doublequote{named} in ways which are not valid identifiers in the
2496 programming language. For example, several languages may
2497 capture or freeze the value of a variable at a particular
2498 point in the program.
2499 \addtoindex{Ada} 95 has package elaboration routines,
2500 type descriptions of the form typename\textquoteright Class, and
2501 \doublequote{access typename} parameters. }
2503 Generally, any debugging information
2505 \hypertarget{chap:DWATdescriptionartificialnameordescription}{}
2507 \addtoindexx{name attribute}
2509 \DWATname{} attribute, may
2511 \addtoindexx{description attribute}
2513 \DWATdescription{} attribute whose value is a
2514 null-terminated string providing a description of the entity.
2517 \textit{It is expected that a debugger will only display these
2518 descriptions as part of the description of other entities. It
2519 should not accept them in expressions, nor allow them to be
2520 assigned, or the like.}
2522 \section{Byte and Bit Sizes}
2523 \label{chap:byteandbitsizes}
2524 % Some trouble here with hbox full, so we try optional word breaks.
2525 Many debugging information entries allow either a
2526 \DWATbytesize{} attribute or a
2527 \DWATbitsize{} attribute,
2528 whose \livelink{chap:classconstant}{integer constant} value
2529 (see Section \ref{chap:staticanddynamicvaluesofattributes})
2531 amount of storage. The value of the
2532 \DWATbytesize{} attribute
2533 is interpreted in bytes and the value of the
2535 attribute is interpreted in bits. The
2536 \DWATstringlengthbytesize{} and
2537 \DWATstringlengthbitsize{}
2538 attributes are similar.
2540 In addition, the \livelink{chap:classconstant}{integer constant}
2541 value of a \DWATbytestride{} attribute is interpreted
2542 in bytes and the \livelink{chap:classconstant}{integer constant} value of a
2544 attribute is interpreted in bits.
2546 \section{Linkage Names}
2547 \label{chap:linkagenames}
2548 \textit{Some language implementations, notably
2549 \addtoindex{C++} and similar
2551 make use of implementation-defined names within
2552 object files that are different from the identifier names
2553 (see Section \refersec{chap:identifiernames}) of entities as they appear in the
2554 source. Such names, sometimes known
2555 \addtoindexx{names!mangled}
2557 \addtoindex{mangled names},
2558 are used in various ways, such as: to encode additional
2559 information about an entity, to distinguish multiple entities
2560 that have the same name, and so on. When an entity has an
2561 associated distinct linkage name it may sometimes be useful
2562 for a producer to include this name in the DWARF description
2563 of the program to facilitate consumer access to and use of
2564 object file information about an entity and/or information
2565 \hypertarget{chap:DWATlinkagenameobjectfilelinkagenameofanentity}{}
2566 that is encoded in the linkage name itself.
2569 % Some trouble maybe with hbox full, so we try optional word breaks.
2571 information entry may have
2572 \addtoindexx{linkage name attribute}
2576 whose value is a null-terminated string describing the object
2577 file linkage name associated with the corresponding entity.
2579 % Some trouble here with hbox full, so we try optional word breaks.
2580 \textit{Debugging information entries to which \DWATlinkagename{}
2581 may apply include: \DWTAGcommonblock, \DWTAGconstant,
2582 \DWTAGentrypoint, \DWTAGsubprogram{}
2586 \section{Template Parameters}
2587 \label{chap:templateparameters}
2589 In \addtoindex{C++}, a template is a generic definition of a class, function, member
2590 function, or typedef (alias). A template has formal parameters that
2591 can be types or constant values; the class, function,
2592 member function, or typedef is instantiated differently for each
2593 distinct combination of type or value actual parameters. DWARF does
2594 not represent the generic template definition, but does represent each
2598 A debugging information entry that represents a
2599 \addtoindex{template instantiation}
2600 will contain child entries describing the actual template parameters.
2601 The containing entry and each of its child entries reference a template
2602 parameter entry in any circumstance where the template definition
2603 referenced a formal template parameter.
2605 A template type parameter is represented by a debugging information
2607 \addtoindexx{template type parameter entry}
2608 \DWTAGtemplatetypeparameterTARG.
2609 A template value parameter is represented by a debugging information
2611 \addtoindexx{template value parameter entry}
2612 \DWTAGtemplatevalueparameterTARG.
2613 The actual template parameter entries appear in the same order as the
2614 corresponding template formal parameter declarations in the
2618 A type or value parameter entry may have a \DWATname{} attribute,
2619 \addtoindexx{name attribute}
2621 null\dash terminated string containing the name of the corresponding
2622 formal parameter as it appears in the source program.
2623 The entry may also have a
2624 \DWATdefaultvalue{} attribute, which is a flag indicating
2625 that the value corresponds to the default argument for the
2630 \addtoindexx{formal type parameter|see{template type parameter entry}}
2631 template type parameter entry has a
2632 \addtoindexx{type attribute}
2633 \DWATtype{} attribute
2634 describing the actual type by which the formal is replaced.
2637 A template value parameter entry has a \DWATtype{} attribute
2638 describing the type of the parameterized value.
2639 The entry also has an attribute giving the
2640 actual compile-time or run-time constant value
2641 of the value parameter for this instantiation.
2643 \DWATconstvalue{}\livetarg{chap:DWATconstvaluetemplatevalueparameter}{}
2645 value is the compile-time constant value as represented
2646 on the target architecture.
2647 Or, the attribute can be a \DWATlocation{} attribute, whose value is a
2648 single location description for the run-time constant address.