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,
39 \DWTAGcallsiteparameter,
44 \DWTAGcommoninclusion,
52 \DWTAGenumerationtype,
55 \DWTAGformalparameter,
57 \DWTAGgenericsubrange,
58 \DWTAGimporteddeclaration,
62 \DWTAGinlinedsubroutine,
74 \DWTAGptrtomembertype,
77 \DWTAGrvaluereferencetype,
86 \DWTAGtemplatetypeparameter,
87 \DWTAGtemplatevalueparameter,
93 \DWTAGunspecifiedparameters,
94 \DWTAGunspecifiedtype,
105 \textit{The debugging information entry descriptions
106 in Sections 3, 4 and 5 generally include mention of
107 most, but not necessarily all, of the attributes
108 that are normally or possibly used with the entry.
109 Some attributes, whose applicability tends to be
110 pervasive and invariant across many kinds of
111 debugging information entries, are described in
112 this section and not necessarily mentioned in all
113 contexts where they may be appropriate.
116 the \livelink{chap:declarationcoordinates}{declaration coordinates}, and
120 The debugging information entries are contained in the
121 \dotdebuginfo{} sections of an object file.
124 Optionally, debugging information may be partitioned such
125 that the majority of the debugging information can remain in
126 individual object files without being processed by the
127 linker. These debugging information entries are contained in
128 the \dotdebuginfodwo{} sections. These
129 sections may be placed in the object file but marked so that
130 the linker ignores them, or they may be placed in a separate
131 DWARF object file that resides alongside the normal object
132 file. See Section \refersec{datarep:splitdwarfobjects} and
133 Appendix \refersec{app:splitdwarfobjectsinformative} for details.
136 \section{Attribute Types}
137 \label{chap:attributetypes}
138 Each attribute value is characterized by an attribute name.
139 \addtoindexx{attribute duplication}
140 No more than one attribute with a given name may appear in any
141 debugging information entry.
142 There are no limitations on the
143 \addtoindexx{attribute ordering}
144 ordering of attributes within a debugging information entry.
146 The attributes are listed in Table \refersec{tab:attributenames}.
148 The permissible values
149 \addtoindexx{attribute value classes}
150 for an attribute belong to one or more classes of attribute
152 Each form class may be represented in one or more ways.
153 For example, some attribute values consist
154 of a single piece of constant data.
155 \doublequote{Constant data}
156 is the class of attribute value that those attributes may have.
157 There are several representations of constant data,
158 however (one, two, ,four, or eight bytes, and variable length
160 The particular representation for any given instance
161 of an attribute is encoded along with the attribute name as
162 part of the information that guides the interpretation of a
163 debugging information entry.
165 Attribute value forms belong
166 \addtoindexx{tag names!list of}
167 to one of the classes shown in Table \refersec{tab:classesofattributevalue}.
169 \setlength{\extrarowheight}{0.1cm}
170 \addtoindexx{attributes!list of}
171 \begin{longtable}{l|p{9cm}}
172 \caption{Attribute names} \label{tab:attributenames} \\
173 \hline \bfseries Attribute&\bfseries Identifies or Specifies \\ \hline
175 \bfseries Attribute&\bfseries Identifies or Specifies \\ \hline
177 \hline \emph{Continued on next page}
181 \DWATabstractoriginTARG
182 &\livelinki{chap:DWATabstractorigininlineinstance}{Inline instances of inline subprograms} {inline instances of inline subprograms} \\
183 % Heren livelink we cannot use \dash or \dash{}.
184 &\livelinki{chap:DWATabstractoriginoutoflineinstance}{Out-of-line instances of inline subprograms}{out-of-line instances of inline subprograms} \\
185 \DWATaccessibilityTARG
186 &\livelink{chap:DWATaccessibilitycandadadeclarations}{C++ and Ada declarations} \addtoindexx{Ada} \\
187 &\livelink{chap:DWATaccessibilitycppbaseclasses}{C++ base classes} \\
188 &\livelink{chap:DWATaccessibilitycppinheritedmembers}{C++ inherited members} \\
189 \DWATaddressclassTARG
190 &\livelinki{chap:DWATadressclasspointerorreferencetypes}{Pointer or reference types}{pointer or reference types} \\
191 &\livelinki{chap:DWATaddressclasssubroutineorsubroutinetype}{Subroutine or subroutine type}{subroutine or subroutine type} \\
193 &\livelinki{chap:DWATaddrbaseforaddresstable}{Base offset for address table}{address table} \\
195 &\livelinki{chap:DWATallocatedallocationstatusoftypes}{Allocation status of types}{allocation status of types} \\
197 &\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} \\
198 \DWATassociatedTARG{}
199 &\livelinki{chap:DWATassociatedassociationstatusoftypes}{Association status of types}{association status of types} \\
201 &\livelinki{chap:DWATbasetypesprimitivedatatypesofcompilationunit}{Primitive data types of compilation unit}{primitive data types of compilation unit} \\
202 \DWATbinaryscaleTARG{}
203 &\livelinki{chap:DWATbinaryscalebinaryscalefactorforfixedpointtype}{Binary scale factor for fixed-point type}{binary scale factor for fixed-point type} \\
205 &\livelinki{chap:DWATbitoffsetbasetypebitlocation}{Base type bit location}{base type bit location} \\
206 &\livelinki{chap:DWATbitoffsetdatamemberbitlocation}{Data member bit location}{data member bit location} \\
208 &\livelinki{chap:DWATbitsizebasetypebitsize}{Base type bit size}{base type bit size} \\
209 &\livelinki{chap:DWATbitsizedatamemberbitsize}{Data member bit size}{data member bit size} \\
211 &\livelinki{chap:DWATbitstridearrayelementstrideofarraytype}{Array element stride (of array type)}{array element stride (of array type)} \\
212 &\livelinki{chap:DWATbitstridesubrangestridedimensionofarraytype}{Subrange stride (dimension of array type)}{subrange stride (dimension of array type)} \\
213 &\livelinki{chap:DWATbitstrideenumerationstridedimensionofarraytype}{Enumeration stride (dimension of array type)}{enumeration stride (dimension of array type)} \\
215 &\livelinki{chap:DWATbytesizedataobjectordatatypesize}{Data object or data type size}{data object or data type size} \\
216 \DWATbytestrideTARG{}
217 &\livelinki{chap:DWATbytestridearrayelementstrideofarraytype}{Array element stride (of array type)}{array element stride (of array type)} \\
218 &\livelinki{chap:DWATbytestridesubrangestridedimensionofarraytype}{Subrange stride (dimension of array type)}{subrange stride (dimension of array type)} \\
219 &\livelinki{chap:DWATbytestrideenumerationstridedimensionofarraytype}
220 {Enumeration stride (dimension of array type)}
221 {enumeration stride (dimension of array type)} \\
222 \DWATcallallcallsTARG{}
223 &\livelinki{chap:DWATcallallcallsofasubprogram}
224 {All tail and normal calls in a subprogram are described by call site entries}
225 {all tail and normal calls in a subprogram are described by call site entries}
226 \index{call site!summary!all tail and normal calls are described} \\
227 \DWATcallallsourcecallsTARG{}
228 &\livelinki{chap:DWATcallallaourcecallsofa subprogram}
229 {All tail, normal and inlined calls in a subprogram are described by call site and inlined subprogram entries}
230 {all tail calls in a subprogram are described by call site and inlined subprogram entries}
231 \index{call site!summary!all tail, normal and inlined calls are described} \\
232 \DWATcallalltailcallsTARG{}
233 &\livelinki{chap:DWATcallalltailcallsofasubprogram}
234 {All tail calls in a subprogram are described by call site entries}
235 {all tail calls in a subprogram are described by call site entries}
236 \index{call site!summary!all tail calls are described} \\
237 \DWATcallcolumnTARG{}
238 &\livelinki{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}
239 {Column position of inlined subroutine call}
240 {column position of inlined subroutine call} \\
241 \DWATcalldatalocationTARG{}
242 &\livelinki{chap:DWATcalldatalocationofcallsite}
243 {Address of the value pointed to by an argument passed in a call}
244 {address of the value pointed to by an argument passed in a call}
245 \index{call site!address of the value pointed to by an argument} \\
246 \DWATcalldatavalueTARG{}
247 &\livelinki{chap:DWATcalldatavalueofcallsite}
248 {Value pointed to by an argument passed in a call}
249 {value pointed to by an argument passed in a call}
250 \index{call site!value pointed to by an argument} \\
252 &\livelinki{chap:DWATcallfilefilecontaininginlinedsubroutinecall}
253 {File containing inlined subroutine call}
254 {file containing inlined subroutine call} \\
256 &\livelinki{chap:DWATcalllinelinenumberofinlinedsubroutinecall}
257 {Line number of inlined subroutine call}
258 {line number of inlined subroutine call} \\
259 \DWATcallingconventionTARG{}
260 &\livelinki{chap:DWATcallingconventionsubprogramcallingconvention}
261 {Subprogram calling convention}
262 {subprogram calling convention} \\
263 \DWATcalloriginTARG{}
264 &\livelinki{chap:DWATcalloriginofcallsite}
265 {Subprogram called in a call}
266 {subprogram called in a call}
267 \index{call site!subprogram called} \\
268 \DWATcallparameterTARG{}
269 &\livelinki{chap:DWATcallparameterofcallsite}
270 {Parameter entry in a call}
271 {parameter entry in a call}
272 \index{call site!parameter entry} \\
274 &\livelinki{chap:DWATcallpcofcallsite}
275 {Address of the call instruction in a call}
276 {address of the call instruction in a call}
277 \index{call site!address of the call instruction} \\
278 \DWATcallreturnpcTARG{}
279 &\livelinki{chap:DWATcallreturnpcofcallsite}
280 {Return address from a call}
281 {return address from a call}
282 \index{call site!return address} \\
283 \DWATcalltailcallTARG{}
284 &\livelinki{chap:DWATcalltailcallofcallsite}
285 {Call is a tail call}
286 {call is a tail call}
287 \index{call site!tail call} \\
288 \DWATcalltargetTARG{}
289 &\livelinki{chap:DWATcalltargetofcallsite}
290 {Address of called routine in a call}
291 {address of called routine in a call}
292 \index{call site!address of called routine} \\
293 \DWATcalltargetclobberedTARG{}
294 &\livelinki{chap:DWATcalltargetclobberedofcallsite}
295 {Address of called routine, which may be clobbered, in a call}
296 {address of called routine, which may be clobbered, in a call}
297 \index{call site!address of called routine, which may be clobbered} \\
299 &\livelinki{chap:DWATcallvalueofcallsite}
300 {Argument value passed in a call}
301 {argument value passed in a call}
302 \index{call site!argument value passed} \\
303 \DWATcommonreferenceTARG
304 &\livelinki{chap:commonreferencecommonblockusage}{Common block usage}{common block usage} \\
306 &\livelinki{chap:DWATcompdircompilationdirectory}{Compilation directory}{compilation directory} \\
308 &\livelinki{chap:DWATconstvalueconstantobject}{Constant object}{constant object} \\
309 &\livelinki{chap:DWATconstvalueenumerationliteralvalue}{Enumeration literal value}{enumeration literal value} \\
310 &\livelinki{chap:DWATconstvaluetemplatevalueparameter}{Template value parameter}{template value parameter} \\
312 &\livelinki{chap:DWATconstexprcompiletimeconstantobject}{Compile-time constant object}{compile-time constant object} \\
313 &\livelinki{chap:DWATconstexprcompiletimeconstantfunction}{Compile-time constant function}{compile-time constant function} \\
314 \DWATcontainingtypeTARG
315 &\livelinki{chap:DWATcontainingtypecontainingtypeofpointertomembertype}{Containing type of pointer to member type}{containing type of pointer to member type} \\
317 &\livelinki{chap:DWATcountelementsofsubrangetype}{Elements of subrange type}{elements ofbreg subrange type} \\
318 \DWATdatabitoffsetTARG
319 &\livelinki{chap:DWATdatabitoffsetbasetypebitlocation}{Base type bit location}{base type bit location} \\
320 &\livelinki{chap:DWATdatabitoffsetdatamemberbitlocation}{Data member bit location}{data member bit location} \\
321 \DWATdatalocationTARG{}
322 &\livelinki{chap:DWATdatalocationindirectiontoactualdata}{Indirection to actual data}{indirection to actual data} \\
323 \DWATdatamemberlocationTARG
324 &\livelinki{chap:DWATdatamemberlocationdatamemberlocation}{Data member location}{data member location} \\
325 &\livelinki{chap:DWATdatamemberlocationinheritedmemberlocation}{Inherited member location}{inherited member location} \\
326 \DWATdecimalscaleTARG
327 &\livelinki{chap:DWATdecimalscaledecimalscalefactor}{Decimal scale factor}{decimal scale factor} \\
329 &\livelinki{chap:DWATdecimalsigndecimalsignrepresentation}{Decimal sign representation}{decimal sign representation} \\
331 &\livelinki{chap:DWATdeclcolumncolumnpositionofsourcedeclaration}{Column position of source declaration}{column position of source declaration} \\
333 &\livelinki{chap:DWATdeclfilefilecontainingsourcedeclaration}{File containing source declaration}{file containing source declaration} \\
335 &\livelinki{chap:DWATdecllinelinenumberofsourcedeclaration}{Line number of source declaration}{line number of source declaration} \\
337 &\livelinki{chap:DWATdeclarationincompletenondefiningorseparateentitydeclaration}{Incomplete, non-defining, or separate entity declaration}{incomplete, non-defining, or separate entity declaration} \\
338 \DWATdefaultvalueTARG
339 &\livelinki{chap:DWATdefaultvaluedefaultvalueofparameter}{Default value of parameter}{default value of parameter} \\
340 \DWATdescriptionTARG{}
341 &\livelinki{chap:DWATdescriptionartificialnameordescription}{Artificial name or description}{artificial name or description} \\
343 &\livelinki{chap:DWATdigitcountdigitcountforpackeddecimalornumericstringtype}{Digit count for packed decimal or numeric string type}{digit count for packed decimal or numeric string type} \\
345 &\livelinki{chap:DWATdiscrdiscriminantofvariantpart}{Discriminant of variant part}{discriminant of variant part} \\
347 &\livelinki{chap:DWATdiscrlistlistofdiscriminantvalues}{List of discriminant values}{list of discriminant values} \\
349 &\livelinki{chap:DWATdiscrvaluediscriminantvalue}{Discriminant value}{discriminant value} \\
351 &\livelinki{chap:DWATdwoidforunit}{Signature for compilation unit}{split DWARF object file!unit signature} \\
353 &\livelinki{chap:DWATdwonameforunit}{Name of split DWARF object file}{split DWARF object file!object file name} \\
355 &\livelinki{chap:DWATelementalelementalpropertyofasubroutine}{Elemental property of a subroutine}{elemental property of a subroutine} \\
357 &\livelinki{chap:DWATencodingencodingofbasetype}{Encoding of base type}{encoding of base type} \\
359 &\livelinki{chap:DWATendianityendianityofdata}{Endianity of data}{endianity of data} \\
361 &\livelinki{chap:entryaddressofscope}{Entry address of a scope (compilation unit, \mbox{subprogram,} and so on)}{} \\
363 &\livelinki{chap:DWATenumclasstypesafeenumerationdefinition}{Type safe enumeration definition}{type safe enumeration definition}\\
365 &\livelinki{chap:DWATexplicitexplicitpropertyofmemberfunction}{Explicit property of member function}{explicit property of member function}\\
367 &\livelinki{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}{Previous namespace extension or original namespace}{previous namespace extension or original namespace}\\
369 &\livelinki{chap:DWATexternalexternalsubroutine}{External subroutine}{external subroutine} \\
370 &\livelinki{chap:DWATexternalexternalvariable}{External variable}{external variable} \\
372 &\livelinki{chap:DWATframebasesubroutineframebaseaddress}{Subroutine frame base address}{subroutine frame base address} \\
374 &\livelinki{chap:DWATfriendfriendrelationship}{Friend relationship}{friend relationship} \\
376 &\livelinki{chap:DWAThighpccontiguousrangeofcodeaddresses}{Contiguous range of code addresses}{contiguous range of code addresses} \\
377 \DWATidentifiercaseTARG
378 &\livelinki{chap:DWATidentifiercaseidentifiercaserule}{Identifier case rule}{identifier case rule} \\
380 &\livelinki{chap:DWATimportimporteddeclaration}{Imported declaration}{imported declaration} \\
381 &\livelinki{chap:DWATimportimportedunit}{Imported unit}{imported unit} \\
382 &\livelinki{chap:DWATimportnamespacealias}{Namespace alias}{namespace alias} \\
383 &\livelinki{chap:DWATimportnamespaceusingdeclaration}{Namespace using declaration}{namespace using declaration} \\
384 &\livelinki{chap:DWATimportnamespaceusingdirective}{Namespace using directive}{namespace using directive} \\
386 &\livelinki{chap:DWATinlineabstracttinstance}{Abstract instance}{abstract instance} \\
387 &\livelinki{chap:DWATinlineinlinedsubroutine}{Inlined subroutine}{inlined subroutine} \\
389 &\livelinki{chap:DWATisoptionaloptionalparameter}{Optional parameter}{optional parameter} \\
391 &\livelinki{chap:DWATlanguageprogramminglanguage}{Programming language}{programming language} \\
393 &\livelinki{chap:DWATlinkagenameobjectfilelinkagenameofanentity}{Object file linkage name of an entity}{object file linkage name of an entity}\\
395 &\livelinki{chap:DWATlocationdataobjectlocation}{Data object location}{data object location}\\
397 &\livelinki{chap:DWATlowpccodeaddressorrangeofaddresses}{Code address or range of addresses}{code address or range of addresses}\\
399 &\livelinki{chap:DWATlowerboundlowerboundofsubrange}{Lower bound of subrange}{lower bound of subrange} \\
401 &\livelinki{chap:DWATmacroinfomacroinformation}{Macro information (for pre-\DWARFVersionV{} compatibility)} {macro information (legacy)} \\
403 &\livelinki{chap:DWATmacrosmacroinformation}{Macro information} {macro information} (\texttt{\#define}, \texttt{\#undef}, and so on)\\
404 \DWATmainsubprogramTARG
405 &\livelinki{chap:DWATmainsubprogrammainorstartingsubprogram}{Main or starting subprogram}{main or starting subprogram} \\
406 &\livelinki{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}{Unit containing main or starting subprogram}{unit containing main or starting subprogram}\\
408 &\livelinki{chap:DWATmutablemutablepropertyofmemberdata}{Mutable property of member data}{mutable property of member data} \\
410 &\livelinki{chap:DWATnamenameofdeclaration}{Name of declaration}{name of declaration}\\
411 &\livelinki{chap:DWATnamepathnameofcompilationsource}{Path name of compilation source}{path name of compilation source} \\
412 \DWATnamelistitemTARG
413 &\livelinki{chap:DWATnamelistitemnamelistitem}{Namelist item}{namelist item}\\
414 \DWATobjectpointerTARG
415 &\livelinki{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}{Object (\texttt{this}, \texttt{self}) pointer of member function}{object (\texttt{this}, \texttt{self}) pointer of member function}\\
417 &\livelinki{chap:DWATorderingarrayrowcolumnordering}{Array row/column ordering} {array row/column ordering}\\
418 \DWATpicturestringTARG
419 &\livelinki{chap:DWATpicturestringpicturestringfornumericstringtype}{Picture string for numeric string type}{picture string for numeric string type} \\
421 &\livelinki{chap:DWATprioritymodulepriority}{Module priority}{module priority}\\
423 &\livelinki{chap:DWATproducercompileridentification}{Compiler identification}{compiler identification}\\
425 &\livelinki{chap:DWATprototypedsubroutineprototype}{Subroutine prototype}{subroutine prototype}\\
427 &\livelinki{chap:DWATpurepurepropertyofasubroutine}{Pure property of a subroutine}{pure property of a subroutine} \\
429 &\livelinki{chap:DWATrangesnoncontiguousrangeofcodeaddresses}{Non-contiguous range of code addresses}{non-contiguous range of code addresses} \\
431 &\livelinki{chap:DWATrangesbaseforrangelists}{Base offset for range lists}{Ranges lists} \\
433 &\livelinki{chap:DWATrankofdynamicarray}{Dynamic number of array dimensions}{dynamic number of array dimensions} \\
435 &\livelinki{chap:DWATrecursiverecursivepropertyofasubroutine}{Recursive property of a subroutine}{recursive property of a subroutine} \\
437 &\livelink{chap:DWATreferenceofnonstaticmember}{\&-qualified non-static member function} \\
439 &\livelinki{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}{Subroutine return address save location}{subroutine return address save location} \\
440 \DWATrvaluereferenceTARG
441 &\livelink{chap:DWATrvaluereferenceofnonstaticmember}{\&\&-qualified non-static member function} \\
444 &\livelinki{chap:DWATsegmentaddressinginformation}{Addressing information}{addressing information} \\
446 &\livelinki{chap:DWATsiblingdebugginginformationentryrelationship}{Debugging information entry relationship}{debugging information entry relationship} \\
448 &\livelinki{chap:DWATsmallscalefactorforfixedpointtype}{Scale factor for fixed-point type}{scale factor for fixed-point type} \\
450 &\livelinki{chap:DWATsignaturetypesignature}{Type signature}{type signature}\\
451 \DWATspecificationTARG
452 &\livelinki{chap:DWATspecificationincompletenondefiningorseparatedeclaration}{Incomplete, non-defining, or separate declaration corresponding to a declaration}{incomplete, non-defining, or separate declaration corresponding to a declaration} \\
454 &\livelinki{chap:DWATstartscopeobjectdeclaration}{Object declaration}{object declaration}\\
455 &\livelinki{chap:DWATstartscopetypedeclaration}{Type declaration}{type declaration}\\
457 &\livelinki{chap:DWATstaticlinklocationofuplevelframe}{Location of uplevel frame}{location of uplevel frame} \\
459 &\livelinki{chap:DWATstmtlistlinenumberinformationforunit}{Line number information for unit}{line number information for unit}\\
460 \DWATstringlengthTARG
461 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}{String length of string type}{string length of string type}
463 \DWATstringlengthbitsizeTARG
464 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}{Size of string length of string type}{string length of string type!size of}
466 \DWATstringlengthbytesizeTARG
467 &\livelinki{chap:DWATstringlengthstringlengthofstringtype}{Size of string length of string type}{string length of string type!size of}
469 \DWATstroffsetsbaseTARG
470 &\livelinki{chap:DWATstroffsetbaseforindirectstringtable}{Base of string offsets table}{string offsets table} \\
471 \DWATthreadsscaledTARG
472 &\livelink{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}{UPC array bound THREADS scale factor}\\
474 &\livelinki{chap:DWATtrampolinetargetsubroutine}{Target subroutine}{target subroutine of trampoline} \\
476 &\livelinki{chap:DWATtypetypeofdeclaration}{Type of declaration}{type of declaration} \\
477 &\livelinki{chap:DWATtypetypeofsubroutinereturn}{Type of subroutine return}{type of subroutine return} \\
479 &\livelinki{chap:DWATupperboundupperboundofsubrange}{Upper bound of subrange}{upper bound of subrange} \\
481 &\livelinki{chap:DWATuselocationmemberlocationforpointertomembertype}{Member location for pointer to member type}{member location for pointer to member type} \\
482 \DWATuseUTFeightTARG\addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
483 &\livelinki{chap:DWATuseUTF8compilationunitusesutf8strings}{Compilation unit uses UTF-8 strings}{compilation unit uses UTF-8 strings} \\
484 \DWATvariableparameterTARG
485 &\livelinki{chap:DWATvariableparameternonconstantparameterflag}{Non-constant parameter flag}{non-constant parameter flag} \\
487 &\livelinki{chap:DWATvirtualityvirtualityindication}{Virtuality indication}{virtuality indication} \\
488 &\livelinki{chap:DWATvirtualityvirtualityofbaseclass}{Virtuality of base class} {virtuality of base class} \\
489 &\livelinki{chap:DWATvirtualityvirtualityoffunction}{Virtuality of function}{virtuality of function} \\
491 &\livelinki{chap:DWATvisibilityvisibilityofdeclaration}{Visibility of declaration}{visibility of declaration} \\
492 \DWATvtableelemlocationTARG
493 &\livelinki{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}{Virtual function vtable slot}{virtual function vtable slot}\\
496 \addtoindexx{address|see {\textit{also} address class}}
497 \addtoindexx{addrptr|see {\textit{also} addrptr class}}
498 \addtoindexx{block|see {\textit{also} block class}}
499 \addtoindexx{constant|see {\textit{also} constant class}}
500 \addtoindexx{exprloc|see {\textit{also} exprloc class}}
501 \addtoindexx{flag|see {\textit{also} flag class}}
502 \addtoindexx{lineptr|see {\textit{also} lineptr class}}
503 \addtoindexx{loclistptr|see {\textit{also} loclistptr class}}
504 \addtoindexx{macptr|see {\textit{also} macptr class}}
505 \addtoindexx{rangelistptr|see {\textit{also} rangelistptr class}}
506 \addtoindexx{reference|see {\textit{also} reference class}}
507 \addtoindexx{string|see {\textit{also} string class}}
508 \addtoindexx{stroffsetsptr|see {\textit{also} stroffsetsptr class}}
510 \addtoindexx{class of attribute value!address|see {address class}}
511 \addtoindexx{class of attribute value!addrptr|see {addrptr class}}
512 \addtoindexx{class of attribute value!block|see {block class}}
513 \addtoindexx{class of attribute value!constant|see {constant class}}
514 \addtoindexx{class of attribute value!exprloc|see {exprloc class}}
515 \addtoindexx{class of attribute value!flag|see {flag class}}
516 \addtoindexx{class of attribute value!lineptr|see {lineptr class}}
517 \addtoindexx{class of attribute value!loclistptr|see {loclistptr class}}
518 \addtoindexx{class of attribute value!macptr|see {macptr class}}
519 \addtoindexx{class of attribute value!rangelistptr|see {rangelistptr class}}
520 \addtoindexx{class of attribute value!reference|see {reference class}}
521 \addtoindexx{class of attribute value!string|see {string class}}
522 \addtoindexx{class of attribute value!stroffsetsptr|see {stroffsetsptr class}}
525 \begin{longtable}{l|p{11cm}}
526 \caption{Classes of attribute value}
527 \label{tab:classesofattributevalue} \\
528 \hline \bfseries Attribute Class & \bfseries General Use and Encoding \\ \hline
530 \bfseries Attribute Class & \bfseries General Use and Encoding \\ \hline
532 \hline \emph{Continued on next page}
537 \hypertarget{chap:classaddress}{}
538 \livelinki{datarep:classaddress}{address}{address class}
539 &Refers to some location in the address space of the described program.
542 \hypertarget{chap:classaddrptr}{}
543 \livelinki{datarep:classaddrptr}{addrptr}{addrptr class}
544 &Refers to a base location in the DWARF section that holds
545 a series of machine address values. Certain attributes refer
546 one of these addresses by indexing relative to this base
550 \hypertarget{chap:classblock}{}
551 \livelinki{datarep:classblock}{block}{block class}
552 & An arbitrary number of uninterpreted bytes of data.
555 \hypertarget{chap:classconstant}{}
556 \livelinki{datarep:classconstant}{constant}{constant class}
557 &One, two, four or eight bytes of uninterpreted data, or data
558 encoded in the variable length format known as LEB128
559 (see Section \refersec{datarep:variablelengthdata}).
561 \textit{Most constant values are integers of one kind or
562 another (codes, offsets, counts, and so on); these are
563 sometimes called \doublequote{integer constants} for emphasis.}
564 \addtoindexx{integer constant}
565 \addtoindexx{constant class!integer}
568 \hypertarget{chap:classexprloc}{}
569 \livelinki{datarep:classexprloc}{exprloc}{exprloc class}
570 &A DWARF expression or location description.
573 \hypertarget{chap:classflag}{}
574 \livelinki{datarep:classflag}{flag}{flag class}
575 &A small constant that indicates the presence or absence of an attribute.
578 \hypertarget{chap:classlineptr}{}
579 \livelinki{datarep:classlineptr}{lineptr}{lineptr class}
580 &Refers to a location in the DWARF section that holds line number information.
583 \hypertarget{chap:classloclistptr}{}
584 \livelinki{datarep:classloclistptr}{loclistptr}{loclistptr class}
585 &Refers to a location in the DWARF section that holds location lists, which
586 describe objects whose location can change during their lifetime.
589 \hypertarget{chap:classmacptr}{}
590 \livelinki{datarep:classmacptr}{macptr}{macptr class}
591 & Refers to a location in the DWARF section that holds macro definition
595 \hypertarget{chap:classrangelistptr}{}
596 \livelinki{datarep:classrangelistptr}{rangelistptr}{rangelistptr class}
597 & Refers to a location in the DWARF section that holds non\dash contiguous address ranges.
600 \hypertarget{chap:classreference}{}
601 \livelinki{datarep:classreference}{reference}{reference class}
602 & Refers to one of the debugging information
603 entries that describe the program. There are three types of
604 reference. The first is an offset relative to the beginning
605 of the compilation unit in which the reference occurs and must
606 refer to an entry within that same compilation unit. The second
607 type of reference is the offset of a debugging information
608 entry in any compilation unit, including one different from
609 the unit containing the reference. The third type of reference
610 is an indirect reference to a
611 \addtoindexx{type signature}
612 type definition using a 64\dash bit signature
616 \hypertarget{chap:classstring}{}
617 \livelinki{datarep:classstring}{string}{string class}
618 & A null\dash terminated sequence of zero or more
619 (non\dash null) bytes. Data in this class are generally
620 printable strings. Strings may be represented directly in
621 the debugging information entry or as an offset in a separate
625 \hypertarget{chap:classstroffsetsptr}{}
626 \livelinki{datarep:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class}
627 &Refers to a base location in the DWARF section that holds
628 a series of offsets in the DWARF section that holds strings.
629 Certain attributes refer one of these offets by indexing
630 relative to this base location. The resulting offset is then
631 used to index into the DWARF string section.
638 \section{Relationship of Debugging Information Entries}
639 \label{chap:relationshipofdebugginginformationentries}
641 A variety of needs can be met by permitting a single
642 \addtoindexx{debugging information entry!ownership relation}
643 debugging information entry to \doublequote{own} an arbitrary number
644 of other debugging entries and by permitting the same debugging
645 information entry to be one of many owned by another debugging
647 This makes it possible, for example, to
648 describe the static \livelink{chap:lexicalblock}{block} structure
649 within a source file,
650 to show the members of a structure, union, or class, and to
651 associate declarations with source files or source files
656 The ownership relation
657 \addtoindexx{debugging information entry!ownership relation}
659 information entries is achieved naturally because the debugging
660 information is represented as a tree.
661 The nodes of the tree
662 are the debugging information entries themselves.
664 entries of any node are exactly those debugging information
665 entries owned by that node.
668 While the ownership relation
669 of the debugging information entries is represented as a
670 tree, other relations among the entries exist, for example,
671 a reference from an entry representing a variable to another
672 entry representing the type of that variable.
674 relations are taken into account, the debugging entries
675 form a graph, not a tree.
679 The tree itself is represented
680 by flattening it in prefix order.
681 Each debugging information
682 entry is defined either to have child entries or not to have
683 child entries (see Section \refersec{datarep:abbreviationstables}).
684 If an entry is defined not
685 to have children, the next physically succeeding entry is a
687 If an entry is defined to have children, the next
688 physically succeeding entry is its first child.
690 children are represented as siblings of the first child.
691 A chain of sibling entries is terminated by a null entry.
693 In cases where a producer of debugging information feels that
694 \hypertarget{chap:DWATsiblingdebugginginformationentryrelationship}{}
695 it will be important for consumers of that information to
696 quickly scan chains of sibling entries, while ignoring the
697 children of individual siblings, that producer may attach
698 \addtoindexx{sibling attribute}
700 \DWATsibling{} attribute
701 to any debugging information entry.
703 value of this attribute is a reference to the sibling entry
704 of the entry to which the attribute is attached.
707 \section{Target Addresses}
708 \label{chap:targetaddresses}
709 Many places in this document
711 \addtoindexx{address size|see{size of an address}}
714 \addtoindexi{address}{size of an address}
715 on the target architecture (or equivalently, target machine)
716 to which a DWARF description applies. For processors which
717 can be configured to have different address sizes or different
718 instruction sets, the intent is to refer to the configuration
719 which is either the default for that processor or which is
720 specified by the object file or executable file which contains
721 the DWARF information.
724 For example, if a particular target architecture supports
725 both 32\dash bit and 64\dash bit addresses, the compiler will generate
726 an object file which specifies that it contains executable
727 code generated for one or the other of these
728 \addtoindexx{size of an address}
730 that case, the DWARF debugging information contained in this
731 object file will use the same address size.
735 Architectures which have multiple instruction sets are
736 supported by the isa entry in the line number information
737 (see Section \refersec{chap:statemachineregisters}).
740 \section{DWARF Expressions}
741 \label{chap:dwarfexpressions}
742 DWARF expressions describe how to compute a value or name a
743 location during debugging of a program.
744 They are expressed in
745 terms of DWARF operations that operate on a stack of values.
747 All DWARF operations are encoded as a stream of opcodes that
748 are each followed by zero or more literal operands.
750 of operands is determined by the opcode.
753 general operations that are defined here, operations that are
754 specific to location descriptions are defined in
755 Section \refersec{chap:locationdescriptions}.
757 \subsection{General Operations}
758 \label{chap:generaloperations}
759 Each general operation represents a postfix operation on
760 a simple stack machine. Each element of the stack is the
761 \addtoindex{size of an address} on the target machine.
763 top of the stack after \doublequote{executing} the
764 \addtoindex{DWARF expression}
766 \addtoindexx{DWARF expression|see{location description}}
767 taken to be the result (the address of the object, the
768 value of the array bound, the length of a dynamic string,
769 the desired value itself, and so on).
771 \subsubsection{Literal Encodings}
772 \label{chap:literalencodings}
774 \addtoindexx{DWARF expression!literal encodings}
775 following operations all push a value onto the DWARF
777 \addtoindexx{DWARF expression!stack operations}
778 If the value of a constant in one of these operations
779 is larger than can be stored in a single stack element, the
780 value is truncated to the element size and the low\dash order bits
781 are pushed on the stack.
782 \begin{enumerate}[1. ]
783 \itembfnl{\DWOPlitzeroTARG, \DWOPlitoneTARG, \dots, \DWOPlitthirtyoneTARG}
784 The \DWOPlitnTARG{} operations encode the unsigned literal values
785 from 0 through 31, inclusive.
787 \itembfnl{\DWOPaddrTARG}
788 The \DWOPaddrNAME{} operation has a single operand that encodes
789 a machine address and whose size is the \addtoindex{size of an address}
790 on the target machine.
792 \itembfnl{\DWOPconstoneuTARG, \DWOPconsttwouTARG, \DWOPconstfouruTARG, \DWOPconsteightuTARG}
794 The single operand of a \DWOPconstnuNAME{} operation provides a 1,
795 2, 4, or 8\dash byte unsigned integer constant, respectively.
797 \itembfnl{\DWOPconstonesTARG, \DWOPconsttwosTARG, \DWOPconstfoursTARG, \DWOPconsteightsTARG}
798 The single operand of a \DWOPconstnsNAME{} operation provides a 1,
799 2, 4, or 8\dash byte signed integer constant, respectively.
801 \itembfnl{\DWOPconstuTARG}
802 The single operand of the \DWOPconstuNAME{} operation provides
803 an unsigned LEB128\addtoindexx{LEB128!unsigned} integer constant.
805 \itembfnl{\DWOPconstsTARG}
806 The single operand of the \DWOPconstsNAME{} operation provides
807 a signed LEB128\addtoindexx{LEB128!unsigned} integer constant.
810 \itembfnl{\DWOPaddrxTARG}
811 The \DWOPaddrxNAME{} operation has a single operand that
812 encodes an unsigned LEB128\addtoindexx{LEB128!unsigned} value,
813 which is a zero-based index into the \dotdebugaddr{} section,
814 where a machine address is stored.
815 This index is relative to the value of the
816 \DWATaddrbase{} attribute of the associated compilation unit.
818 \itembfnl{\DWOPconstxTARG}
819 The \DWOPconstxNAME{} operation has a single operand that
820 encodes an unsigned LEB128\addtoindexx{LEB128!unsigned} value,
821 which is a zero-based
822 index into the \dotdebugaddr{} section, where a constant, the
823 size of a machine address, is stored.
824 This index is relative to the value of the
825 \DWATaddrbase{} attribute of the associated compilation unit.
827 \textit{The \DWOPconstxNAME{} operation is provided for constants that
828 require link-time relocation but should not be
829 interpreted by the consumer as a relocatable address
830 (for example, offsets to thread-local storage).}
835 \subsubsection{Register Based Addressing}
836 \label{chap:registerbasedaddressing}
837 The following operations push a value onto the stack that is
838 \addtoindexx{DWARF expression!register based addressing}
839 the result of adding the contents of a register to a given
841 \begin{enumerate}[1. ]
842 \itembfnl{\DWOPfbregTARG}
843 The \DWOPfbregTARG{} operation provides a
844 signed LEB128\addtoindexx{LEB128!signed} offset
845 from the address specified by the location description in the
846 \DWATframebase{} attribute of the current function. (This
847 is typically a \doublequote{stack pointer} register plus or minus
848 some offset. On more sophisticated systems it might be a
849 location list that adjusts the offset according to changes
850 in the stack pointer as the PC changes.)
852 \itembfnl{\DWOPbregzeroTARG, \DWOPbregoneTARG, \dots, \DWOPbregthirtyoneTARG}
853 The single operand of the \DWOPbregnTARG{}
855 a signed LEB128\addtoindexx{LEB128!signed} offset from
856 the specified register.
858 \itembfnl{\DWOPbregxTARG{} }
859 The \DWOPbregxINDX{} operation has two operands: a register
860 which is specified by an unsigned LEB128\addtoindexx{LEB128!unsigned}
861 number, followed by a signed LEB128\addtoindexx{LEB128!signed} offset.
866 \subsubsection{Stack Operations}
867 \label{chap:stackoperations}
869 \addtoindexx{DWARF expression!stack operations}
870 operations manipulate the DWARF stack. Operations
871 that index the stack assume that the top of the stack (most
872 recently added entry) has index 0.
873 \begin{enumerate}[1. ]
874 \itembfnl{\DWOPdupTARG}
875 The \DWOPdupTARG{} operation duplicates the value at the top of the stack.
877 \itembfnl{\DWOPdropTARG}
878 The \DWOPdropTARG{} operation pops the value at the top of the stack.
880 \itembfnl{\DWOPpickTARG}
881 The single operand of the \DWOPpickTARG{} operation provides a
882 1\dash byte index. A copy of the stack entry with the specified
883 index (0 through 255, inclusive) is pushed onto the stack.
885 \itembfnl{\DWOPoverTARG}
886 The \DWOPoverTARG{} operation duplicates the entry currently second
887 in the stack at the top of the stack.
888 This is equivalent to
889 a \DWOPpick{} operation, with index 1.
891 \itembfnl{\DWOPswapTARG}
892 The \DWOPswapTARG{} operation swaps the top two stack entries.
893 The entry at the top of the
894 stack becomes the second stack entry,
895 and the second entry becomes the top of the stack.
897 \itembfnl{\DWOProtTARG}
898 The \DWOProtTARG{} operation rotates the first three stack
899 entries. The entry at the top of the stack becomes the third
900 stack entry, the second entry becomes the top of the stack,
901 and the third entry becomes the second entry.
903 \itembfnl{\DWOPderefTARG}
905 operation pops the top stack entry and
906 treats it as an address. The value
907 retrieved from that address is pushed.
908 The size of the data retrieved from the
909 \addtoindexi{dereferenced}{address!dereference operator}
910 address is the \addtoindex{size of an address} on the target machine.
913 \itembfnl{\DWOPderefsizeTARG}
914 The \DWOPderefsizeTARG{} operation behaves like the
916 operation: it pops the top stack entry and treats it as an
917 address. The value retrieved from that address is pushed. In
918 the \DWOPderefsizeINDX{} operation, however, the size in bytes
919 of the data retrieved from the dereferenced address is
920 specified by the single operand. This operand is a 1\dash byte
921 unsigned integral constant whose value may not be larger
922 than the \addtoindex{size of an address} on the target machine. The data
923 retrieved is zero extended to the size of an address on the
924 target machine before being pushed onto the expression stack.
927 \itembfnl{\DWOPxderefTARG}
928 The \DWOPxderefTARG{} operation provides an extended dereference
929 mechanism. The entry at the top of the stack is treated as an
930 address. The second stack entry is treated as an \doublequote{address
931 space identifier} for those architectures that support
932 \addtoindexi{multiple}{address space!multiple}
933 address spaces. The top two stack elements are popped,
934 and a data item is retrieved through an implementation-defined
935 address calculation and pushed as the new stack top. The size
936 of the data retrieved from the
937 \addtoindexi{dereferenced}{address!dereference operator}
939 \addtoindex{size of an address} on the target machine.
941 \itembfnl{\DWOPxderefsizeTARG}
942 The \DWOPxderefsizeTARG{} operation behaves like the
943 \DWOPxderef{} operation. The entry at the top of the stack is
944 treated as an address. The second stack entry is treated as
945 an \doublequote{address space identifier} for those architectures
947 \addtoindexi{multiple}{address space!multiple}
948 address spaces. The top two stack
949 elements are popped, and a data item is retrieved through an
950 implementation\dash defined address calculation and pushed as the
951 new stack top. In the \DWOPxderefsizeINDX{} operation, however,
952 the size in bytes of the data retrieved from the
953 \addtoindexi{dereferenced}{address!dereference operator}
954 address is specified by the single operand. This operand is a
955 1\dash byte unsigned integral constant whose value may not be larger
956 than the \addtoindex{size of an address} on the target machine. The data
957 retrieved is zero extended to the \addtoindex{size of an address} on the
958 target machine before being pushed onto the expression stack.
960 \itembfnl{\DWOPpushobjectaddressTARG}
961 The \DWOPpushobjectaddressTARG{}
962 operation pushes the address
963 of the object currently being evaluated as part of evaluation
964 of a user presented expression. This object may correspond
965 to an independent variable described by its own debugging
966 information entry or it may be a component of an array,
967 structure, or class whose address has been dynamically
968 determined by an earlier step during user expression
971 \textit{This operator provides explicit functionality
972 (especially for arrays involving descriptors) that is analogous
973 to the implicit push of the base
974 \addtoindexi{address}{address!implicit push of base}
975 of a structure prior to evaluation of a
976 \DWATdatamemberlocation{}
977 to access a data member of a structure. For an example, see
978 Appendix \refersec{app:aggregateexamples}.}
981 \itembfnl{\DWOPformtlsaddressTARG}
982 The \DWOPformtlsaddressTARG{}
983 operation pops a value from the stack, translates this
984 value into an address in the
985 \addtoindexx{thread-local storage}
986 thread\dash local storage for a thread, and pushes the address
988 The meaning of the value on the top of the stack prior to this
989 operation is defined by the run-time environment. If the run-time
990 environment supports multiple thread\dash local storage
991 \nolink{blocks} for a single thread, then the \nolink{block}
992 corresponding to the executable or shared
993 library containing this DWARF expression is used.
995 \textit{Some implementations of
996 \addtoindex{C} and \addtoindex{C++} support a
997 thread\dash local storage class. Variables with this storage class
998 have distinct values and addresses in distinct threads, much
999 as automatic variables have distinct values and addresses in
1000 each function invocation. Typically, there is a single \nolink{block}
1001 of storage containing all thread\dash local variables declared in
1002 the main executable, and a separate \nolink{block} for the variables
1003 declared in each shared library.
1004 Each thread\dash local variable can then be accessed in its block using an
1005 identifier. This identifier is typically an offset into the block and pushed
1006 onto the DWARF stack by one of the
1007 \DWOPconstnx{} operations prior to the
1008 \DWOPformtlsaddress{} operation.
1009 Computing the address of
1010 the appropriate \nolink{block} can be complex (in some cases, the
1011 compiler emits a function call to do it), and difficult
1012 to describe using ordinary DWARF location descriptions.
1013 Instead of forcing complex thread-local storage calculations into
1014 the DWARF expressions, the \DWOPformtlsaddress{} allows the consumer
1015 to perform the computation based on the run-time environment.}
1017 \itembfnl{\DWOPcallframecfaTARG}
1018 The \DWOPcallframecfaTARG{}
1019 operation pushes the value of the
1020 CFA, obtained from the Call Frame Information
1021 (see Section \refersec{chap:callframeinformation}).
1023 \textit{Although the value of \DWATframebase{}
1024 can be computed using other DWARF expression operators,
1025 in some cases this would require an extensive location list
1026 because the values of the registers used in computing the
1027 CFA change during a subroutine. If the
1028 Call Frame Information
1029 is present, then it already encodes such changes, and it is
1030 space efficient to reference that.}
1033 \subsubsection{Arithmetic and Logical Operations}
1035 \addtoindexx{DWARF expression!arithmetic operations}
1037 \addtoindexx{DWARF expression!logical operations}
1038 provide arithmetic and logical operations. Except
1039 as otherwise specified, the arithmetic operations perform
1040 addressing arithmetic, that is, unsigned arithmetic that is
1041 performed modulo one plus the largest representable address
1042 (for example, 0x100000000 when the
1043 \addtoindex{size of an address} is 32 bits).
1044 Such operations do not cause an exception on overflow.
1047 \begin{enumerate}[1. ]
1048 \itembfnl{\DWOPabsTARG}
1049 The \DWOPabsTARG{} operation pops the top stack entry, interprets
1050 it as a signed value and pushes its absolute value. If the
1051 absolute value cannot be represented, the result is undefined.
1054 \itembfnl{\DWOPandTARG}
1055 The \DWOPandTARG{} operation pops the top two stack values, performs
1056 a bitwise and operation on the two, and pushes the result.
1058 \itembfnl{\DWOPdivTARG}
1059 The \DWOPdivTARG{} operation pops the top two stack values, divides the former second entry by
1060 the former top of the stack using signed division, and pushes the result.
1062 \itembfnl{\DWOPminusTARG}
1063 The \DWOPminusTARG{} operation pops the top two stack values, subtracts the former top of the
1064 stack from the former second entry, and pushes the result.
1066 \itembfnl{\DWOPmodTARG}
1067 The \DWOPmodTARG{} operation pops the top two stack values and pushes the result of the
1068 calculation: former second stack entry modulo the former top of the stack.
1070 \itembfnl{\DWOPmulTARG}
1071 The \DWOPmulTARG{} operation pops the top two stack entries, multiplies them together, and
1074 \itembfnl{\DWOPnegTARG}
1075 The \DWOPnegTARG{} operation pops the top stack entry, interprets
1076 it as a signed value and pushes its negation. If the negation
1077 cannot be represented, the result is undefined.
1079 \itembfnl{\DWOPnotTARG}
1080 The \DWOPnotTARG{} operation pops the top stack entry, and pushes
1081 its bitwise complement.
1083 \itembfnl{\DWOPorTARG}
1084 The \DWOPorTARG{} operation pops the top two stack entries, performs
1085 a bitwise or operation on the two, and pushes the result.
1087 \itembfnl{\DWOPplusTARG}
1088 The \DWOPplusTARG{} operation pops the top two stack entries,
1089 adds them together, and pushes the result.
1092 \itembfnl{\DWOPplusuconstTARG}
1093 The \DWOPplusuconstTARG{} operation pops the top stack entry,
1094 adds it to the unsigned LEB128\addtoindexx{LEB128!unsigned}
1095 constant operand and pushes the result.
1097 \textit{This operation is supplied specifically to be
1098 able to encode more field offsets in two bytes than can be
1100 \doublequote{\DWOPlitn~\DWOPplus.}}
1103 \itembfnl{\DWOPshlTARG}
1104 The \DWOPshlTARG{} operation pops the top two stack entries,
1105 shifts the former second entry left (filling with zero bits)
1106 by the number of bits specified by the former top of the stack,
1107 and pushes the result.
1109 \itembfnl{\DWOPshrTARG}
1110 The \DWOPshrTARG{} operation pops the top two stack entries,
1111 shifts the former second entry right logically (filling with
1112 zero bits) by the number of bits specified by the former top
1113 of the stack, and pushes the result.
1116 \itembfnl{\DWOPshraTARG}
1117 The \DWOPshraTARG{} operation pops the top two stack entries,
1118 shifts the former second entry right arithmetically (divide
1119 the magnitude by 2, keep the same sign for the result) by
1120 the number of bits specified by the former top of the stack,
1121 and pushes the result.
1123 \itembfnl{\DWOPxorTARG}
1124 The \DWOPxorTARG{} operation pops the top two stack entries,
1125 performs a bitwise exclusive\dash or operation on the two, and
1130 \subsubsection{Control Flow Operations}
1131 \label{chap:controlflowoperations}
1133 \addtoindexx{DWARF expression!control flow operations}
1134 following operations provide simple control of the flow of a DWARF expression.
1135 \begin{enumerate}[1. ]
1136 \itembfnl{\DWOPleTARG, \DWOPgeTARG, \DWOPeqTARG, \DWOPltTARG, \DWOPgtTARG, \DWOPneTARG}
1137 The six relational operators each:
1139 \item pop the top two stack values,
1141 \item compare the operands:
1143 \textless~former second entry~\textgreater \textless~relational operator~\textgreater \textless~former top entry~\textgreater
1145 \item push the constant value 1 onto the stack
1146 if the result of the operation is true or the
1147 constant value 0 if the result of the operation is false.
1150 Comparisons are performed as signed operations. The six
1151 operators are \DWOPleINDX{} (less than or equal to), \DWOPgeINDX{}
1152 (greater than or equal to), \DWOPeqINDX{} (equal to), \DWOPltINDX{} (less
1153 than), \DWOPgtINDX{} (greater than) and \DWOPneINDX{} (not equal to).
1156 \itembfnl{\DWOPskipTARG}
1157 \DWOPskipTARG{} is an unconditional branch. Its single operand
1158 is a 2\dash byte signed integer constant. The 2\dash byte constant is
1159 the number of bytes of the DWARF expression to skip forward
1160 or backward from the current operation, beginning after the
1161 2\dash byte constant.
1163 \itembfnl{\DWOPbraTARG}
1164 \DWOPbraTARG{} is a conditional branch. Its single operand is a
1165 2\dash byte signed integer constant. This operation pops the
1166 top of stack. If the value popped is not the constant 0,
1167 the 2\dash byte constant operand is the number of bytes of the
1168 DWARF expression to skip forward or backward from the current
1169 operation, beginning after the 2\dash byte constant.
1171 % The following item does not correctly hyphenate leading
1172 % to an overfull hbox and a visible artifact.
1173 % So we use \- to suggest hyphenation in this rare situation.
1174 \itembfnl{\DWOPcalltwoTARG, \DWOPcallfourTARG, \DWOPcallrefTARG}
1177 and \DWOPcallrefINDX{} perform
1178 subroutine calls during evaluation of a DWARF expression or
1179 location description.
1180 For \DWOPcalltwoINDX{} and \DWOPcallfour{},
1181 the operand is the 2\dash~ or 4\dash byte unsigned offset, respectively,
1182 of a debugging information entry in the current compilation
1183 unit. The \DWOPcallref{} operator has a single operand. In the
1184 \thirtytwobitdwarfformat,
1185 the operand is a 4\dash byte unsigned value;
1186 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
1187 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1188 The operand is used as the offset of a
1189 debugging information entry in a
1191 section which may be contained in a shared object or executable
1192 other than that containing the operator. For references from
1193 one shared object or executable to another, the relocation
1194 must be performed by the consumer.
1196 \textit{Operand interpretation of
1197 \DWOPcalltwo, \DWOPcallfour{} and \DWOPcallref{} is exactly like
1198 that for \DWFORMreftwo, \DWFORMreffour{} and \DWFORMrefaddr,
1200 (see Section \refersec{datarep:attributeencodings}).
1203 These operations transfer
1204 control of DWARF expression evaluation to
1205 \addtoindexx{location attribute}
1208 attribute of the referenced debugging information entry. If
1209 there is no such attribute, then there is no effect. Execution
1210 of the DWARF expression of
1211 \addtoindexx{location attribute}
1213 \DWATlocation{} attribute may add
1214 to and/or remove from values on the stack. Execution returns
1215 to the point following the call when the end of the attribute
1216 is reached. Values on the stack at the time of the call may be
1217 used as parameters by the called expression and values left on
1218 the stack by the called expression may be used as return values
1219 by prior agreement between the calling and called expressions.
1223 \subsubsection{Special Operations}
1225 \addtoindexx{DWARF expression!special operations}
1226 are these special operations currently defined:
1227 \begin{enumerate}[1. ]
1228 \itembfnl{\DWOPnopNAME}
1229 The \DWOPnopTARG{} operation is a place holder. It has no effect
1230 on the location stack or any of its values.
1232 \itembfnl{\DWOPentryvalueNAME}
1233 The \DWOPentryvalueTARG{} operation pushes a value that had a known location
1234 upon entering the current subprogram. It uses two operands: an
1235 unsigned LEB128\addtoindexx{LEB128!unsigned} length, followed by
1236 a block containing a DWARF expression or
1237 a simple register location description. The length gives the length
1238 in bytes of the block. If the block contains a register location
1239 description, \DWOPentryvalueNAME{} pushes the value that register had upon
1240 entering the current subprogram. If the block contains a DWARF expression,
1241 the DWARF expression is evaluated as if it has been evaluated upon entering
1242 the current subprogram. The DWARF expression should not assume any values
1243 being present on the DWARF stack initially and should result in exactly one
1244 value being pushed on the DWARF stack when completed. That value is the value
1245 being pushed by the \DWOPentryvalueNAME{} operation.
1247 \DWOPpushobjectaddress{} is not meaningful inside of this DWARF operation.
1249 \textit{The \DWOPentryvalueNAME{} operation can be used by consumers if they are able
1250 to find the call site in the caller function, unwind to it and the corresponding
1251 \DWTAGcallsiteparameter{} entry has \DWATcallvalue{} or
1252 \DWATcalldatavalue{} attributes that can be evaluated to find out the
1253 value a function parameter had on the first instruction in the function.
1254 Or non-interactive consumers which know what variables will need to be
1255 inspected ahead of running the debugged program could put breakpoint
1256 on the first instruction in functions where there is no other way to find
1257 some variable's value, but evaluating \DWOPentryvalueNAME{} operation. The
1258 consumer can collect there the value of registers or memory referenced in
1259 \DWOPentryvalueNAME{} operations, then continue to breakpoints where the values
1260 of variables or parameters need to be inspected and use there the remembered
1261 register or memory values during \DWOPentryvalueNAME{} evaluation.
1266 \subsection{Example Stack Operations}
1268 \addtoindexx{DWARF expression!examples}
1269 stack operations defined in
1270 Section \refersec{chap:stackoperations}.
1271 are fairly conventional, but the following
1272 examples illustrate their behavior graphically.}
1274 \begin{longtable}[c]{rrcrr}
1275 \multicolumn{2}{c}{Before} & Operation & \multicolumn{2}{c}{After} \\
1279 0& 17& \DWOPdup{} &0 &17 \\
1281 2& 1000 & & 2 & 29\\
1285 0 & 17 & \DWOPdrop{} & 0 & 29 \\
1286 1 &29 & & 1 & 1000 \\
1290 0 & 17 & \DWOPpick, 2 & 0 & 1000 \\
1296 0&17& \DWOPover&0&29 \\
1302 0&17& \DWOPswap{} &0&29 \\
1304 2&1000 & & 2&1000 \\
1307 0&17&\DWOProt{} & 0 &29 \\
1308 1&29 & & 1 & 1000 \\
1309 2& 1000 & & 2 & 17 \\
1312 \section{Location Descriptions}
1313 \label{chap:locationdescriptions}
1314 \textit{Debugging information
1315 \addtoindexx{location description}
1317 \addtoindexx{location description|see{\textit{also} DWARF expression}}
1318 provide consumers a way to find
1319 the location of program variables, determine the bounds
1320 of dynamic arrays and strings, and possibly to find the
1321 base address of a subroutine\textquoteright s stack frame or the return
1322 address of a subroutine. Furthermore, to meet the needs of
1323 recent computer architectures and optimization techniques,
1324 debugging information must be able to describe the location of
1325 an object whose location changes over the object\textquoteright s lifetime.}
1327 Information about the location of program objects is provided
1328 by location descriptions. Location descriptions can be either
1330 \begin{enumerate}[1. ]
1331 \item \textit{Single location descriptions},
1333 \addtoindexx{location description!single}
1335 \addtoindexx{single location description}
1336 a language independent representation of
1337 addressing rules of arbitrary complexity built from
1338 DWARF expressions (See Section \refersec{chap:dwarfexpressions})
1340 DWARF operations specific to describing locations. They are
1341 sufficient for describing the location of any object as long
1342 as its lifetime is either static or the same as the
1343 \livelink{chap:lexicalblock}{lexical block} that owns it,
1344 and it does not move during its lifetime.
1346 Single location descriptions are of two kinds:
1347 \begin{enumerate}[a) ]
1348 \item Simple location descriptions, which describe the location
1349 \addtoindexx{location description!simple}
1350 of one contiguous piece (usually all) of an object. A simple
1351 location description may describe a location in addressable
1352 memory, or in a register, or the lack of a location (with or
1353 without a known value).
1355 \item Composite location descriptions, which describe an
1356 \addtoindexx{location description!composite}
1357 object in terms of pieces each of which may be contained in
1358 part of a register or stored in a memory location unrelated
1362 \item \textit{Location lists}, which are used to
1363 \addtoindexx{location list}
1365 \addtoindexx{location description!use in location list}
1366 objects that have a limited lifetime or change their location
1367 during their lifetime. Location lists are described in
1368 Section \refersec{chap:locationlists} below.
1372 Location descriptions are distinguished in a context sensitive
1373 manner. As the value of an attribute, a location description
1375 \addtoindexx{exprloc class}
1376 class \livelink{chap:classexprloc}{exprloc}
1377 and a location list is encoded
1378 using class \livelink{chap:classloclistptr}{loclistptr}
1380 \addtoindex{loclistptr}
1381 serves as an offset into a
1383 \addtoindexx{location list}
1384 location list table).
1387 \subsection{Single Location Descriptions}
1388 A single location description is either:
1389 \begin{enumerate}[1. ]
1390 \item A simple location description, representing an object
1391 \addtoindexx{location description!simple}
1393 \addtoindexx{simple location description}
1394 exists in one contiguous piece at the given location, or
1395 \item A composite location description consisting of one or more
1396 \addtoindexx{location description!composite}
1397 simple location descriptions, each of which is followed by
1398 one composition operation. Each simple location description
1399 describes the location of one piece of the object; each
1400 composition operation describes which part of the object is
1401 located there. Each simple location description that is a
1402 DWARF expression is evaluated independently of any others
1403 (as though on its own separate stack, if any).
1408 \subsubsection{Simple Location Descriptions}
1411 \addtoindexx{location description!simple}
1412 simple location description consists of one
1413 contiguous piece or all of an object or value.
1416 \subsubsubsection{Memory Location Descriptions}
1418 \addtoindexx{location description!memory}
1419 memory location description
1420 \addtoindexx{memory location description}
1421 consists of a non\dash empty DWARF
1423 Section \refersec{chap:dwarfexpressions}
1424 ), whose value is the address of
1425 a piece or all of an object or other entity in memory.
1427 \subsubsubsection{Register Location Descriptions}
1428 \label{chap:registerlocationdescriptions}
1429 A register location description consists of a register name
1430 operation, which represents a piece or all of an object
1431 located in a given register.
1433 \textit{Register location descriptions describe an object
1434 (or a piece of an object) that resides in a register, while
1435 the opcodes listed in
1436 Section \refersec{chap:registerbasedaddressing}
1437 are used to describe an object (or a piece of
1438 an object) that is located in memory at an address that is
1439 contained in a register (possibly offset by some constant). A
1440 register location description must stand alone as the entire
1441 description of an object or a piece of an object.
1444 The following DWARF operations can be used to name a register.
1447 \textit{Note that the register number represents a DWARF specific
1448 mapping of numbers onto the actual registers of a given
1449 architecture. The mapping should be chosen to gain optimal
1450 density and should be shared by all users of a given
1451 architecture. It is recommended that this mapping be defined
1452 by the ABI authoring committee for each architecture.
1454 \begin{enumerate}[1. ]
1455 \itembfnl{\DWOPregzeroTARG, \DWOPregoneTARG, ..., \DWOPregthirtyoneTARG}
1456 The \DWOPregnTARG{} operations encode the names of up to 32
1457 registers, numbered from 0 through 31, inclusive. The object
1458 addressed is in register \textit{n}.
1461 \itembfnl{\DWOPregxTARG}
1462 The \DWOPregxTARG{} operation has a single
1463 unsigned LEB128\addtoindexx{LEB128!unsigned} literal
1464 operand that encodes the name of a register.
1468 \textit{These operations name a register location. To
1469 fetch the contents of a register, it is necessary to use
1470 one of the register based addressing operations, such as
1472 (Section \refersec{chap:registerbasedaddressing})}.
1474 \subsubsubsection{Implicit Location Descriptions}
1475 An \addtoindex{implicit location description}
1476 represents a piece or all
1477 \addtoindexx{location description!implicit}
1478 of an object which has no actual location but whose contents
1479 are nonetheless either known or known to be undefined.
1481 The following DWARF operations may be used to specify a value
1482 that has no location in the program but is a known constant
1483 or is computed from other locations and values in the program.
1485 The following DWARF operations may be used to specify a value
1486 that has no location in the program but is a known constant
1487 or is computed from other locations and values in the program.
1488 \begin{enumerate}[1. ]
1489 \itembfnl{\DWOPimplicitvalueTARG}
1490 The \DWOPimplicitvalueTARG{}
1491 operation specifies an immediate value
1492 using two operands: an unsigned LEB128\addtoindexx{LEB128!unsigned}
1494 %FIXME: should this block be a reference? To what?
1495 a \nolink{block} representing the value in the memory representation
1496 of the target machine. The length operand gives the length
1497 in bytes of the \nolink{block}.
1499 \itembfnl{\DWOPstackvalueTARG}
1500 The \DWOPstackvalueTARG{}
1501 operation specifies that the object
1502 does not exist in memory but its value is nonetheless known
1503 and is at the top of the DWARF expression stack. In this form
1504 of location description, the DWARF expression represents the
1505 actual value of the object, rather than its location. The
1506 \DWOPstackvalueINDX{} operation terminates the expression.
1508 \itembfnl{\DWOPimplicitpointerTARG}
1509 The \DWOPimplicitpointerNAME{} operation specifies that the object
1510 is a pointer that cannot be represented as a real pointer,
1511 even though the value it would point to can be described. In
1512 this form of location description, the DWARF expression refers
1513 to a debugging information entry that represents the actual
1514 value of the object to which the pointer would point. Thus, a
1515 consumer of the debug information would be able to show the
1516 value of the dereferenced pointer, even when it cannot show
1517 the value of the pointer itself.
1520 The \DWOPimplicitpointerNAME{} operation has two operands: a
1521 reference to a debugging information entry that describes
1522 the dereferenced object's value, and a signed number that
1523 is treated as a byte offset from the start of that value.
1524 The first operand is a 4-byte unsigned value in the 32-bit
1525 DWARF format, or an 8-byte unsigned value in the 64-bit
1526 DWARF format (see Section
1527 \refersec{datarep:32bitand64bitdwarfformats}).
1528 The second operand is a
1529 signed LEB128\addtoindexx{LEB128!signed} number.
1531 The first operand is used as the offset of a debugging
1532 information entry in a \dotdebuginfo{} section, which may be
1533 contained in a shared object or executable other than that
1534 containing the operator. For references from one shared object
1535 or executable to another, the relocation must be performed by
1538 \textit{The debugging information entry referenced by a
1539 \DWOPimplicitpointerNAME{} operation is typically a
1540 \DWTAGvariable{} or \DWTAGformalparameter{} entry whose
1541 \DWATlocation{} attribute gives a second DWARF expression or a
1542 location list that describes the value of the object, but the
1543 referenced entry may be any entry that contains a \DWATlocation{}
1544 or \DWATconstvalue{} attribute (for example, \DWTAGdwarfprocedure).
1545 By using the second DWARF expression, a consumer can
1546 reconstruct the value of the object when asked to dereference
1547 the pointer described by the original DWARF expression
1548 containing the \DWOPimplicitpointer{} operation.}
1552 \textit{DWARF location expressions are intended to yield the \textbf{location}
1553 of a value rather than the value itself. An optimizing compiler
1554 may perform a number of code transformations where it becomes
1555 impossible to give a location for a value, but remains possible
1556 to describe the value itself.
1557 Section \refersec{chap:registerlocationdescriptions}
1558 describes operators that can be used to
1559 describe the location of a value when that value exists in a
1560 register but not in memory. The operations in this section are
1561 used to describe values that exist neither in memory nor in a
1564 \paragraph{Empty Location Descriptions}
1566 An \addtoindex{empty location description}
1567 consists of a DWARF expression
1568 \addtoindexx{location description!empty}
1569 containing no operations. It represents a piece or all of an
1570 object that is present in the source but not in the object code
1571 (perhaps due to optimization).
1574 \subsubsection{Composite Location Descriptions}
1575 A composite location description describes an object or
1576 value which may be contained in part of a register or stored
1577 in more than one location. Each piece is described by a
1578 composition operation, which does not compute a value nor
1579 store any result on the DWARF stack. There may be one or
1580 more composition operations in a single composite location
1581 description. A series of such operations describes the parts
1582 of a value in memory address order.
1584 Each composition operation is immediately preceded by a simple
1585 location description which describes the location where part
1586 of the resultant value is contained.
1587 \begin{enumerate}[1. ]
1588 \itembfnl{\DWOPpieceTARG}
1589 The \DWOPpieceTARG{} operation takes a
1590 single operand, which is an
1591 unsigned LEB128\addtoindexx{LEB128!unsigned} number.
1592 The number describes the size in bytes
1593 of the piece of the object referenced by the preceding simple
1594 location description. If the piece is located in a register,
1595 but does not occupy the entire register, the placement of
1596 the piece within that register is defined by the ABI.
1598 \textit{Many compilers store a single variable in sets of registers,
1599 or store a variable partially in memory and partially in
1600 registers. \DWOPpieceINDX{} provides a way of describing how large
1601 a part of a variable a particular DWARF location description
1604 \itembfnl{\DWOPbitpieceTARG}
1605 The \DWOPbitpieceTARG{}
1606 operation takes two operands. The first
1607 is an unsigned LEB128\addtoindexx{LEB128!unsigned}
1608 number that gives the size in bits
1609 of the piece. The second is an
1610 unsigned LEB128\addtoindexx{LEB128!unsigned} number that
1611 gives the offset in bits from the location defined by the
1612 preceding DWARF location description.
1614 Interpretation of the
1615 offset depends on the kind of location description. If the
1616 location description is empty, the offset doesn\textquoteright t matter and
1617 the \DWOPbitpieceINDX{} operation describes a piece consisting
1618 of the given number of bits whose values are undefined. If
1619 the location is a register, the offset is from the least
1620 significant bit end of the register. If the location is a
1621 memory address, the \DWOPbitpieceINDX{} operation describes a
1622 sequence of bits relative to the location whose address is
1623 on the top of the DWARF stack using the bit numbering and
1624 direction conventions that are appropriate to the current
1625 language on the target system. If the location is any implicit
1626 value or stack value, the \DWOPbitpieceINDX{} operation describes
1627 a sequence of bits using the least significant bits of that
1631 \textit{\DWOPbitpieceINDX{} is
1632 used instead of \DWOPpieceINDX{} when
1633 the piece to be assembled into a value or assigned to is not
1634 byte-sized or is not at the start of a register or addressable
1640 \subsubsection{Example Single Location Descriptions}
1642 Here are some examples of how DWARF operations are used to form location descriptions:
1643 % Probably the only place that this will be used, so not in dwarf.tex?
1644 \newcommand{\descriptionitemnl}[1]{\item[#1]\mbox{}\\}
1646 \descriptionitemnl{\DWOPregthree}
1647 The value is in register 3.
1649 \descriptionitemnl{\DWOPregx{} 54}
1650 The value is in register 54.
1652 \descriptionitemnl{\DWOPaddr{} 0x80d0045c}
1653 The value of a static variable is at machine address 0x80d0045c.
1655 \descriptionitemnl{\DWOPbregeleven{} 44}
1656 Add 44 to the value in register 11 to get the address of an automatic
1660 \descriptionitemnl{\DWOPfbreg{} -50}
1661 Given a \DWATframebase{} value of
1662 \doublequote{\DWOPbregthirtyone{} 64,} this example
1663 computes the address of a local variable that is -50 bytes from a
1664 logical frame pointer that is computed by adding 64 to the current
1665 stack pointer (register 31).
1667 \descriptionitemnl{\DWOPbregx{} 54 32 \DWOPderef}
1668 A call-by-reference parameter whose address is in the word 32 bytes
1669 from where register 54 points.
1672 \descriptionitemnl{\DWOPplusuconst{} 4}
1673 A structure member is four bytes from the start of the structure
1674 instance. The base address is assumed to be already on the stack.
1676 \descriptionitemnl{\DWOPregthree{} \DWOPpiece{} 4 \DWOPregten{} \DWOPpiece{} 2}
1677 A variable whose first four bytes reside in register 3 and whose next
1678 two bytes reside in register 10.
1680 \descriptionitemnl{\DWOPregzero{} \DWOPpiece{} 4 \DWOPpiece{} 4 \DWOPfbreg{} -12 \DWOPpiece{} 4}
1681 \vspace{-2\parsep}A twelve byte value whose first four bytes reside in register zero,
1682 whose middle four bytes are unavailable (perhaps due to optimization),
1683 and whose last four bytes are in memory, 12 bytes before the frame
1686 \descriptionitemnl{\DWOPbregone{} 0 \DWOPbregtwo{} 0 \DWOPplus{} \DWOPstackvalue{} }
1687 Add the contents of r1 and r2 to compute a value. This value is the
1688 \doublequote{contents} of an otherwise anonymous location.
1691 \descriptionitemnl{\DWOPlitone{} \DWOPstackvalue{} \DWOPpiece{} 4 \DWOPbregthree{} 0 \DWOPbregfour{} 0}
1692 \vspace{-2\parsep}\descriptionitemnl{
1693 \hspace{0.5cm}\DWOPplus{} \DWOPstackvalue{} \DWOPpiece{} 4 \DWOPpiece{} 4}
1694 The object value is found in an anonymous (virtual) location whose
1695 value consists of two parts, given in memory address order: the 4 byte
1696 value 1 followed by the four byte value computed from the sum of the
1697 contents of r3 and r4.
1699 \descriptionitemnl{\DWOPentryvalue{} 1 \DWOPregone{} \DWOPstackvalue }
1700 The value register 1 had upon entering the current subprogram.
1702 \descriptionitemnl{\DWOPentryvalue{} 2 \DWOPbregone{} 0 \DWOPstackvalue }
1703 The value register 1 had upon entering the current subprogram (same as the previous example).
1704 %Both of these location descriptions evaluate to the value register 1 had upon
1705 %entering the current subprogram.
1707 %FIXME: The following gets an undefined control sequence error for reasons unknown...
1708 %\descriptionitemnl{\DWOPentryvalue{} 1 \DWOPregthirtyone{} \DWOPregone{} \DWOPadd{} \DWOPstackvalue }
1709 %The value register 31 had upon entering the current subprogram
1710 %plus the value register 1 currently has.
1712 \descriptionitemnl{\DWOPentryvalue{} 3 \DWOPbregfour{} 16 \DWOPderef{} \DWOPstackvalue }
1713 %FIXME: similar undefined as just above
1714 %\descriptionitemnl{\DWOPentryvalue{} 6 \DWOPentryvalue{} 1 \DWOPregfour{} \DWOPplusuconst{} 16 \DWOPderef{} \DWOPstackvalue }
1715 %These two location expressions do the same thing, p
1716 Push the value of the
1717 memory location with the size of an address pointed to by the value of
1718 register 4 upon entering the current subprogram and add 16.
1723 \subsection{Location Lists}
1724 \label{chap:locationlists}
1725 There are two forms of location lists. The first form
1726 is intended for use in other than a split DWARF object,
1727 while the second is intended for use in a split DWARF object
1728 (see Section \refersec{datarep:splitdwarfobjects}). The two
1729 forms are otherwise equivalent.
1731 \textit{The form for split DWARF objects is new in \DWARFVersionV.}
1733 \subsubsection{Location Lists in Non-split Objects}
1734 \label{chap:locationlistsinnonsplitobjects}
1736 \addtoindexx{location list}
1737 are used in place of location expressions
1738 whenever the object whose location is being described
1739 can change location during its lifetime.
1741 \addtoindexx{location list}
1742 are contained in a separate object file section called
1743 \dotdebugloc{}. A location list is indicated by a location
1744 attribute whose value is an offset from the beginning of
1745 the \dotdebugloc{} section to the first byte of the list for the
1748 Each entry in a location list is either a location
1749 \addtoindexi{list}{address selection|see{base address selection}}
1752 \addtoindexi{base}{base address selection entry!in location list}
1753 address selection entry,
1754 \addtoindexx{location list!base address selection entry}
1756 \addtoindexx{end of list entry!in location list}
1759 A location list entry has two forms:
1760 a normal location list entry and a default location list entry.
1763 \addtoindexx{location list!normal entry}
1764 normal location list entry consists of:
1765 \begin{enumerate}[1. ]
1766 \item A beginning address offset.
1767 This address offset has the \addtoindex{size of an address} and is
1768 relative to the applicable base address of the compilation
1769 unit referencing this location list. It marks the beginning
1771 \addtoindexi{range}{address range!in location list}
1772 over which the location is valid.
1774 \item An ending address offset. This address offset again
1775 has the \addtoindex{size of an address} and is relative to the applicable
1776 base address of the compilation unit referencing this location
1777 list. It marks the first address past the end of the address
1778 range over which the location is valid. The ending address
1779 must be greater than or equal to the beginning address.
1781 \textit{A location list entry (but not a base address selection or
1782 end of list entry) whose beginning
1783 and ending addresses are equal has no effect
1784 because the size of the range covered by such
1787 \item A 2-byte length describing the length of the location
1788 description that follows.
1790 \item A \addtoindex{single location description}
1791 describing the location of the object over the range specified by
1792 the beginning and end addresses.
1796 The applicable base address of a normal
1797 location list entry is
1798 \addtoindexx{location list!base address selection entry}
1799 determined by the closest preceding base address selection
1800 entry (see below) in the same location list. If there is
1801 no such selection entry, then the applicable base address
1802 defaults to the base address of the compilation unit (see
1803 Section \refersec{chap:normalandpartialcompilationunitentries}).
1805 \textit{In the case of a compilation unit where all of
1806 the machine code is contained in a single contiguous section,
1807 no base address selection entry is needed.}
1809 Address ranges defined by normal location list entries
1810 may overlap. When they do, they describe a
1811 situation in which an object exists simultaneously in more than
1812 one place. If all of the address ranges in a given location
1813 list do not collectively cover the entire range over which the
1814 object in question is defined, it is assumed that the object is
1815 not available for the portion of the range that is not covered.
1817 A default location list entry consists of:
1818 \addtoindexx{location list!default entry}
1819 \begin{enumerate}[1. ]
1821 \item The value of the largest representable address offset (for
1822 example, \wffffffff when the size of an address is 32 bits).
1823 \item A simple location description describing the location of the
1824 object when there is no prior normal location list entry
1825 that applies in the same location list.
1828 A default location list entry is independent of any applicable
1829 base address (except to the extent to which base addresses
1830 affect prior normal location list entries).
1832 A default location list entry must be the last location list
1833 entry of a location list except for the terminating end of list
1836 A default location list entry describes an unlimited number
1837 (zero, one or more) of address ranges, none of which overlap
1838 any of the address ranges defined earlier in the same location
1839 list. Further, all such address ranges have the same simple
1844 \addtoindexi{address}{address selection|see{base address selection}}
1845 \addtoindexx{location list!base address selection entry}
1847 \addtoindexi{entry}{base address selection entry!in location list}
1849 \begin{enumerate}[1. ]
1850 \item The value of the largest representable
1851 address offset (for example, \wffffffff when the size of
1852 an address is 32 bits).
1853 \item An address, which defines the
1854 appropriate base address for use in interpreting the beginning
1855 and ending address offsets of subsequent entries of the location list.
1858 \textit{A base address selection entry
1859 affects only the list in which it is contained.}
1862 The end of any given location list is marked by an
1863 \addtoindexx{location list!end of list entry}
1864 end of list entry, which consists of a 0 for the beginning address
1865 offset and a 0 for the ending address offset. A location list
1867 \addtoindexx{end of list entry!in location list}
1868 end of list entry describes an object that
1869 exists in the source code but not in the executable program.
1871 Neither a base address selection entry nor an end of list
1872 entry includes a location description.
1874 \textit{When a DWARF consumer is parsing and decoding a location
1875 list, it must recognize the beginning and ending address
1876 offsets of (0, 0) for an end of list entry and (0, \doublequote{-1}) for
1877 a default location list entry prior to applying any base
1878 address. Any other pair of offsets beginning with 0 is a
1879 valid normal location list entry. Next, it must recognize the
1880 beginning address offset of \doublequote{-1} for a base address selection
1881 entry prior to applying any base address. The current base
1882 address is not applied to the subsequent value (although there
1883 may be an underlying object language relocation that affects
1886 \textit{A base address selection entry and an end of list
1887 entry for a location list are identical to a base address
1888 selection entry and end of list entry, respectively, for a
1889 \addtoindex{range list}
1890 (see Section \refersec{chap:noncontiguousaddressranges})
1892 and representation.}
1894 \subsubsection{Location Lists in Split Objects}
1895 \label{chap:locationlistsinsplitobjects}
1896 In a split DWARF object (see
1897 Section \refersec{datarep:splitdwarfobjects}),
1898 location lists are contained in the \dotdebuglocdwo{} section.
1900 Each entry in the location list
1901 begins with a type code, which is a single byte that
1902 identifies the type of entry. There are five types of entries:
1904 \itembfnl{\DWLLEendoflistentryTARG}
1905 This entry indicates the end of a location list, and
1906 contains no further data.
1908 \itembfnl{\DWLLEbaseaddressselectionentryTARG}
1909 This entry contains an
1910 unsigned LEB128\addtoindexx{LEB128!unsigned} value immediately
1911 following the type code. This value is the index of an
1912 address in the \dotdebugaddr{} section, which is then used as
1913 the base address when interpreting offsets in subsequent
1914 location list entries of type \DWLLEoffsetpairentry.
1915 This index is relative to the value of the
1916 \DWATaddrbase{} attribute of the associated compilation unit.
1918 \itembfnl{\DWLLEstartendentryTARG}
1919 This entry contains two unsigned LEB128\addtoindexx{LEB128!unsigned}
1920 values immediately following the type code. These values are the
1921 indices of two addresses in the \dotdebugaddr{} section.
1922 These indices are relative to the value of the
1923 \DWATaddrbase{} attribute of the associated compilation unit.
1924 These indicate the starting and ending addresses,
1925 respectively, that define the address range for which
1926 this location is valid. The starting and ending addresses
1927 given by this type of entry are not relative to the
1928 compilation unit base address. A single location
1929 description follows the fields that define the address range.
1931 \itembfnl{\DWLLEstartlengthentryTARG}
1932 This entry contains one unsigned LEB128\addtoindexx{LEB128!unsigned}
1934 unsigned value immediately following the type code. The
1935 first value is the index of an address in the \dotdebugaddr{}
1936 section, which marks the beginning of the address range
1937 over which the location is valid.
1938 This index is relative to the value of the
1939 \DWATaddrbase{} attribute of the associated compilation unit.
1940 The starting address given by this
1941 type of entry is not relative to the compilation unit
1942 base address. The second value is the
1943 length of the range. A single location
1944 description follows the fields that define the address range.
1946 \itembfnl{\DWLLEoffsetpairentryTARG}
1947 This entry contains two 4-byte unsigned values
1948 immediately following the type code. These values are the
1949 starting and ending offsets, respectively, relative to
1950 the applicable base address, that define the address
1951 range for which this location is valid. A single location
1952 description follows the fields that define the address range.
1956 \section{Types of Program Entities}
1957 \label{chap:typesofprogramentities}
1959 \hypertarget{chap:DWATtypetypeofdeclaration}{}
1960 debugging information entry describing a declaration that
1962 \addtoindexx{type attribute}
1963 a \DWATtype{} attribute, whose value is a
1964 reference to another debugging information entry. The entry
1965 referenced may describe a base type, that is, a type that is
1966 not defined in terms of other data types, or it may describe a
1967 user-defined type, such as an array, structure or enumeration.
1968 Alternatively, the entry referenced may describe a type
1969 modifier, such as constant, packed, pointer, reference or
1970 volatile, which in turn will reference another entry describing
1971 a type or type modifier (using
1972 \addtoindexx{type attribute}
1973 a \DWATtype{} attribute of its
1975 Section \referfol{chap:typeentries}
1976 for descriptions of the entries describing
1977 base types, user-defined types and type modifiers.
1981 \section{Accessibility of Declarations}
1982 \label{chap:accessibilityofdeclarations}
1983 \textit{Some languages, notably C++ and
1984 \addtoindex{Ada}, have the concept of
1985 the accessibility of an object or of some other program
1986 entity. The accessibility specifies which classes of other
1987 program objects are permitted access to the object in question.}
1989 The accessibility of a declaration is
1990 \hypertarget{chap:DWATaccessibilitycandadadeclarations}{}
1992 \DWATaccessibility{}
1994 \addtoindexx{accessibility attribute}
1995 value is a constant drawn from the set of codes listed in Table
1996 \refersec{tab:accessibilitycodes}.
1998 \begin{simplenametable}[1.9in]{Accessibility codes}{tab:accessibilitycodes}
1999 \DWACCESSpublicTARG{} \\
2000 \DWACCESSprivateTARG{} \\
2001 \DWACCESSprotectedTARG{} \\
2002 \end{simplenametable}
2004 \section{Visibility of Declarations}
2005 \label{chap:visibilityofdeclarations}
2007 \textit{Several languages (such as \addtoindex{Modula-2})
2008 have the concept of the visibility of a declaration. The
2009 visibility specifies which declarations are to be
2010 visible outside of the entity in which they are
2014 \hypertarget{chap:DWATvisibilityvisibilityofdeclaration}{}
2015 visibility of a declaration is represented
2016 by a \DWATvisibility{}
2017 attribute\addtoindexx{visibility attribute}, whose value is a
2018 constant drawn from the set of codes listed in
2019 Table \refersec{tab:visibilitycodes}.
2021 \begin{simplenametable}[1.5in]{Visibility codes}{tab:visibilitycodes}
2022 \DWVISlocalTARG{} \\
2023 \DWVISexportedTARG{} \\
2024 \DWVISqualifiedTARG{} \\
2025 \end{simplenametable}
2027 \section{Virtuality of Declarations}
2028 \label{chap:virtualityofdeclarations}
2029 \textit{C++ provides for virtual and pure virtual structure or class
2030 member functions and for virtual base classes.}
2033 \hypertarget{chap:DWATvirtualityvirtualityindication}{}
2034 virtuality of a declaration is represented by a
2036 attribute\addtoindexx{virtuality attribute}, whose value is a constant drawn
2037 from the set of codes listed in
2038 Table \refersec{tab:virtualitycodes}.
2040 \begin{simplenametable}[2.5in]{Virtuality codes}{tab:virtualitycodes}
2041 \DWVIRTUALITYnoneTARG{} \\
2042 \DWVIRTUALITYvirtualTARG{} \\
2043 \DWVIRTUALITYpurevirtualTARG{} \\
2044 \end{simplenametable}
2046 \section{Artificial Entries}
2047 \label{chap:artificialentries}
2048 \textit{A compiler may wish to generate debugging information entries
2049 for objects or types that were not actually declared in the
2050 source of the application. An example is a formal parameter
2051 %FIXME: The word 'this' should be rendered like a variant italic,
2052 %FIXME: not as a quoted name. Changed to tt font--RB
2053 entry to represent the
2054 \texttt{this} parameter\index{this parameter@\texttt{this} parameter}
2055 hidden \texttt{this} parameter that most C++
2056 implementations pass as the first argument to non-static member
2059 Any debugging information entry representing the
2060 \addtoindexx{artificial attribute}
2061 declaration of an object or type artificially generated by
2062 a compiler and not explicitly declared by the source program
2063 \hypertarget{chap:DWATartificialobjectsortypesthat}{}
2065 \DWATartificial{} attribute,
2066 which is a \livelink{chap:classflag}{flag}.
2068 \section{Segmented Addresses}
2069 \label{chap:segmentedaddresses}
2070 \textit{In some systems, addresses are specified as offsets within a
2072 \addtoindexx{address space!segmented}
2074 \addtoindexx{segmented addressing|see{address space}}
2075 rather than as locations within a single flat
2076 \addtoindexx{address space!flat}
2079 Any debugging information entry that contains a description
2080 \hypertarget{chap:DWATsegmentaddressinginformation}{}
2081 of the location of an object or subroutine may have a
2082 \DWATsegment{} attribute,
2083 \addtoindexx{segment attribute}
2084 whose value is a location
2085 description. The description evaluates to the segment selector
2086 of the item being described. If the entry containing the
2087 \DWATsegment{} attribute has a
2091 \DWATentrypc{} attribute,
2092 \addtoindexx{entry pc attribute}
2095 description that evaluates to an address, then those address
2096 values represent the offset portion of the address within
2097 the segment specified
2098 \addtoindexx{segment attribute}
2102 \DWATsegment{} attribute, it inherits
2103 \addtoindexx{segment attribute}
2104 the segment value from its parent entry. If none of the
2105 entries in the chain of parents for this entry back to
2106 its containing compilation unit entry have
2107 \DWATsegment{} attributes,
2108 then the entry is assumed to exist within a flat
2110 Similarly, if the entry has a
2111 \DWATsegment{} attribute
2112 \addtoindexx{segment attribute}
2113 containing an empty location description, that
2114 entry is assumed to exist within a
2115 \addtoindexi{flat}{address space!flat}
2118 \textit{Some systems support different classes of
2120 \addtoindexx{address class!attribute}.
2122 address class may affect the way a pointer is dereferenced
2123 or the way a subroutine is called.}
2126 Any debugging information entry representing a pointer or
2127 reference type or a subroutine or subroutine type may
2130 attribute, whose value is an integer
2131 constant. The set of permissible values is specific to
2132 each target architecture. The value \DWADDRnoneTARG,
2134 is common to all encodings, and means that no address class
2137 \textit {For example, the Intel386 \texttrademark\ processor might use the following values:}
2140 \caption{Example address class codes}
2141 \label{tab:inteladdressclasstable}
2143 \begin{tabular}{l|c|l}
2145 Name&Value&Meaning \\
2147 \textit{DW\_ADDR\_none}& 0 & \textit{no class specified} \\
2148 \textit{DW\_ADDR\_near16}& 1 & \textit{16\dash bit offset, no segment} \\
2149 \textit{DW\_ADDR\_far16}& 2 & \textit{16\dash bit offset, 16\dash bit segment} \\
2150 \textit{DW\_ADDR\_huge16}& 3 & \textit{16\dash bit offset, 16\dash bit segment} \\
2151 \textit{DW\_ADDR\_near32}& 4 & \textit{32\dash bit offset, no segment} \\
2152 \textit{DW\_ADDR\_far32}& 5 & \textit{32\dash bit offset, 16\dash bit segment} \\
2158 \section{Non-Defining Declarations and Completions}
2159 \label{nondefiningdeclarationsandcompletions}
2160 A debugging information entry representing a program entity
2161 typically represents the defining declaration of that
2162 entity. In certain contexts, however, a debugger might need
2163 information about a declaration of an entity that is not
2164 \addtoindexx{incomplete declaration}
2165 also a definition, or is otherwise incomplete, to evaluate
2166 \hypertarget{chap:DWATdeclarationincompletenondefiningorseparateentitydeclaration}{}
2167 an expression correctly.
2170 \textit{As an example, consider the following fragment of \addtoindex{C} code:}
2184 \textit{\addtoindex{C} scoping rules require that the
2185 value of the variable x passed to the function g is the value of the
2186 global variable x rather than of the local version.}
2188 \subsection{Non-Defining Declarations}
2189 A debugging information entry that
2190 represents a non-defining
2191 \addtoindexx{non-defining declaration}
2193 \addtoindex{incomplete declaration}
2194 of a program entity has a
2195 \addtoindexx{declaration attribute}
2196 \DWATdeclaration{} attribute, which is a
2197 \livelink{chap:classflag}{flag}.
2199 \subsection{Declarations Completing Non-Defining Declarations}
2200 A debugging information entry that represents a
2201 \hypertarget{chap:DWATspecificationincompletenondefiningorseparatedeclaration}{}
2202 declaration that completes another (earlier)
2203 non\dash defining declaration may have a
2204 \DWATspecification{}
2205 attribute whose value is a \livelink{chap:classreference}{reference} to
2206 the debugging information entry representing the non-defining declaration. A debugging
2207 information entry with a
2208 \DWATspecification{}
2209 attribute does not need to duplicate information
2210 provided by the debugging information entry referenced by that specification attribute.
2212 It is not the case that all attributes of the debugging information entry referenced by a
2213 \DWATspecification{} attribute
2214 apply to the referring debugging information entry.
2217 \addtoindexx{declaration attribute}
2221 \addtoindexx{declaration attribute}
2222 clearly cannot apply to a
2223 \addtoindexx{declaration attribute}
2225 \addtoindexx{sibling attribute}
2230 \section{Declaration Coordinates}
2231 \label{chap:declarationcoordinates}
2232 \livetargi{chap:declarationcoordinates}{}{declaration coordinates}
2233 \textit{It is sometimes useful in a debugger to be able to associate
2234 a declaration with its occurrence in the program source.}
2236 Any debugging information
2237 \hypertarget{chap:DWATdeclfilefilecontainingsourcedeclaration}{}
2239 \hypertarget{chap:DWATdecllinelinenumberofsourcedeclaration}{}
2241 \hypertarget{chap:DWATdeclcolumncolumnpositionofsourcedeclaration}{}
2243 \addtoindexx{line number of declaration}
2244 declaration of an object, module, subprogram or
2245 \addtoindex{declaration column attribute}
2247 \addtoindex{declaration file attribute}
2249 \addtoindex{declaration line attribute}
2254 attributes each of whose value is an unsigned
2255 \livelink{chap:classconstant}{integer constant}.
2258 \addtoindexx{declaration file attribute}
2262 \addtoindexx{file containing declaration}
2264 a file number from the line number information table for the
2265 compilation unit containing the debugging information entry and
2266 represents the source file in which the declaration appeared
2267 (see Section \refersec{chap:linenumberinformation}).
2268 The value 0 indicates that no source file
2272 \addtoindexx{declaration line attribute}
2273 the \DWATdeclline{} attribute represents
2274 the source line number at which the first character of
2275 the identifier of the declared object appears. The value 0
2276 indicates that no source line has been specified.
2279 \addtoindexx{declaration column attribute}
2280 the \DWATdeclcolumn{} attribute represents
2281 the source column number at which the first character of
2282 the identifier of the declared object appears. The value 0
2283 indicates that no column has been specified.
2285 \section{Identifier Names}
2286 \label{chap:identifiernames}
2288 \hypertarget{chap:DWATnamenameofdeclaration}{}
2289 debugging information entry
2290 \addtoindexx{identifier names}
2292 \addtoindexx{names!identifier}
2294 that has been given a name may have a
2295 \DWATname{} attribute,
2297 \addtoindexx{name attribute}
2298 value is a \livelink{chap:classstring}{string}
2299 representing the name as it appears in
2300 the source program. A debugging information entry containing
2301 no name attribute, or containing a name attribute whose value
2302 consists of a name containing a single null byte, represents
2303 a program entity for which no name was given in the source.
2305 \textit{Because the names of program objects described by DWARF are the
2306 names as they appear in the source program, implementations
2307 of language translators that use some form of mangled name
2308 \addtoindexx{mangled names}
2309 (as do many implementations of C++) should use the unmangled
2310 form of the name in the
2311 DWARF \DWATname{} attribute,
2312 \addtoindexx{name attribute}
2313 including the keyword operator (in names such as \doublequote{operator +}),
2314 if present. See also
2315 Section \referfol{chap:linkagenames} regarding the use
2316 of \DWATlinkagename{} for
2317 \addtoindex{mangled names}.
2319 multiple whitespace characters may be compressed.}
2321 \section{Data Locations and DWARF Procedures}
2322 Any debugging information entry describing a data object (which
2323 \hypertarget{chap:DWATlocationdataobjectlocation}{}
2324 includes variables and parameters) or
2325 \livelink{chap:commonblockentry}{common blocks}
2327 \addtoindexx{location attribute}
2329 \DWATlocation{} attribute,
2330 \addtoindexx{location attribute}
2331 whose value is a location description
2332 (see Section \refersec{chap:locationdescriptions}).
2336 \addtoindex{DWARF procedure}
2337 is represented by any
2338 kind of debugging information entry that has
2339 \addtoindexx{location attribute}
2343 \addtoindexx{location attribute}
2344 If a suitable entry is not otherwise available,
2345 a DWARF procedure can be represented using a debugging
2346 \addtoindexx{DWARF procedure entry}
2347 information entry with the
2348 tag \DWTAGdwarfprocedureTARG{}
2350 \addtoindexx{location attribute}
2351 a \DWATlocation{} attribute.
2354 is called by a \DWOPcalltwo,
2357 DWARF expression operator
2358 (see Section \refersec{chap:controlflowoperations}).
2361 \section{Code Addresses and Ranges}
2362 \label{chap:codeaddressesandranges}
2363 Any debugging information entry describing an entity that has
2364 a machine code address or range of machine code addresses,
2365 which includes compilation units, module initialization,
2366 \hypertarget{chap:DWATrangesnoncontiguousrangeofcodeaddresses}{}
2367 subroutines, ordinary \nolink{blocks},
2368 try/catch \nolink{blocks} (see Section\refersec{chap:tryandcatchblockentries}),
2369 labels and the like, may have
2371 \item A \DWATlowpc{} attribute for
2372 \hypertarget{chap:DWATlowpccodeaddressorrangeofaddresses}{}
2375 \item A \DWATlowpc{}
2376 \addtoindexx{low PC attribute}
2379 \addtoindexx{high PC attribute}
2380 \hypertarget{chap:DWAThighpccontiguousrangeofcodeaddresses}{}
2381 pair of attributes for
2382 a single contiguous range of
2385 \item A \DWATranges{} attribute
2386 \addtoindexx{ranges attribute}
2387 for a non-contiguous range of addresses.
2390 In addition, a non-contiguous range of
2391 addresses may also be specified for the
2392 \DWATstartscope{} attribute.
2393 \addtoindexx{start scope attribute}
2395 If an entity has no associated machine code,
2396 none of these attributes are specified.
2398 \subsection{Single Address}
2399 When there is a single address associated with an entity,
2400 such as a label or alternate entry point of a subprogram,
2401 the entry has a \DWATlowpc{} attribute whose value is the
2402 relocated address for the entity.
2404 \textit{While the \DWATentrypc{}
2405 attribute might also seem appropriate for this purpose,
2406 historically the \DWATlowpc{} attribute was used before the
2407 \DWATentrypc{} was introduced
2408 (in \addtoindex{DWARF Version 3}). There is
2409 insufficient reason to change this.}
2412 \subsection{Continuous Address Range}
2413 \label{chap:contiguousaddressranges}
2414 When the set of addresses of a debugging information entry can
2415 be described as a single contiguous range, the entry
2416 \addtoindexx{high PC attribute}
2418 \addtoindexx{low PC attribute}
2421 \DWAThighpc{} pair of attributes.
2424 \DWATlowpc{} attribute
2425 is the relocated address of the
2426 first instruction associated with the entity. If the value of
2427 the \DWAThighpc{} is of class address, it is the relocated
2428 address of the first location past the last instruction
2429 associated with the entity; if it is of class constant, the
2430 value is an unsigned integer offset which when added to the
2431 low PC gives the address of the first location past the last
2432 instruction associated with the entity.
2434 \textit{The high PC value
2435 may be beyond the last valid instruction in the executable.}
2438 The presence of low and high PC attributes for an entity
2439 implies that the code generated for the entity is contiguous
2440 and exists totally within the boundaries specified by those
2441 two attributes. If that is not the case, no low and high PC
2442 attributes should be produced.
2444 \subsection{Non\dash Contiguous Address Ranges}
2445 \label{chap:noncontiguousaddressranges}
2446 When the set of addresses of a debugging information entry
2447 \addtoindexx{non-contiguous address ranges}
2448 cannot be described as a single contiguous range, the entry has
2449 a \DWATranges{} attribute
2450 \addtoindexx{ranges attribute}
2451 whose value is of class \livelink{chap:classrangelistptr}{rangelistptr}
2452 and indicates the beginning of a \addtoindex{range list}.
2454 a \DWATstartscope{} attribute
2455 \addtoindexx{start scope attribute}
2456 may have a value of class
2457 \livelink{chap:classrangelistptr}{rangelistptr} for the same reason.
2459 Range lists are contained in a separate object file section called
2460 \dotdebugranges{}. A
2461 \addtoindex{range list} is indicated by a
2462 \DWATranges{} attribute whose
2463 \addtoindexx{ranges attribute}
2464 value is represented as an offset from the beginning of the
2465 \dotdebugranges{} section to the beginning of the
2466 \addtoindex{range list}.
2468 If the current compilation unit contains a \DWATrangesbase{}
2469 attribute, the value of that attribute establishes a base
2470 offset within the \dotdebugranges{} section for the compilation
2471 unit. The offset given by the \DWATranges{} attribute is
2472 relative to that base.
2474 \textit{The \DWATrangesbase{} attribute is new in \addtoindex{DWARF Version 5}.
2475 The advantage of this attribute is that is reduces the number of
2476 object language relocations needed for references to the \dotdebugranges{}
2477 section from one for each reference to a single relocation that
2478 applies for the entire compilation unit.}
2480 Each entry in a \addtoindex{range list} is either a
2481 \addtoindex{range list} entry,
2482 \addtoindexx{base address selection entry!in range list}
2483 a base address selection entry, or an
2484 \addtoindexx{end of list entry!in range list}
2487 A \addtoindex{range list} entry consists of:
2488 \begin{enumerate}[1. ]
2489 \item A beginning address offset. This address offset has the
2490 \addtoindex{size of an address} and is relative to
2491 the applicable base address of the compilation unit referencing this
2492 \addtoindex{range list}.
2495 \addtoindexi{address}{address range!in range list}
2498 \item An ending address offset. This address offset again has the
2499 \addtoindex{size of an address} and is relative
2500 to the applicable base address of the compilation unit referencing
2501 this \addtoindex{range list}.
2503 first address past the end of the address range.
2504 The ending address must be greater than or
2505 equal to the beginning address.
2507 \textit{A \addtoindex{range list} entry (but not a base address selection or end of list entry) whose beginning and
2508 ending addresses are equal has no effect because the size of the range covered by such an
2512 The applicable base address of a \addtoindex{range list} entry
2514 by the closest preceding base address selection entry (see
2515 below) in the same range list. If there is no such selection
2516 entry, then the applicable base address defaults to the base
2517 address of the compilation unit
2518 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2520 \textit{In the case of a compilation unit where all of the machine
2521 code is contained in a single contiguous section, no base
2522 address selection entry is needed.}
2524 Address range entries in
2525 a \addtoindex{range list} may not overlap.
2526 There is no requirement that
2527 the entries be ordered in any particular way.
2530 A base address selection entry consists of:
2531 \begin{enumerate}[1. ]
2532 \item The value of the largest representable address offset (for example, \wffffffff when the size of
2533 an address is 32 bits).
2535 \item An address, which defines the appropriate base address for use in interpreting the beginning
2536 and ending address offsets of subsequent entries of the location list.
2538 \textit{A base address selection entry
2539 affects only the list in which it is contained.}
2542 The end of any given \addtoindex{range list} is marked by an
2543 \addtoindexx{end of list entry!in range list}
2545 which consists of a 0 for the beginning address
2546 offset and a 0 for the ending address offset.
2547 A \addtoindex{range list}
2548 containing only an end of list entry describes an empty scope
2549 (which contains no instructions).
2551 \textit{A base address selection entry and an
2552 \addtoindexx{end of list entry!in range list}
2553 end of list entry for
2554 a \addtoindex{range list}
2555 are identical to a base address selection entry
2556 and end of list entry, respectively, for a location list
2557 (see Section \refersec{chap:locationlists})
2558 in interpretation and representation.}
2562 \section{Entry Address}
2563 \label{chap:entryaddress}
2564 \textit{The entry or first executable instruction generated
2565 for an entity, if applicable, is often the lowest addressed
2566 instruction of a contiguous range of instructions. In other
2567 cases, the entry address needs to be specified explicitly.}
2569 Any debugging information entry describing an entity that has
2570 a range of code addresses, which includes compilation units,
2571 module initialization, subroutines,
2572 ordinary \livelink{chap:lexicalblock}{block},
2573 try/catch \nolink{blocks} (see Section
2574 \refersec{chap:tryandcatchblockentries}),
2575 and the like, may have a \DWATentrypcNAME{} attribute to
2576 indicate the first executable instruction within that range
2577 \hypertarget{chap:entryaddressofscope}{}
2578 of addresses. The value of the \DWATentrypcNAME{} attribute is a
2579 relocated address if the
2580 value of \DWATentrypcNAME{} is of class address; or if it is of class
2581 constant, the value is an unsigned integer offset which, when
2582 added to the base address of the function, gives the entry
2585 The base address of the containing scope is given by either the
2586 \DWATlowpc{} attribute, or the first range entry in the list of
2587 ranges given by the \DWATranges{} attribute.
2588 If no \DWATentrypcNAME{} attribute is present,
2589 then the entry address is assumed to be the same as the
2590 value of the \DWATlowpc{} attribute, if present; otherwise,
2591 the entry address is unknown.
2593 \section{Static and Dynamic Values of Attributes}
2594 \label{chap:staticanddynamicvaluesofattributes}
2596 Some attributes that apply to types specify a property (such
2597 as the lower bound of an array) that is an integer value,
2598 where the value may be known during compilation or may be
2599 computed dynamically during execution.
2602 attributes is determined based on the class as follows:
2604 \item For a \livelink{chap:classconstant}{constant}, the value of the constant is the value of
2607 \item For a \livelink{chap:classreference}{reference}, the
2608 value is a DWARF procedure that computes the value of the attribute.
2610 \item For an \livelink{chap:classexprloc}{exprloc}, the value is interpreted as a
2612 evaluation of the expression yields the value of
2617 Whether an attribute value can be dynamic depends on the
2618 rules of the applicable programming language.
2621 \textit{The applicable attributes include:
2633 (and possibly others).}
2636 \section{Entity Descriptions}
2637 \textit{Some debugging information entries may describe entities
2638 in the program that are artificial, or which otherwise are
2639 \doublequote{named} in ways which are not valid identifiers in the
2640 programming language. For example, several languages may
2641 capture or freeze the value of a variable at a particular
2642 point in the program.
2643 \addtoindex{Ada} 95 has package elaboration routines,
2644 type descriptions of the form typename\textquoteright Class, and
2645 \doublequote{access typename} parameters. }
2647 Generally, any debugging information
2649 \hypertarget{chap:DWATdescriptionartificialnameordescription}{}
2651 \addtoindexx{name attribute}
2653 \DWATname{} attribute, may
2655 \addtoindexx{description attribute}
2657 \DWATdescription{} attribute whose value is a
2658 null-terminated string providing a description of the entity.
2661 \textit{It is expected that a debugger will only display these
2662 descriptions as part of the description of other entities. It
2663 should not accept them in expressions, nor allow them to be
2664 assigned, or the like.}
2666 \section{Byte and Bit Sizes}
2667 \label{chap:byteandbitsizes}
2668 % Some trouble here with hbox full, so we try optional word breaks.
2669 Many debugging information entries allow either a
2670 \DWATbytesize{} attribute or a
2671 \DWATbitsize{} attribute,
2672 whose \livelink{chap:classconstant}{integer constant} value
2673 (see Section \ref{chap:staticanddynamicvaluesofattributes})
2675 amount of storage. The value of the
2676 \DWATbytesize{} attribute
2677 is interpreted in bytes and the value of the
2679 attribute is interpreted in bits. The
2680 \DWATstringlengthbytesize{} and
2681 \DWATstringlengthbitsize{}
2682 attributes are similar.
2684 In addition, the \livelink{chap:classconstant}{integer constant}
2685 value of a \DWATbytestride{} attribute is interpreted
2686 in bytes and the \livelink{chap:classconstant}{integer constant} value of a
2688 attribute is interpreted in bits.
2690 \section{Linkage Names}
2691 \label{chap:linkagenames}
2692 \textit{Some language implementations, notably
2693 \addtoindex{C++} and similar
2695 make use of implementation-defined names within
2696 object files that are different from the identifier names
2697 (see Section \refersec{chap:identifiernames}) of entities as they appear in the
2698 source. Such names, sometimes known
2699 \addtoindexx{names!mangled}
2701 \addtoindex{mangled names},
2702 are used in various ways, such as: to encode additional
2703 information about an entity, to distinguish multiple entities
2704 that have the same name, and so on. When an entity has an
2705 associated distinct linkage name it may sometimes be useful
2706 for a producer to include this name in the DWARF description
2707 of the program to facilitate consumer access to and use of
2708 object file information about an entity and/or information
2709 \hypertarget{chap:DWATlinkagenameobjectfilelinkagenameofanentity}{}
2710 that is encoded in the linkage name itself.
2713 % Some trouble maybe with hbox full, so we try optional word breaks.
2715 information entry may have
2716 \addtoindexx{linkage name attribute}
2720 whose value is a null-terminated string describing the object
2721 file linkage name associated with the corresponding entity.
2723 % Some trouble here with hbox full, so we try optional word breaks.
2724 \textit{Debugging information entries to which \DWATlinkagename{}
2725 may apply include: \DWTAGcommonblock, \DWTAGconstant,
2726 \DWTAGentrypoint, \DWTAGsubprogram{}
2730 \section{Template Parameters}
2731 \label{chap:templateparameters}
2733 In \addtoindex{C++}, a template is a generic definition of a class, function, member
2734 function, or typedef (alias). A template has formal parameters that
2735 can be types or constant values; the class, function,
2736 member function, or typedef is instantiated differently for each
2737 distinct combination of type or value actual parameters. DWARF does
2738 not represent the generic template definition, but does represent each
2742 A debugging information entry that represents a
2743 \addtoindex{template instantiation}
2744 will contain child entries describing the actual template parameters.
2745 The containing entry and each of its child entries reference a template
2746 parameter entry in any circumstance where the template definition
2747 referenced a formal template parameter.
2749 A template type parameter is represented by a debugging information
2751 \addtoindexx{template type parameter entry}
2752 \DWTAGtemplatetypeparameterTARG.
2753 A template value parameter is represented by a debugging information
2755 \addtoindexx{template value parameter entry}
2756 \DWTAGtemplatevalueparameterTARG.
2757 The actual template parameter entries appear in the same order as the
2758 corresponding template formal parameter declarations in the
2762 A type or value parameter entry may have a \DWATname{} attribute,
2763 \addtoindexx{name attribute}
2765 null\dash terminated string containing the name of the corresponding
2766 formal parameter as it appears in the source program.
2767 The entry may also have a
2768 \DWATdefaultvalue{} attribute, which is a flag indicating
2769 that the value corresponds to the default argument for the
2774 \addtoindexx{formal type parameter|see{template type parameter entry}}
2775 template type parameter entry has a
2776 \addtoindexx{type attribute}
2777 \DWATtype{} attribute
2778 describing the actual type by which the formal is replaced.
2781 A template value parameter entry has a \DWATtype{} attribute
2782 describing the type of the parameterized value.
2783 The entry also has an attribute giving the
2784 actual compile-time or run-time constant value
2785 of the value parameter for this instantiation.
2787 \DWATconstvalue{}\livetarg{chap:DWATconstvaluetemplatevalueparameter}{}
2789 value is the compile-time constant value as represented
2790 on the target architecture.
2791 Or, the attribute can be a \DWATlocation{} attribute, whose value is a
2792 single location description for the run-time constant address.