March/April review.
Signed-off-by: Ron Brender <ron.brender@gmail.com>
&\livelink{chap:DWATpicturestring}{DW\-\_AT\-\_picture\-\_string} \\
&\livelink{chap:DWATsibling}{DW\-\_AT\-\_sibling} \\
&\livelink{chap:DWATsmall}{DW\-\_AT\-\_small} \\
-\\
\hline
\livelink{chap:DWTAGcatchblock}{DW\-\_TAG\-\_catch\-\_block}
&\livelink{chap:DWATname}{DW\-\_AT\-\_name} \\
&\livelink{chap:DWATsibling}{DW\-\_AT\-\_sibling} \\
&\livelink{chap:DWATtype}{DW\-\_AT\-\_type} \\
-\\
-\\
\hline
\livelink{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}
with no
\livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute),
or if the location attribute is present but has
-an empty location description (as described in Section 2.6),
+an empty location description (as described in Section \refersec{chap:locationdescriptions}),
\addtoindexx{unallocated variable}
the variable is assumed to exist in the source code but not
in the executable program (but see number 10, below).
attribute\addtoindexx{variable parameter attribute},
which is a \livelink{chap:flag}{flag},
if a formal parameter entry represents a parameter whose
-value in the calling function may be modified by the callee..
+value in the calling function may be modified by the callee.
The absence of this attribute implies that the parameter’s
value in the calling function cannot be modified by the callee.
or an entry describing a named constant. (Note that such
an entry does not have a location attribute.) The value of
this attribute may be a string or any of the constant data
-or data \livelink{chap:block}{block} forms,
+or data block forms,
as appropriate for the representation
-of the variable’s value. The value is the actual constant
+of the variable's value. The value is the actual constant
value of the variable, represented as it would be on the
target architecture.
to a constant actual parameter of a call that is inlined.
}
-\item A \livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope} attribute if the scope of
+\item A \livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope}
+attribute if the scope of
\addtoindexx{start scope attribute}
an
\hypertarget{chap:DWATstartscopeobjectdeclaration}
\hypertarget{chap:DWATconstexprcompiletimeconstantobject}
is a \livelink{chap:flag}{flag}, if a
variable entry represents a C++ object declared with the
-\textit{constexpr} specifier. This attributes indicates that the
+\textit{constexpr} specifier. This attribute indicates that the
variable can be evaluated as a compile\dash time constant.
\textit{In C++,
a variable declared with constexpr is implicitly const. Such a
variable has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose value is a reference
-to a debugging information entry}
+to a debugging information entry describing a const qualified type.}
\item A \livelink{chap:DWATlinkagename}{DW\-\_AT\-\_linkage\-\_name} attribute for a
variable or constant entry as described in
be described by a debugging
information entry with the
tag \livetarg{chap:DWTAGcommonblock}{DW\-\_TAG\-\_common\-\_block}.
-The
-common \nolink{block}
+
+The common \nolink{block}
entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
\addtoindexx{name attribute}
whose value
also has a \livelink{chap:DWATlocation}{DW\-\_AT\-\_location} attribute
\addtoindexx{location attribute}
whose value describes the
-location of the beginning of the common \nolink{block}. The common
+location of the beginning of the common \nolink{block}.
+
+The common
\nolink{block} entry owns debugging information entries describing
the variables contained within the common \nolink{block}.
that occurs at the beginning of the CIE and FDE structures
in the \addtoindex{.debug\_frame} section.
-In an \addtoindex{initial length field}, the values 0xfffffff0 through
-0xffffffff are reserved by DWARF to indicate some form of
+In an \addtoindex{initial length field}, the values \wfffffffzero through
+\wffffffff are reserved by DWARF to indicate some form of
extension relative to \addtoindex{DWARF Version 2}; such values must not
be interpreted as a length field. The use of one such value,
-0xffffffff, is defined below
+\xffffffff, is defined below
(see Section \refersec{datarep:32bitand64bitdwarfformats});
the use of
the other values is reserved for possible future extensions.
\item In the 32\dash bit DWARF format, an
\addtoindex{initial length field}
(see
-\addtoindex{initial length field!encoding}
+\addtoindexx{initial length field!encoding}
Section \refersec{datarep:initiallengthvalues})
is an unsigned 32\dash bit integer (which
-must be less than 0xfffffff0); in the 64\dash bit DWARF format,
+must be less than \xfffffffzero); in the 64\dash bit DWARF format,
an \addtoindex{initial length field} is 96 bits in size,
and has two parts:
\begin{itemize}
-\item The first 32\dash bits have the value 0xffffffff.
+\item The first 32\dash bits have the value \xffffffff.
\item The following 64\dash bits contain the actual length
represented as an unsigned 64\dash bit integer.
fields that occur
\addtoindexx{section offset!use in headers}
in the headers of DWARF sections (other
-\addtoindex{initial length field}
+\addtoindexx{initial length field}
than
\addtoindex{initial length}
fields) are listed following. In the 32\dash bit DWARF format these
\begin{center}
\begin{tabular}{lll}
Section &Name & Role \\ \hline
-\addtoindex{.debug\_ranges} & \addtoindex{debug\_info\_offset} & offset in \addtoindex{.debug\_info} \\
+\addtoindex{.debug\_aranges} & \addtoindex{debug\_info\_offset} & offset in \addtoindex{.debug\_info} \\
\addtoindex{.debug\_frame}/CIE & \addtoindex{CIE\_id} & CIE distinguished value \\
\addtoindex{.debug\_frame}/FDE & \addtoindex{CIE\_pointer} & offset in \addtoindex{.debug\_frame} \\
\addtoindex{.debug\_info} & \addtoindex{debug\_abbrev\_offset} & offset in \addtoindex{.debug\_abbrev} \\
\addtoindex{.debug\_pubtypes} & \addtoindex{debug\_info\_offset} & offset in \addtoindex{.debug\_info} \\
& \addtoindex{debug\_info\_length} & length of \addtoindex{.debug\_info} \\
& & contribution \\
-\addtoindex{.debug\_types} & \addtoindex{debug\_abbrev\_offset} & offset in \addtoindex{.debug\_info} \\
+\addtoindex{.debug\_types} & \addtoindex{debug\_abbrev\_offset} & offset in \addtoindex{.debug\_abbrev} \\
& \addtoindex{type\_offset} & offset in of \addtoindex{.debug\_types} \\
\end{tabular}
\end{center}
-\textit{The CIE\_id field in a CIE structure must be 64 bits because
+The CIE\_id field in a CIE structure must be 64 bits because
it overlays the CIE\_pointer in a FDE structure; this implicit
union must be accessed to distinguish whether a CIE or FDE is
present, consequently, these two fields must exactly overlay
-each other (both offset and size).}
+each other (both offset and size).
\item Within the body of the \addtoindex{.debug\_info} or \addtoindex{.debug\_types}
section, certain forms of attribute value depend on the choice
\begin{tabular}{ll}
Form & Role \\ \hline
\livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}& offset in \addtoindex{.debug\_info} \\
-\livetarg{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}&
- \parbox{5.5cm}{offset in a section other than \addtoindex{.debug\_info} or \addtoindex{.debug\_str}} \\
+\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}& offset in a section other than \\
+ &\addtoindex{.debug\_info} or \addtoindex{.debug\_str} \\
\livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}&offset in \addtoindex{.debug\_str} \\
\livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}&offset in \addtoindex{.debug\_info} \\
\end{tabular}
\end{enumerate}
-The 32\dash bit and 64\dash bit DWARF format conventions must not be
+The 32\dash bit and 64\dash bit DWARF format conventions must \emph{not} be
intermixed within a single compilation unit.
\textit{Attribute values and section header fields that represent
implementation is not required to guarantee detection and
reporting of all such errors.)
-\textit{It is expected that DWARF producing compilers will not use
-the 64\dash bit format by default. In most cases, the division of
+\textit{It is expected that DWARF producing compilers will \textbf{not} use
+the 64\dash bit format \textbf{by default}. In most cases, the division of
even very large applications into a number of executable and
shared objects will suffice to assure that the DWARF sections
within each individual linked object are less than 4 GBytes
contribution for that compilation unit,
not including the length field itself. In the 32\dash bit DWARF
format, this is a 4\dash byte unsigned integer (which must be less
-than 0xfffffff0); in the 64\dash bit DWARF format, this consists
-of the 4\dash byte value 0xffffffff followed by an 8\dash byte unsigned
+than \xfffffffzero); in the 64\dash bit DWARF format, this consists
+of the 4\dash byte value \wffffffff followed by an 8\dash byte unsigned
integer that gives the actual length
(see Section \refersec{datarep:32bitand64bitdwarfformats}).
-\item version (\addtoindex{uhalf})
+\item version (\addtoindex{uhalf}) \\
A 2\dash byte unsigned integer representing the version of the
-DWARF information for the compilation unit\addtoindexx{version number!compilation unit}
+DWARF information for the compilation unit \addtoindexx{version number!compilation unit}
(see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
The value in this field is 4.
offset portion of an address.
-
-
\end{enumerate}
\subsubsection{Type Unit Header}
of the \addtoindex{.debug\_types} contribution for that compilation unit,
not including the length field itself. In the 32\dash bit DWARF
format, this is a 4\dash byte unsigned integer (which must be
-less than 0xfffffff0); in the 64\dash bit DWARF format, this
-consists of the 4\dash byte value 0xffffffff followed by an
+less than \xfffffffzero); in the 64\dash bit DWARF format, this
+consists of the 4\dash byte value \wffffffff followed by an
8\dash byte unsigned integer that gives the actual length
(see Section \refersec{datarep:32bitand64bitdwarfformats}).
-\item version (\addtoindex{uhalf})
+\item version (\addtoindex{uhalf}) \\
A 2\dash byte unsigned integer representing the version of the
DWARF information for the
compilation unit\addtoindexx{version number!type unit}
\addtoindexx{type signature}
A
\addtoindexx{type\_signature}
-64\dash bit unique signature of the type described in this type
+64\dash bit unique signature (see Section
+\refersec{datarep:typesignaturecomputation})
+of the type described in this type
unit.
-\textit{An attribute that refers(using \livelink{chap:DWFORMrefsig8}{DW\-\_FORM\-\_ref\-\_sig8}) to
-the primary type contained in
-this \addtoindex{type unit} uses this value.}
+\textit{An attribute that refers (using
+\livelink{chap:DWFORMrefsig8}{DW\-\_FORM\-\_ref\-\_sig8}) to
+the primary type contained in this
+\addtoindex{type unit} uses this value.}
\item type\_offset (section offset) \\
Section \refersec{chap:relationshipofdebugginginformationentries},
each chain of sibling entries is terminated by a null entry.)
+\needlines{6}
\begin{centering}
\setlength{\extrarowheight}{0.1cm}
\begin{longtable}{l|l}
\livelink{chap:DWATsibling}{DW\-\_AT\-\_sibling}&0x01&reference
\addtoindexx{sibling attribute!encoding} \\
\livelink{chap:DWATlocation}{DW\-\_AT\-\_location}&0x02&\livelink{chap:exprloc}{exprloc},
- \livelink{chap:loclistptr}{loclistptr}\addtoindex{location attribute!encoding} \\
+ \livelink{chap:loclistptr}{loclistptr}\addtoindexx{location attribute!encoding} \\
\livelink{chap:DWATname}{DW\-\_AT\-\_name}&0x03&string
\addtoindexx{name attribute!encoding} \\
\livelink{chap:DWATordering}{DW\-\_AT\-\_ordering}&0x09&constant
\livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}&0x0d&constant,
\livelink{chap:exprloc}{exprloc}, reference \addtoindexx{bit size attribute!encoding} \\
\livelink{chap:DWATstmtlist}{DW\-\_AT\-\_stmt\-\_list}&0x10&\livelink{chap:lineptr}{lineptr}
- \addtoindex{statement list attribute!encoding} \\
+ \addtoindexx{statement list attribute!encoding} \\
\livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc}&0x11&address
\addtoindexx{low PC attribute!encoding} \\
\livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc}&0x12&address, constant
\livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr}&0x2a&\livelink{chap:exprloc}{exprloc},
\livelink{chap:loclistptr}{loclistptr} \addtoindexx{return address attribute!encoding} \\
% FIXME: lower case , not Constant
-\livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope}&0x2c&Constant,
+\livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope}&0x2c&constant,
\livelink{chap:rangelistptr}{rangelistptr} \addtoindexx{start scope attribute!encoding} \\
\livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}&0x2e&constant,
\livelink{chap:exprloc}{exprloc}, reference \addtoindexx{bit stride attribute!encoding} \\
\livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc}&0x52&address
\addtoindexx{entry pc attribute!encoding} \\
\livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8}&0x53&\livelink{chap:flag}{flag}
- \addtoindexx{use UTF8 attribute!encoding}\addtoindex{UTF-8} \\
+ \addtoindexx{use UTF8 attribute!encoding}\addtoindexx{UTF-8} \\
\livelink{chap:DWATextension}{DW\-\_AT\-\_extension}&0x54&reference
\addtoindexx{extension attribute!encoding} \\
\livelink{chap:DWATranges}{DW\-\_AT\-\_ranges}&0x55&\livelink{chap:rangelistptr}{rangelistptr}
128& 0 + 0x80 & 1 \\
-128& 0 + 0x80 & 0x7f \\
129& 1 + 0x80 & 1 \\
--129& -x7f + 0x80 & 0xtc \\
+-129& 0x7f + 0x80 & 0x7e \\
\end{longtable}
\end{centering}
\livelink{chap:DWOPshr}{DW\-\_OP\-\_shr}&0x25&0 & \\
\livelink{chap:DWOPshra}{DW\-\_OP\-\_shra}&0x26&0 & \\
\livelink{chap:DWOPxor}{DW\-\_OP\-\_xor}&0x27&0 & \\
-\livelink{chap:DWOPskip}{DW\-\_OP\-\_skip}&0x2f&1&signed 2\dash byte constant \\
+
\livelink{chap:DWOPbra}{DW\-\_OP\-\_bra}&0x28&1 & signed 2\dash byte constant \\
\livelink{chap:DWOPeq}{DW\-\_OP\-\_eq}&0x29&0 & \\
\livelink{chap:DWOPge}{DW\-\_OP\-\_ge}&0x2a&0 & \\
\livelink{chap:DWOPgt}{DW\-\_OP\-\_gt}&0x2b&0 & \\
\livelink{chap:DWOPle}{DW\-\_OP\-\_le}&0x2c&0 & \\
\livelink{chap:DWOPlt}{DW\-\_OP\-\_lt}&0x2d&0 & \\
-\livelink{chap:DWOPne}{DW\-\_OP\-\_ne}&0x2e&0 & \\ \hline
-
-
+\livelink{chap:DWOPne}{DW\-\_OP\-\_ne}&0x2e&0 & \\
+\livelink{chap:DWOPskip}{DW\-\_OP\-\_skip}&0x2f&1&signed 2\dash byte constant \\ \hline
\livelink{chap:DWOPlit0}{DW\-\_OP\-\_lit0}&0x30 & 0 & \\
-
\livelink{chap:DWOPlit1}{DW\-\_OP\-\_lit1}&0x31 & 0& literals 0 .. 31 = \\
\ldots & & &\hspace{0.5cm}(\livelink{chap:DWOPlit0}{DW\-\_OP\-\_lit0} + literal) \\
\livelink{chap:DWOPlit31}{DW\-\_OP\-\_lit31}&0x4f & 0 & \\ \hline
Each entry in a \addtoindex{location list} is either a location list entry,
a base address selection entry, or an
-\addtoindex{end of list entry!in location list}
+\addtoindexx{end of list entry!in location list}
end of list entry.
A \addtoindex{location list} entry consists of two address offsets followed
are the same size as an address on the target machine.
A base address selection entry and an
-\addtoindex{end of list entry!in location list}
+\addtoindexx{end of list entry!in location list}
end of list entry each
consist of two (constant or relocated) address offsets. The two
offsets are the same size as an address on the target machine.
contribution for that compilation unit,
not including the length field itself. In the 32\dash bit DWARF
format, this is a 4\dash byte unsigned integer (which must be less
-than 0xfffffff0); in the 64\dash bit DWARF format, this consists
-of the 4\dash byte value 0xffffffff followed by an 8\dash byte unsigned
+than \xfffffffzero); in the 64\dash bit DWARF format, this consists
+of the 4\dash byte value \wffffffff followed by an 8\dash byte unsigned
integer that gives the actual length
(see Section \refersec{datarep:32bitand64bitdwarfformats}).
-\item version (\addtoindex{uhalf})
+\item version (\addtoindex{uhalf}) \\
A 2\dash byte unsigned integer representing the version of the
-DWARF information\addtoindexx{version number!compilation unit} for the compilation unit
+DWARF information for the name lookup table
\addtoindexx{version number!name lookup table}
(see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
-The value in this field is 4.
+The value in this field is 2.
% Some say unsigned offset this just says offset: FIXME
\item \addtoindex{debug\_info\_offset} (section offset) \\
\addtoindexx{initial length}
set of entries for this compilation unit, not including the
length field itself. In the 32-bit DWARF format, this is a
-4-byte unsigned integer (which must be less than 0xfffffff0);
+4-byte unsigned integer (which must be less than \xfffffffzero);
in the 64-bit DWARF format, this consists of the 4-byte value
-0xffffffff followed by an 8-byte unsigned integer that gives
+\wffffffff followed by an 8-byte unsigned integer that gives
the actual length
(see Section \refersec{datarep:32bitand64bitdwarfformats}).
\item version (\addtoindex{uhalf}) \\
-A 2\dash byte version identifier
-\addtoindexx{version number!address range table} containing the value 2
-(see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
+A 2\dash byte version identifier representing the version of the
+DWARF information for the address range table
+(see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
+This value in this field \addtoindexx{version number!address range table} is 2.
+
\item debug\_info\_offset (section offset) \\
A
\label{datarep:callframeinformation}
In the 32\dash bit DWARF format, the value of the CIE id in the
-CIE header is 0xffffffff; in the 64\dash bit DWARF format, the
-value is 0xffffffffffffffff.
+CIE header is \xffffffff; in the 64\dash bit DWARF format, the
+value is \xffffffffffffffff.
The value of the CIE \addtoindexi{version number}{version number!call frame information}
is 4 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
Call frame instructions are encoded in one or more bytes. The
primary opcode is encoded in the high order two bits of
-the first byte (that is, opcode = byte >> 6). An operand
+the first byte (that is, opcode = byte $\gg$ 6). An operand
or extended opcode may be encoded in the low order 6
bits. Additional operands are encoded in subsequent bytes.
The instructions and their encodings are presented in
addresses are the same size as addresses on the target machine.
A base address selection entry and an
-\addtoindex{end of list entry!in range list}
+\addtoindexx{end of list entry!in range list}
end of list entry each
\addtoindexx{base address selection entry!in range list}
consist of two (constant or relocated) addresses. The two
(e.g., the mangled linker name).
-\item 6.If the tag in Step 3 is not one of \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type},
+\item If the tag in Step 3 is not one of \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type},
\livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type},
\livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type},
\livelink{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}, or
cases, information in one section refers to information in one
or more of the others. These relationships are illustrated by
the diagram and associated notes on the following pages.
-\clearpage
-\setlength\maxovaldiam{80pt}
-\thicklines
-\begin{picture}(0,0)
+\begin{figure}[h]
+% picture gets width and height of the picture drawn
+% so latex knows how big it is (latex does not calculate
+% the space you need to make it fit, you do).
+\begin{picture}(320,300)
+% Footnotesize keeps the text small-size so it fits
+% in the boxes and ellipses
\footnotesize
- \put(10,0) { \addtoindex{.debug\_aranges} }
- \put(40,0) { \circle{80}}
- \put(180,0) { \addtoindex{.debug\_frame} }
- \put(210,0) { \circle{80}}
- \put(350,0) { \addtoindex{.debug\_abbrev} }
- \put(380,0) { \circle{80}}
+% Thicklines makes the lines more visible.
+\Thicklines
+ \put(5,208) { \addtoindex{.debug\_aranges} }
+ \put(40,210) { \ellipse{80}{30}}
+ \put(180,208) { \addtoindex{.debug\_frame} }
+ \put(210,210) { \ellipse{80}{30}}
+ \put(347,208) { \addtoindex{.debug\_abbrev} }
+ \put(380,210) { \ellipse{80}{30}}
+
+ \drawline[1](40,195)(40,181)
+ \put(-10,165){\framebox(110,15){To compilation unit (a)} }
+ \drawline[1](40,165)(40,151)(37,158)
+ \put(352,168) { \addtoindex{.debug\_str} }
+ \put(380,170) {\ellipse{80}{30}}
+
+ \put(10,133) { \addtoindex{.debug\_info} }
+ \put(10,123) { \addtoindex{.debug\_types} }
+ \put(40,130) {\ellipse{80}{40}}
- \put(40,-40){\line(0,-1){30}}
- \put(-10,-90){\framebox(110,20){To compilation unit (a)} }
- \put(40,-90){\vector(0,-1){35}}
- \put(350,-90) { \addtoindex{.debug\_str} }
- \put(380,-90) {\circle{80}}
+ \put(350,128) { \addtoindex{.debug\_loc} }
+ \put(380,130) {\ellipse{80}{30}}
- \put(10,-180) { \addtoindex{.debug\_info} }
- \put(40,-180) {\circle{100}}
- \put(10,-195) { \addtoindex{.debug\_types} }
+ \put(345,88) { \addtoindex{.debug\_ranges} }
+ \put(380,90) {\ellipse{80}{30}}
+ \drawline[1](75,141)(160,170)
+ \put(160,165){\framebox(110,15){To abbreviations (c)} }
+ \drawline[1](271,176)(345,205)(335,197)
- \put(350,-180) { \addtoindex{.debug\_loc} }
- \put(380,-180) {\circle{80}}
+ \put(76,138){\line(6, 1){83}}
+ \put(160,140){\framebox(110,15){\livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp} (d)} }
+ \drawline[1](271,150)(341,168)(332,162)
- \put(350,-270) { \addtoindex{.debug\_ranges} }
- \put(380,-270) {\circle{80}}
+ \drawline[1](160,125)(80,130)(90,134)
+ \put(160,115){\framebox(110,15){\livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}(e)} }
+ \drawline[1](271,125)(340,128)
- \put(80,-140){\line(3, 2){90}}
- \put(170,-90){\framebox(110,20){To abbreviations (c)} }
- \put(280,-70){\vector( 2, 1){70}}
+ \drawline[1](79,128)(160,100)
+ \put(160,90){\framebox(110,15){\livelink{chap:DWATlocation}{DW\-\_AT\-\_location} etc (f)} }
+ \drawline[1](271,100)(341,125)(332,118)
- \put(90,-150){\line(2, 1){100}}
- \put(190,-120){\framebox(110,20){\livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp} (d)} }
- \put(300,-100){\vector( 4, 1){35}}
+ \drawline(79,125)(160,75)
+ \put(160,65){\framebox(110,15){\livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} (g)} }
+ \drawline(271,75)(340,90)(332,85)
- \put(190,-140){\vector(-2, -1){100}}
- \put(190,-150){\framebox(110,20){\livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}(e)} }
- \put(300,-150){\line(4,-1){40}}
+ \drawline[1](77,121)(160,46)
+ \put(160,40){\framebox(110,15){\livelink{chap:DWATmacroinfo}{DW\-\_AT\-\_macro\-\_info} (h)} }
+ \drawline[1](271,46)(343,53)(332,49)
- \put(90,-195){\line(7,2){95}}
- \put(190,-180){\framebox(110,20){\livelink{chap:DWATlocation}{DW\-\_AT\-\_location}(f)} }
- \put(300,-180){\vector(1,0){40}}
+ \drawline[1](71, 116)(160,20)
+ \put(160,15){\framebox(110,15){\livelink{chap:DWATstmtlist}{DW\-\_AT\-\_stmt\-\_list} (i)} }
+ \drawline[1](271,20)(343,10)(332,8)
- \put(90,-195){\line(7,-2){95}}
- \put(190,-230){\framebox(110,20){\livelink{chap:DWATranges}{DW\-\_AT\-\_ranges} (g)} }
- \put(300,-230){\vector(4,-3){40}}
+ \drawline[1](40,70)(40,110)(37,103)
+ \put(-10,55){\framebox(110,15){To compilation unit (b)} }
+ \drawline[1](40,35)(40,54)
- \put(85,-200){\line(3,-2){95}}
- \put(180,-270){\framebox(110,20){\livelink{chap:DWATmacroinfo}{DW\-\_AT\-\_macro\-\_info} (h)} }
- \put(230,-270){\vector(3,-2){110}}
+ \put(0,16) { \addtoindex{.debug\_pubnames} }
+ \put(0,6) { \addtoindex{.debug\_pubtypes} }
+ \put(40, 15) { \ellipse{100}{40}}
- \put(85,-200){\line(1,-1){80}}
- \put(120,-300){\framebox(110,20){\livelink{chap:DWATstmtlist}{DW\-\_AT\-\_stmt\-\_list} (i)} }
- \put(180,-300){\vector(1,-2){10}}
- \put(40,-250){\vector(0,1){15}}
- \put(-10,-270){\framebox(110,20){To compilation unit (b)} }
- \put(40,-320){\line(0,1){50}}
+ \put(345,48) { \addtoindex{.debug\_macinfo} }
+ \put(380,50) { \ellipse{80}{30}}
- \put(0,-360) { \addtoindex{.debug\_pubnames} }
- \put(0,-375) { \addtoindex{.debug\_pubtypes} }
- \put(40, -360) { \circle{80}}
- \put(175,-360) { \addtoindex{.debug\_line} }
- \put(210,-360) { \circle{80}}
- \put(350,-360) { \addtoindex{.debug\_macinfo} }
- \put(380,-360) { \circle{80}}
+ \put(350,8) { \addtoindex{.debug\_line} }
+ \put(380,10) { \ellipse{80}{30}}
\end{picture}
+\caption{Debug section relationships}
+\label{fig:debugsectionrelationships}
+\end{figure}
\clearpage
\begin{center}
% If draft is in the document class list, pix are just suggested
% by an outline, the pic does not appear as a picture.
%
-\newcommand{\docdate}{10 February 2013 (***Draft***)}
+\newcommand{\docdate}{19 April 2013 (***Draft***)}
%
-\usepackage{url} % For color in letters. Links instead?
-\usepackage{color} % For color in letters. Links instead?
-\usepackage{ellipsis} % Provides ... as \dots
-\usepackage{color}
+\usepackage{url} % For color in letters. Links instead?
+\usepackage[usenames]{color} % For color in letters. Links instead?
+\usepackage{ellipsis} % Provides ... as \dots
+%\usepackage{color}
\usepackage{listings}
\usepackage{alltt}
\lstset{ %
\usepackage{changepage} % For odd/even page checks
\usepackage{epic} % For eepic package
\usepackage{eepic} % For the diagram of section relationships
+\usepackage{eepicemu} % For the diagram of section relationships
\usepackage{makeidx} % For making an index
% hyperref must be the last package listed.
% The hyperref settings helps hypertext get right links in the
% pdf of the index.
-\usepackage[plainpages=false,pdfpagelabels,pagebackref]{hyperref} % Lets us generate colored active links inside a pdf.
+\usepackage[plainpages=false,pdfpagelabels,pagebackref,allcolors=blue]{hyperref} % Lets us generate colored active links inside a pdf.
\makeindex % This and the makeidx package allow \index to create index entries.
\renewcommand{\familydefault}{phv} % font family helvetica
\end{table}
}
+\newcommand{\xffffffff} {\texttt{0xffffffff}} % use with following punctutation
+\newcommand{\wffffffff} {\texttt{0xffffffff}\ } % use as separate "word"
+\newcommand{\xfffffffzero} {\texttt{0xfffffff0}} % use with following punctutation
+\newcommand{\wfffffffzero} {\texttt{0xfffffff0}\ }
+\newcommand{\xffffffffffffffff} {\texttt{0xffffffffffffffff}} % use with following punctutation
+\newcommand{\wffffffffffffffff} {\texttt{0xffffffffffffffff}\ }
+
%--- Begin the document pages
%
\begin{document}
\textbf{Version 4.1}
\centering
-\includegraphics[keepaspectratio=true,scale=1.0]{DWlogo}
+\vspace{1cm}
+\includegraphics[keepaspectratio=true,scale=1.0]{dwarf-logo}
-\centering
-\vspace{3cm}
+%\centering
+\vspace{2cm}
\href{http://www.dwarfstd.org}{\dwf\ Committee}
-\vspace{2cm}
+\vspace{1cm}
\url{http://www.dwarfstd.org}
\large
-\vspace{1in}
+\vspace{2cm}
\textbf{\docdate}
\end{centering}
%\clearpage
-\openany
+%\openany
\textmd
\normalsize
\setlength{\headheight}{15pt}
\pagestyle{plain}
-\makeevenhead{plain}{}{}{}
-\makeoddhead{plain}{}{}{}
-\makeevenfoot{plain}{}{}{}
-\makeoddfoot{plain}{}{}{}
+%\makeevenhead{plain}{}{}{}
+%\makeoddhead{plain}{}{}{}
+%\makeevenfoot{plain}{}{}{}
+%\makeoddfoot{plain}{}{}{}
\nonzeroparskip
\setlength{\parindent}{0pt}
\include{foreword4.1}
\emptypage
-\cleardoublepage
+\newpage
\tableofcontents
\cleardoublepage
% The \appendix toggles us into appendix chapters
\appendix
\include{attributesbytag}
-\include{debugsectionrelationships} \emptypage
+\include{debugsectionrelationships} %\emptypage
\include{encodingdecoding} \emptypage
\include{examples} %\emptypage
\include{compression} %\emptypage
various aspects of the DWARF debugging information format.
-
\section{ Compilation Units and Abbreviations Table Example}
\label{app:compilationunitsandabbreviationstableexample}
0x0
\vspace{0.01cm}
\hrule
+\textit{e1:}
2
-\doublequote{char}
+"char"
\livelink{chap:DWATEunsignedchar}{DW\-\_ATE\-\_unsigned\-\_char}
1
\vspace{0.01cm}
\hrule
+\textit{e2:}
3
-e1
+\textit{e1 (debug info offset)}
\vspace{0.01cm}
\hrule
4
-\doublequote{POINTER}
-e2
+"POINTER"
+\textit{e2 (debug info offset)}
\vspace{0.01cm}
\hrule
0
\vspace{0.01cm}
\hrule
4
-\doublequote{strp}
-e2
+"strp"
+\textit{e2 (debug info offset)}
\vspace{0.01cm}
\hrule
...
\begin{framed}
\scriptsize
\begin{alltt}
+\textit{a1:}
+1
\livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit}
\livelink{chap:DWCHILDRENyes}{DW\-\_CHILDREN\-\_yes}
\livelink{chap:DWATname}{DW\-\_AT\-\_name} \livelink{chap:DWFORMstring}{DW\-\_FORM\-\_string}
\livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} \livelink{chap:DWFORMaddr}{DW\-\_FORM\-\_addr}
\livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} \livelink{chap:DWFORMdata1}{DW\-\_FORM\-\_data1}
\livelink{chap:DWATstmtlist}{DW\-\_AT\-\_stmt\-\_list} \livelink{chap:DWFORMindirect}{DW\-\_FORM\-\_indirect}
-0 0
+0
\vspace{0.01cm}
\hrule
2
In practice, of course, a \doublequote{real} descriptor will have
dimension substructures only for as many dimensions as are
-specified in the num\_dims component. Let us use the notation
+specified in the \texttt{num\_dims} component. Let us use the notation
\texttt{desc\textless n\textgreater}
-to indicate a specialization of the desc struct in
-which \texttt{n} is the bound for the dims component as well as the
-contents of the num\_dims component.
+to indicate a specialization of the \texttt{desc} struct in
+which \texttt{n} is the bound for the \texttt{dims} component as well as the
+contents of the \texttt{num\_dims} component.
Because the arrays considered here come in two parts, it is
necessary to distinguish the parts carefully. In particular,
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to REAL)
\livelink{chap:DWATassociated}{DW\-\_AT\-\_associated}(expression= ! Test 'ptr\_assoc' \nolink{flag}
\livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
- \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<n> ! where n == offset(ptr\_assoc)
+ \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<n> ! where n == offset(ptr\_assoc)
\livelink{chap:DWOPplus}{DW\-\_OP\-\_plus}
\livelink{chap:DWOPderef}{DW\-\_OP\-\_deref}
- \livelink{chap:DWOPlit1}{DW\-\_OP\-\_lit1} ! mask for 'ptr\_assoc' \nolink{flag}
+ \livelink{chap:DWOPlit1}{DW\-\_OP\-\_lit1} ! mask for 'ptr\_assoc' \nolink{flag}
\livelink{chap:DWOPand}{DW\-\_OP\-\_and})
\livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}(expression= ! Get raw data address
\livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
- \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<n> ! where n == offset(base)
+ \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<n> ! where n == offset(base)
\livelink{chap:DWOPplus}{DW\-\_OP\-\_plus}
- \livelink{chap:DWOPderef}{DW\-\_OP\-\_deref}) ! Type of index of array 'ap'
-2\$: \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}
- ! No name, default stride
- \livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to INTEGER)
- \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}(expression=
- \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
- \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<n> ! where n ==
- ! offset(desc, dims) +
- ! offset(dims\_str, lower\_bound)
- \livelink{chap:DWOPplus}{DW\-\_OP\-\_plus}
- \livelink{chap:DWOPderef}{DW\-\_OP\-\_deref})
- \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}(expression=
- \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
- \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<n> ! where n ==
- ! offset(desc, dims) +
- ! offset(dims\_str, upper\_bound)
- \livelink{chap:DWOPplus}{DW\-\_OP\-\_plus}
- \livelink{chap:DWOPderef}{DW\-\_OP\-\_deref})
- ! Note: for the m'th dimension, the second operator becomes
- ! \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<x> where
- ! x == offset(desc, dims) +
- ! (m-1)*sizeof(dims\_str) +
- ! offset(dims\_str, [lower|upper]\_bound)
- ! That is, the expression does not get longer for each successive
- ! dimension (other than to express the larger offsets involved).
+ \livelink{chap:DWOPderef}{DW\-\_OP\-\_deref}) ! Type of index of array 'ap'
+2\$: \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}
+ ! No name, default stride
+ \livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to INTEGER)
+ \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}(expression=
+ \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
+ \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<n> ! where n ==
+ ! offset(desc, dims) +
+ ! offset(dims\_str, lower\_bound)
+ \livelink{chap:DWOPplus}{DW\-\_OP\-\_plus}
+ \livelink{chap:DWOPderef}{DW\-\_OP\-\_deref})
+ \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}(expression=
+ \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
+ \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<n> ! where n ==
+ ! offset(desc, dims) +
+ ! offset(dims\_str, upper\_bound)
+ \livelink{chap:DWOPplus}{DW\-\_OP\-\_plus}
+ \livelink{chap:DWOPderef}{DW\-\_OP\-\_deref})
+ ! Note: for the m'th dimension, the second operator becomes
+ ! \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<x> where
+ ! x == offset(desc, dims) +
+ ! (m-1)*sizeof(dims\_str) +
+ ! offset(dims\_str, [lower|upper]\_bound)
+ ! That is, the expression does not get longer for each successive
+ ! dimension (other than to express the larger offsets involved).
\end{alltt}
\end{dwflisting}
\caption{Fortran 90 example: DWARF description}
6\$: \livelink{chap:DWTAGarraytype}{DW\-\_TAG\-\_array\-\_type}
! No name, default (Fortran) ordering, default stride
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to 3\$)
- \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}(expression=
- ! Test 'ptr\_alloc' \nolink{flag}
+ \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}(expression= ! Test 'ptr\_alloc' \nolink{flag}
\livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
- \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<n> ! where n == offset(ptr\_alloc)
+ \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<n> ! where n == offset(ptr\_alloc)
\livelink{chap:DWOPplus}{DW\-\_OP\-\_plus}
\livelink{chap:DWOPderef}{DW\-\_OP\-\_deref}
- \livetarg{chap:DWOPlit2}{DW\-\_OP\-\_lit2}
- ! Mask for 'ptr\_alloc' \nolink{flag}
+ \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit2} ! Mask for 'ptr\_alloc' \nolink{flag}
\livelink{chap:DWOPand}{DW\-\_OP\-\_and})
\livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}(expression= ! Get raw data address
\livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
- \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<n> ! where n = offset(base)
- \livelink{chap:DWOPplus}{DW\-\_OP\-\_plus}
- \livelink{chap:DWOPderef}{DW\-\_OP\-\_deref})
-7\$: \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}
- ! No name, default stride
- \livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to INTEGER)
- \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}(expression=
- \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
- \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<n> ! where n == ...
- \livelink{chap:DWOPplus}{DW\-\_OP\-\_plus}
- \livelink{chap:DWOPderef}{DW\-\_OP\-\_deref})
- \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}(expression=
- \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
- \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<n> ! where n == ...
+ \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<n> ! where n = offset(base)
\livelink{chap:DWOPplus}{DW\-\_OP\-\_plus}
\livelink{chap:DWOPderef}{DW\-\_OP\-\_deref})
+7\$: \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}
+ ! No name, default stride
+ \livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to INTEGER)
+ \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}(expression=
+ \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
+ \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<n> ! where n == ...
+ \livelink{chap:DWOPplus}{DW\-\_OP\-\_plus}
+ \livelink{chap:DWOPderef}{DW\-\_OP\-\_deref})
+ \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}(expression=
+ \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
+ \livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<n> ! where n == ...
+ \livelink{chap:DWOPplus}{DW\-\_OP\-\_plus}
+ \livelink{chap:DWOPderef}{DW\-\_OP\-\_deref})
8\$: \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("arrays")
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to 6\$)
there is one, go execute the expression, whose result is
the address needed. The object address used in this case
is the object we are working on, namely the variable named
-arrays , whose address was found in step 1. (Had there been
+arrays, whose address was found in step 1. (Had there been
no \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location} attribute, the desired address would
be the same as the address from step 1.)
\clearpage
Having acquired all the necessary data, perform the indexing
-operation in the usual manner - which has nothing to do with
+operation in the usual manner--which has nothing to do with
any of the attributes involved up to now. Those just provide
the actual values used in the indexing step.
\subsection{Ada Example}
\label{app:adaexample}
-Figure \referfol{fig:adaexamplesourcefragment}
+Figure \refersec{fig:adaexamplesourcefragment}
illustrates two kinds of \addtoindex{Ada}
parameterized array, one embedded in a record.
component VEC2) where the upper bound of the first and only
bound is also determined at runtime. In this case, the upper
bound is contained in a discriminant of the containing record
-type. (A discriminant is a component of a record whose value
+type. (A \textit{discriminant} is a component of a record whose value
cannot be changed independently of the rest of the record
because that value is potentially used in the specification
of other components of the record.)
a member, and the location of the upper bound is determined
as for any member. That is, the location is determined using
an address calculation relative to the base of the containing
-object. A consumer must notice that the referenced bound is a
+object.
+
+A consumer must notice that the referenced bound is a
member of the same containing object and implicitly push the
base address of the containing object just as for accessing
a data member generally.
\item The lack of a subtype concept in DWARF means that DWARF types
serve the role of subtypes and must replicate information from
what should be the parent type. For this reason, DWARF for
-the unconstrained array ARR is not needed for the purposes
-of this example and therefore not shown.
+the unconstrained array type ARR is not needed for the purposes
+of this example and therefore is not shown.
\end{enumerate}
\begin{figure}[p]
14\$: \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("VEC1")
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to array type at 12\$)
- . . .
+ . . .
21\$: \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("TEENY")
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to INTEGER)
\livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}(constant 1)
\livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}(constant 100)
-
- . . .
+ . . .
26\$: \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("REC2")
27\$: \livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("N")
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to subtype TEENY at 21\$)
\livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}(constant 0)
-28\$: \livelink{chap:DWTAGarraytype}{DW\-\_TAG\-\_array\-\_type}
+28\$: \livelink{chap:DWTAGarraytype}{DW\-\_TAG\-\_array\-\_type}
! No name, default (\addtoindex{Ada}) order, default stride
! Default data location
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to INTEGER)
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to subrange TEENY at 21\$)
\livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}(constant 1)
\livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}(reference to member N at 27\$)
-30\$: \livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member}
+30\$: \livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("VEC2")
- \livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to array \doublequote{subtype} at 28\$)
+ \livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to array "subtype" at 28\$)
\livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}(machine=
\livelink{chap:DWOPlit}{DW\-\_OP\-\_lit}<n> ! where n == offset(REC2, VEC2)
\livelink{chap:DWOPplus}{DW\-\_OP\-\_plus})
- . . .
+ . . .
41\$: \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("OBJ2B")
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to REC2 at 26\$)
\label{fig:adaexampledwarfdescription}
\end{figure}
+\clearpage
+
\subsection{Pascal Example}
\label{app:pascalexample}
-
The Pascal \addtoindexx{Pascal example} source in
Figure \referfol{fig:packedrecordexamplesourcefragment}
is used to illustrate the representation of packed unaligned
F5 : BOOLEAN; ! bit offset is 0
F6 : BOOLEAN; ! bit offset is 1
END;
-VAR V : PACKED RECORD
+VAR V : PACKED RECORD
F1 : BOOLEAN; ! bit offset is 0
F2 : PACKED RECORD ! bit offset is 1
F3 : INTEGER; ! bit offset is 0 in F2, 1 in V
END;
F4 : PACKED ARRAY [0..1] OF T; ! bit offset is 33
F7 : T; ! bit offset is 37
-END;
+ END;
\end{lstlisting}
\caption{Packed record example: source fragment}
\label{fig:packedrecordexamplesourcefragment}
architectures using the conventions described in
Section \refersec{chap:datamemberentries}.
-
\begin{figure}[p]
+\figurepart{1}{2}
\begin{dwflisting}
% DWARF4 had some entries here as \livelink{chap:DWATmember}{DW_AT_member} .
% Those are fixed here to \livelink{chap:DWTAGmember}{DW_TAG_member}
\begin{alltt}
-
-21\$: \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type} ! anonymous type for F2
+10\$: \livelink{chap:DWTAGbasetype}{DW\_TAG\_base\_type}
+ \livelink{chap:DWATname}{DW\_AT\_name}("BOOLEAN")
+ ...
+11\$: \livelink{chap:DWTAGbasetype}{DW\_TAG\_base\_type}
+ \livelink{chap:DWATname}{DW\_AT\_name}("INTEGER")
+ ...
+20\$: \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type}
+ \livelink{chap:DWATname}{DW\_AT\_name}("T")
+ \livelink{chap:DWATbitsize}{DW\_AT\_bit\_size}(2)
+ \livelink{chap:DWTAGmember}{DW\_TAG\_member}
+ \livelink{chap:DWATname}{DW\_AT\_name}("F5")
+ \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 10$)
+ \livelink{chap:DWATdatabitoffset}{DW\_AT\_data\_bit\_offset}(0) ! may be omitted
+ \livelink{chap:DWATbitsize}{DW\_AT\_bit\_size}(1)
+ \livelink{chap:DWTAGmember}{DW\_TAG\_member}
+ \livelink{chap:DWATname}{DW\_AT\_name}("F6")
+ \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 10$)
+ \livelink{chap:DWATdatabitoffset}{DW\_AT\_data\_bit\_offset}(1)
+ \livelink{chap:DWATbitsize}{DW\_AT\_bit\_size}(1)
+21\$: \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type} ! anonymous type for F2
\livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("F3")
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to 11\$)
-22\$: \livelink{chap:DWTAGarraytype}{DW\-\_TAG\-\_array\-\_type} ! anonymous type for F4
+22\$: \livelink{chap:DWTAGarraytype}{DW\-\_TAG\-\_array\-\_type} ! anonymous type for F4
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to 20\$)
\livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to 11\$)
\livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}(1)
\livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}(2)
\livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}(4) \addtoindexx{bit size attribute}
-23\$: \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type} ! anonymous type for V
+23\$: \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type} ! anonymous type for V
\livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}(39) \addtoindexx{bit size attribute}
\livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("F1")
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to 10\$)
- \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}(0)! may be omitted
+ \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}(0) ! may be omitted
\livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}(1) ! may be omitted
\livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("F2")
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to 22\$)
\livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}(33)
\livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}(4) ! may be omitted
+\end{alltt}
+\end{dwflisting}
+\caption{Packed record example: DWARF description}
+\label{fig:packedrecordexampledwarfdescription}
+\end{figure}
+
+\begin{figure}[p]
+\figurepart{2}{2}
+\begin{dwflisting}
+\begin{alltt}
\livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("F7")
- \livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to 20\$) ! type T
+ \livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to 20\$) ! type T
\livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}(37)
- \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}(2) \addtoindexx{bit size attribute}! may be omitted
+ \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}(2) \addtoindexx{bit size attribute} ! may be omitted
\livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("V")
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to 23\$)
...
\end{alltt}
\end{dwflisting}
-\caption{Packed record example: DWARF description}
-\label{fig:packedrecordexampledwarfdescription}
+\begin{center}
+Figure~\ref{fig:packedrecordexampledwarfdescription}: Packed record example: DWARF description \textit{(concluded)}
+\end{center}
\end{figure}
\section{Namespace Example}
namespace {
int i;
}
-
namespace A {
namespace B {
int j;
- int myfunc (int a);
- float myfunc (float f) { return f \textendash 2.0; }
- int myfunc2(int a) { return a + 2; }
+ int myfunc (int a);
+ float myfunc (float f) { return f - 2.0; }
+ int myfunc2(int a) { return a + 2; }
}
}
namespace Y {
using A::B::j; // (1) using declaration
int foo;
}
-
using A::B::j; // (2) using declaration
namespace Foo = A::B; // (3) namespace alias
using Foo::myfunc; // (4) using declaration
\begin{figure}[p]
+\figurepart{1}{2}
\begin{dwflisting}
\begin{alltt}
\end{figure}
\begin{figure}
+\figurepart{2}{2}
\begin{dwflisting}
\begin{alltt}
40\$: \livelink{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("Y")
- \livelink{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration} ! (1) using-declaration
+ \livelink{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration} ! (1) using-declaration
\livelink{chap:DWATimport}{DW\-\_AT\-\_import}(reference to 30\$)
\livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("foo")
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to 1\$)
\livelink{chap:DWATlocation}{DW\-\_AT\-\_location} ...
...
- \livelink{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration} ! (2) using declaration
+ \livelink{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration} ! (2) using declaration
\livelink{chap:DWATimport}{DW\-\_AT\-\_import}(reference to 30\$)
- \livelink{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration} ! (3) namespace alias
+ \livelink{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration} ! (3) namespace alias
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("Foo")
\livelink{chap:DWATimport}{DW\-\_AT\-\_import}(reference to 20\$)
- \livelink{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration} ! (4) using declaration
- \livelink{chap:DWATimport}{DW\-\_AT\-\_import}(reference to 34\$) ! - part 1
- \livelink{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration} ! (4) using declaration
- \livelink{chap:DWATimport}{DW\-\_AT\-\_import}(reference to 36\$) ! - part 2
- \livelink{chap:DWTAGimportedmodule}{DW\-\_TAG\-\_imported\-\_module} ! (5) using directive
+ \livelink{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration} ! (4) using declaration
+ \livelink{chap:DWATimport}{DW\-\_AT\-\_import}(reference to 34\$) ! - part 1
+ \livelink{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration} ! (4) using declaration
+ \livelink{chap:DWATimport}{DW\-\_AT\-\_import}(reference to 36\$) ! - part 2
+ \livelink{chap:DWTAGimportedmodule}{DW\-\_TAG\-\_imported\-\_module} ! (5) using directive
\livelink{chap:DWATimport}{DW\-\_AT\-\_import}(reference to 20\$)
\livelink{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace}
\livelink{chap:DWATextension}{DW\-\_AT\-\_extension}(reference to 10\$)
\livelink{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace}
\livelink{chap:DWATextension}{DW\-\_AT\-\_extension}(reference to 20\$)
- \livelink{chap:DWTAGimportedmodule}{DW\-\_TAG\-\_imported\-\_module} ! (6) using directive
+ \livelink{chap:DWTAGimportedmodule}{DW\-\_TAG\-\_imported\-\_module} ! (6) using directive
\livelink{chap:DWATimport}{DW\-\_AT\-\_import}(reference to 40\$)
\livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("k")
\end{figure}
\begin{figure}[h]
+\figurepart{1}{2}
\begin{dwflisting}
\begin{alltt}
1\$: \livelink{chap:DWTAGunspecifiedtype}{DW\-\_TAG\-\_unspecified\-\_type}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("void")
...
-2\$ \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}
+2\$: \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("int")
...
3\$: \livelink{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type}
\end{figure}
\begin{figure}[p]
+\figurepart{2}{2}
\begin{dwflisting}
\begin{alltt}
8\$: \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter}
\livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial}(true)
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("this")
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to 6\$)
- ! Makes type of 'this' as 'A const*' =>
+ ! Makes type of 'this' as 'A const*' =>
! func2 marked as const
\livelink{chap:DWATlocation}{DW\-\_AT\-\_location} ...
...
Table \refersec{tab:linenumberprogramexampleoneencoding}
shows one encoding of the line number program, which occupies
-12 bytes (the opcode SPECIAL(m,n) indicates the special opcode
-generated for a line increment of m and an address increment
-of n).
+12 bytes (the opcode SPECIAL(\textit{m},\textit{n}) indicates the special opcode
+generated for a line increment of \textit{m} and an address increment
+of \textit{n}).
\newpage
\begin{centering}
\setlength{\extrarowheight}{0.1cm}
\begin{longtable}{l|l|l}
- \caption{Line number program example: one encoding}
+ \caption{Line number program example: one \mbox{encoding}}
\label{tab:linenumberprogramexampleoneencoding} \\
\hline \bfseries Opcode &\bfseries Operand &\bfseries Byte Stream \\ \hline
\endfirsthead
\hline
\endlastfoot
\livelink{chap:DWLNSadvancepc}{DW\-\_LNS\-\_advance\-\_pc}&LEB128(0x239)&0x2, 0xb9, 0x04 \\
-SPECIAL(2, 0)&0xb & \\
-SPECIAL(2, 3)&0x38 & \\
-SPECIAL(1, 8)&0x82 & \\
-SPECIAL(1, 7)&0x73 & \\
+SPECIAL(2, 0)& &0xb \\
+SPECIAL(2, 3)& &0x38 \\
+SPECIAL(1, 8)& &0x82 \\
+SPECIAL(1, 7)& &0x73 \\
\livelink{chap:DWLNSadvancepc}{DW\-\_LNS\-\_advance\-\_pc}&LEB128(2)&0x2, 0x2 \\
\livelink{chap:DWLNEendsequence}{DW\-\_LNE\-\_end\-\_sequence} &&0x0, 0x1, 0x1 \\
\end{longtable}
\hline
\endlastfoot
cie&36&length \\
-cie+4&0xffffffff&CIE\_id \\
+cie+4&\xffffffff&CIE\_id \\
cie+8&4&version \\
cie+9&0&augmentation \\
cie+10&4&address size \\
focused on promoting Linux. The DWARF Committee has been
independent since that time.
-It is the intention of the DWARF Committee that migrating
-from \addtoindex{DWARF Version 2} or Version 3
-\addtoindexx{DWARF Version 3}
-or Version 4 to later versions should
-be straightforward and easily accomplished.
+It is the intention of the DWARF Committee that migrating from
+an earlier version of the DWARF standard to the current version
+should be straightforward and easily accomplished.
Almost all
\addtoindex{DWARF Version 2}
and Version 3
those sometimes mandated by the underlying technology).
If any substantive descrepancies are discovered between these two documents,
-please bring them to the attention of the DWARF Information Format Committee.
+please bring them to the attention of the DWARF Debugging Information Format Committee.
\end{abstract}
\chapter{General Description}
\label{chap:generaldescription}
-\section{The Debugging Entry (DIE)}
+\section{The Debugging Information Entry (DIE)}
\label{chap:thedebuggingentrydie}
DWARF
\addtoindexx{debugging information entry}
\livetarg{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}
&\livelinki{chap:DWATcontainingtypecontainingtypeofpointertomembertype}{Containing type of pointer to member type}{containing type of pointer to member type} \\
\livetarg{chap:DWATcount}{DW\-\_AT\-\_count}
-&\livelinki{chap:DWATcountelementsofsubrangetype}{Elements of subrange type}{elements of subrange type} \\
+&\livelinki{chap:DWATcountelementsofsubrangetype}{Elements of subrange type}{elements ofbreg subrange type} \\
\livetarg{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}
&\livelinki{chap:DWATdatabitoffsetbasetypebitlocation}{Base type bit location}{base type bit location} \\
&\livelinki{chap:DWATdatabitoffsetdatamemberbitlocation}{Data member bit location}{data member bit location} \\
\textit{Most constant values are integers of one kind or
another (codes, offsets, counts, and so on); these are
-sometimes called ``integer constants'' for emphasis.} \\
+sometimes called ``integer constants'' for emphasis.}
+\addtoindexx{integer constant}
+\addtoindexx{constant class!integer} \\
\livetargi{chap:exprloc}{exprloc}{exprloc class}
&A DWARF expression or location description.
in the stack pointer as the PC changes.)
\itembfnl{\livetarg{chap:DWOPbreg0}{DW\-\_OP\-\_breg0}, \livetarg{chap:DWOPbreg1}{DW\-\_OP\-\_breg1}, \dots, \livetarg{chap:DWOPbreg31}{DW\-\_OP\-\_breg31} }
-The single operand of the \livetarg{chap:DWOPbreg}{DW\-\_OP\-\_breg}n
+The single operand of the \livetarg{chap:DWOPbreg}{DW\-\_OP\-\_breg}\textit{n}
operations provides
a signed LEB128 offset from
the specified register.
\item pop the top two stack values,
\item compare the operands:
+\linebreak
\textless~former second entry~\textgreater \textless~relational operator~\textgreater \textless~former top entry~\textgreater
\item push the constant value 1 onto the stack
(greater than or equal to), \livelink{chap:DWOPeq}{DW\-\_OP\-\_eq} (equal to), \livelink{chap:DWOPlt}{DW\-\_OP\-\_lt} (less
than), \livelink{chap:DWOPgt}{DW\-\_OP\-\_gt} (greater than) and \livelink{chap:DWOPne}{DW\-\_OP\-\_ne} (not equal to).
+\needlines{6}
\itembfnl{\livetarg{chap:DWOPskip}{DW\-\_OP\-\_skip}}
\livelink{chap:DWOPskip}{DW\-\_OP\-\_skip} is an unconditional branch. Its single operand
is a 2\dash byte signed integer constant. The 2\dash byte constant is
examples illustrate their behavior graphically.}
\begin{longtable}[c]{rrcrr}
- &Before & Operation&& After \\
+\multicolumn{2}{c}{Before} & Operation & \multicolumn{2}{c}{After} \\
\hline
\endhead
\endfoot
and/or other
DWARF operations specific to describing locations. They are
sufficient for describing the location of any object as long
-as its lifetime is either static or the same as the lexical
-\livelink{chap:lexicalblock}{block} that owns it,
+as its lifetime is either static or the same as the
+\livelink{chap:lexicalblock}{lexical block} that owns it,
and it does not move during its lifetime.
Single location descriptions are of two kinds:
}
\begin{enumerate}[1. ]
\itembfnl{\livetarg{chap:DWOPreg0}{DW\-\_OP\-\_reg0}, \livetarg{chap:DWOPreg1}{DW\-\_OP\-\_reg1}, ..., \livetarg{chap:DWOPreg31}{DW\-\_OP\-\_reg31}}
-The \livetarg{chap:DWOPreg}{DW\-\_OP\-\_reg}n operations encode the names of up to 32
+The \livetarg{chap:DWOPreg}{DW\-\_OP\-\_reg}\textit{n} operations encode the names of up to 32
registers, numbered from 0 through 31, inclusive. The object
-addressed is in register n.
+addressed is in register \textit{n}.
\itembfnl{\livetarg{chap:DWOPregx}{DW\-\_OP\-\_regx}}
The \livelink{chap:DWOPregx}{DW\-\_OP\-\_regx} operation has a single unsigned LEB128 literal
% Probably the only place that this will be used, so not in dwarf.tex?
\newcommand{\descriptionitemnl}[1]{\item[#1]\mbox{}\\}
\begin{description}
-\descriptionitemnl{\livetarg{chap:DWOPreg3}{DW\-\_OP\-\_reg3}}
+\descriptionitemnl{\livelink{chap:DWOPreg}{DW\-\_OP\-\_reg3}}
The value is in register 3.
\descriptionitemnl{\livelink{chap:DWOPregx}{DW\-\_OP\-\_regx} 54}
\descriptionitemnl{\livelink{chap:DWOPaddr}{DW\-\_OP\-\_addr} 0x80d0045c}
The value of a static variable is at machine address 0x80d0045c.
-\descriptionitemnl{\livetarg{chap:DWOPbreg11}{DW\-\_OP\-\_breg11} 44}
+\descriptionitemnl{\livelink{chap:DWOPbreg}{DW\-\_OP\-\_breg11} 44}
Add 44 to the value in register 11 to get the address of an automatic
variable instance.
and whose last four bytes are in memory, 12 bytes before the frame
base.
-\descriptionitemnl{\livelink{chap:DWOPbreg1}{DW\-\_OP\-\_breg1} 0 \livetarg{chap:DWOPbreg2}{DW\-\_OP\-\_breg2} 0 \livelink{chap:DWOPplus}{DW\-\_OP\-\_plus} \livelink{chap:DWOPstackvalue}{DW\-\_OP\-\_stack\-\_value}}
+\descriptionitemnl{\livelink{chap:DWOPbreg1}{DW\-\_OP\-\_breg1} 0 \livelink{chap:DWOPbreg}{DW\-\_OP\-\_breg2} 0 \livelink{chap:DWOPplus}{DW\-\_OP\-\_plus} \livelink{chap:DWOPstackvalue}{DW\-\_OP\-\_stack\-\_value} }
Add the contents of r1 and r2 to compute a value. This value is the
\doublequote{contents} of an otherwise anonymous location.
-\descriptionitemnl{\livelink{chap:DWOPlit1}{DW\-\_OP\-\_lit1} \livelink{chap:DWOPstackvalue}{DW\-\_OP\-\_stack\-\_value} \livelink{chap:DWOPpiece}{DW\-\_OP\-\_piece} 4}
-\descriptionitemnl{\livetarg{chap:DWOPbreg3}{DW\-\_OP\-\_breg3} 0 \livetarg{chap:DWOPbreg4}{DW\-\_OP\-\_breg4} 0 \livelink{chap:DWOPplus}{DW\-\_OP\-\_plus} \livelink{chap:DWOPstackvalue}{DW\-\_OP\-\_stack\-\_value} \livelink{chap:DWOPpiece}{DW\-\_OP\-\_piece} 4}
+\descriptionitemnl{\livelink{chap:DWOPlit1}{DW\-\_OP\-\_lit1} \livelink{chap:DWOPstackvalue}{DW\-\_OP\-\_stack\-\_value} \livelink{chap:DWOPpiece}{DW\-\_OP\-\_piece} 4 }
+\descriptionitemnl{\livelink{chap:DWOPbreg}{DW\-\_OP\-\_breg3} 0 \livelink{chap:DWOPbreg}{DW\-\_OP\-\_breg4} 0 \livelink{chap:DWOPplus}{DW\-\_OP\-\_plus} \livelink{chap:DWOPstackvalue}{DW\-\_OP\-\_stack\-\_value} \livelink{chap:DWOPpiece}{DW\-\_OP\-\_piece} 4}
The object value is found in an anonymous (virtual) location whose
value consists of two parts, given in memory address order: the 4 byte
value 1 followed by the four byte value computed from the sum of the
consists of:
\begin{enumerate}[1. ]
\item The value of the largest representable
-address offset (for example, 0xffffffff when the size of
+address offset (for example, \wffffffff when the size of
an address is 32 bits).
\item An address, which defines the
appropriate base address for use in interpreting the beginning
Any debugging information entry describing a data object (which
\hypertarget{chap:DWATlocationdataobjectlocation}
includes variables and parameters) or
-common \livelink{chap:commonblockentry}{block}
+\livelink{chap:commonblockentry}{common blocks}
may have
\addtoindexx{location attribute}
a
-\livelink{chap:DWATlocation}{DW\-\_AT\-\_location} attribute
+\livelink{chap:DWATlocation}{DW\-\_AT\-\_location} attribute,
\addtoindexx{location attribute}
-, whose value is a location description
+whose value is a location description
(see Section \refersec{chap:locationdescriptions}).
A
a machine code address or range of machine code addresses,
which includes compilation units, module initialization,
\hypertarget{chap:DWATrangesnoncontiguousrangeofcodeaddresses}
-subroutines, ordinary \livelink{chap:lexicalblock}{block},
+subroutines, ordinary \nolink{blocks},
try/catch \nolink{blocks} (see Section\refersec{chap:tryandcatchblockentries}),
-labels
-\hypertarget{chap:DWATlowpccodeaddressorrangeofaddresses}
-and
-\hypertarget{chap:DWAThighpccontiguousrangeofcodeaddresses}
-the like, may have
-
+labels and the like, may have
\begin{itemize}
\item A \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} attribute for
+\hypertarget{chap:DWATlowpccodeaddressorrangeofaddresses}
a single address,
-\item A \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc} and
-\livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc} pair of
-attributes
-\addtoindexx{high PC attribute}
-for
+\item A \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc}
\addtoindexx{low PC attribute}
+and
+\livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc}
+\addtoindexx{high PC attribute}
+\hypertarget{chap:DWAThighpccontiguousrangeofcodeaddresses}
+pair of attributes for
a single contiguous range of
addresses, or
A base address selection entry consists of:
\begin{enumerate}[1. ]
-\item The value of the largest representable address offset (for example, 0xffffffff when the size of
+\item The value of the largest representable address offset (for example, \wffffffff when the size of
an address is 32 bits).
\item An address, which defines the appropriate base address for use in interpreting the beginning
The value of these
attributes is determined based on the class as follows:
-
\begin{itemize}
\item For a \livelink{chap:constant}{constant}, the value of the constant is the value of
the attribute.
an object file.
The informational content is described in
-Sections \refersec{chap:generaldescription}
+Sections \ref{chap:generaldescription}
through
-\refersec{chap:otherdebugginginformation}.
-Section \refersec{chap:generaldescription}
+\ref{chap:otherdebugginginformation}.
+Section \ref{chap:generaldescription}
describes the overall structure of the information
and attributes that is common to many or all of the different
debugging information entries.
-Sections \refersec{chap:programscopeentries},
-\refersec{chap:dataobjectandobjectlistentries} and
-\refersec{chap:typeentries} describe
+Sections \ref{chap:programscopeentries},
+\ref{chap:dataobjectandobjectlistentries} and
+\ref{chap:typeentries} describe
the specific debugging information entries and how they
communicate the necessary information about the source program
to a debugger.
-Section \refersec{chap:otherdebugginginformation}
+Section \ref{chap:otherdebugginginformation}
describes debugging information
contained outside of the debugging information entries. The
encoding of the DWARF information is presented in
-Section \refersec{datarep:datarepresentation}.
+Section \ref{datarep:datarepresentation}.
This organization closely follows that used in the DWARF
Version 3 document. Except where needed to incorporate
no modification.
In the following sections, text in normal font describes
-required aspects of the DWARF format. Text in italics is
+required aspects of the DWARF format. Text in \textit{italics} is
explanatory or supplementary material, and not part of the
format definition itself. The several appendices consist only
of explanatory or supplementary material, and are not part
begin DWARF sections as well as certain structures are reserved
to act as escape codes for future extension; one such extension
is defined to increase the possible size of DWARF descriptions
-(see Section 7.4).
+(see Section \refersec{datarep:32bitand64bitdwarfformats}).
\item
-References that use the attribute form \livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}
+References that use the attribute form
+\livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}
are specified to be four bytes in the DWARF 32-bit format and
eight bytes in the DWARF 64-bit format, while
\addtoindex{DWARF Version 2}
specifies that such references have the same size as an
-address on the target system (see Sections 7.4 and 7.5.4).
+address on the target system (see Sections
+\refersec{datarep:32bitand64bitdwarfformats} and
+\refersec{datarep:attributeencodings}).
\item
The return\_address\_register field in a Common Information
Entry record for call frame information is changed to unsigned
-LEB representation (see Section 6.4.1).
+LEB representation (see Section
+\refersec{chap:structureofcallframeinformation}).
\end{itemize}
For lookup by name,
\addtoindexx{lookup!by name}
two tables are maintained in separate
-\addtoindex{accelerated access!by name}
+\addtoindexx{accelerated access!by name}
object file sections named
\addtoindex{.debug\_pubnames} for objects and
functions, and
\addtoindexx{unit\_length}
The total length of the all of the entries for that set,
not including the length field itself
-(see Section \refersec{datarep:locationdescriptions}).
+(see Section \refersec{datarep:initiallengthvalues}).
\item version (\addtoindex{uhalf}) \\
A version number
For
\addtoindexx{lookup!by address}
lookup by address, a table is maintained in a separate
-\addtoindex{accelerated access!by address}
+\addtoindexx{accelerated access!by address}
object file section called
\addtoindex{.debug\_aranges}. The table consists
of sets of variable length entries, each set describing the
\addtoindex{.debug\_line} section of an object file and
is referenced by a corresponding compilation unit debugging
information entry
-(see Section \refersec{chap:generalsubroutineandentrypointinformation})
+(see Section \refersec{chap:normalandpartialcompilationunitentries})
in the \addtoindex{.debug\_info}
section.
\item \textit{the source file name}
\item \textit{the source line number}
\item \textit{the source column number}
+\item \textit{whether this instruction is the beginning of a source statement}
\item \textit{whether this instruction is the beginning of a \addtoindex{basic block}}
\item \textit{and so on}
\end{itemize}
number information format:
-\begin{tabular} {lp{9cm}}
+\begin{longtable} {lp{9cm}}
state machine &
The hypothetical machine used by a consumer of the line number
information to expand the byte\dash coded
A series of contiguous target machine instructions. One compilation unit
may emit multiple sequences (that is, not all instructions within a
compilation unit are assumed to be contiguous). \\
-\end{tabular}
+\end{longtable}
\subsection{State Machine Registers}
\label{chap:statemachineregisters}
\addtoindex{isa} &
An unsigned integer whose value encodes the applicable
instruction set architecture for the current instruction.
-The encoding of instruction sets should be shared by all
+
+\textit{The encoding of instruction sets should be shared by all
users of a given architecture. It is recommended that this
encoding be defined by the ABI authoring committee for each
-architecture. \\
+architecture.} \\
\addtoindex{discriminator} &
An unsigned integer identifying the block to which the
line number program header also specifies the number of operands for
each standard opcode.
+\needlines{6}
\item extended opcodes \\
These have a multiple byte format. The first byte is zero; the next bytes
are an unsigned LEB128\addtoindexx{LEB128!unsigned} integer giving the number of bytes in the
compilation unit, not including the unit\_length field itself
(see Section \refersec{datarep:initiallengthvalues}).
-\item version (\addtoindex{uhalf})
+\item version (\addtoindex{uhalf}) \\
A version number\addtoindexx{version number!line number information}
-(see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
+(see Appendix \refersec{datarep:linenumberinformation}).
This number is specific to
the line number information and is independent of the DWARF
version number.
\addtoindexx{maximum\_operations\_per\_instruction}
maximum\-\_operations\-\_per\-\_instruction in their calculations.
+\needlines{9}
\item maximum\_operations\_per\_instruction (\addtoindex{ubyte}) \\
The
\addtoindexx{maximum\_operations\_per\_instruction}
\addtoindex{op\_index} registers use this and
\addtoindex{minimum\_instruction\_length}
in their calculations.
+
For non-VLIW
-architectures, this field is 1, the \addtoindex{op\_index register} is always
+architectures, this field is 1, the \addtoindex{op\_index} register is always
0, and the operation pointer is simply the address register.
\needlines{4}
\item opcode\_base (\addtoindex{ubyte}) \\
The
-\addtoindex{opcode\_base}
+\addtoindexx{opcode\_base}
number assigned to the first special opcode.
\textit{Opcode base is typically one greater than the highest-numbered
-\addtoindex{opcode\_base}
+\addtoindexx{opcode\_base}
standard opcode defined for the specified version of the line
number information (12 in
\addtoindex{DWARF Version 3} and
\addtoindexx{DWARF Version 2}
Version 2).
If opcode\_base is less than the typical value,
-\addtoindex{opcode\_base}
+\addtoindexx{opcode\_base}
then standard opcode numbers greater than or equal to the
opcode base are not used in the line number table of this unit
(and the codes are treated as special opcodes). If opcode\_base
element corresponds to the opcode whose value
is opcode\_base - 1.
-By increasing opcode\_base, and adding elements to this array,
-\addtoindex{opcode\_base}
+\textit{By increasing opcode\_base, and adding elements to this array,
+\addtoindexx{opcode\_base}
new standard opcodes can be added, while allowing consumers who
-do not know about these new opcodes to be able to skip them.
+do not know about these new opcodes to be able to skip them.}
-Codes for vendor specific extensions, if any, are described
-just like standard opcodes.
+\textit{Codes for vendor specific extensions, if any, are described
+just like standard opcodes.}
\needlines{3}
\item include\_directories (sequence of path names) \\
to add larger positive values to the address register. To
permit this variety of strategies, the line number program
header defines a
-\addtoindexx{line\_base}
+\addtoindex{line\_base}
field that specifies the minimum
value which a special opcode can add to the line register
-and a line\_range field that defines the range of values it
+and a
+\addtoindex{line\_range}
+field that defines the range of values it
can add to the line register.}
The
maximum line increment for a special opcode is the value
of the
-\addtoindexx{line\_base}
-field in the header, plus the value of
-the line\_range field, minus 1 (line base +
+\addtoindex{line\_base}
+field in the header, plus the value of the
+\addtoindex{line\_range} field, minus 1 (line base +
line range - 1).
If the desired line increment is greater than the maximum
line increment, a standard opcode must be used instead of a
If the resulting opcode is greater than 255, a standard opcode
must be used instead.
-When \addtoindex{maximum\_operations\_per\_instruction} is 1, the operation
+\textit{When \addtoindex{maximum\_operations\_per\_instruction} is 1, the operation
advance is simply the address increment divided by the
-\addtoindex{minimum\_instruction\_length}.
+\addtoindex{minimum\_instruction\_length}.}
+\needlines{6}
To decode a special opcode, subtract the opcode\_base from
the opcode itself to give the \textit{adjusted opcode}.
The \textit{operation advance}
the use of \livelink{chap:DWLNSadvancepc}{DW\-\_LNS\-\_advance\-\_pc}. Such assemblers, however, can
use \livelink{chap:DWLNSfixedadvancepc}{DW\-\_LNS\-\_fixed\-\_advance\-\_pc} instead, sacrificing compression.}
+\needlines{6}
\item \textbf{DW\-\_LNS\-\_set\-\_prologue\-\_end} \\
The \livetarg{chap:DWLNSsetprologueend}{DW\-\_LNS\-\_set\-\_prologue\-\_end}
opcode takes no operands. It sets the
\textit{Some languages, such as
\addtoindex{C} and
\addtoindex{C++}, provide a way to replace
-\addtoindex{macro information}
+\addtoindexx{macro information}
text in the source program with macros defined either in the
source file itself, or in another file included by the source
file. Because these macros are not themselves defined in the
\addtoindexx{prologue}
and
\addtoindex{epilogue} code is not always in
-distinct block
+distinct \nolink{blocks}
at the beginning and end of a subroutine. It is common
to duplicate the \addtoindex{epilogue} code
at the site of each return
\needlines{4}
The register rules are:
-\begin{tabular}{lp{8cm}}
+\begin{longtable}{lp{8cm}}
undefined
&A register that has this rule has no recoverable value in the previous frame.
(By convention, it is not preserved by a callee.) \\
expression(E)
&The previous value of this register is located at the address produced by
-executing the DWARF expression E.\\
+executing the DWARF expression E (see Section \refersec{chap:dwarfexpressions}).\\
val\_expression(E)
&The previous value of this register is the value produced by executing the
-DWARF expression E.\\
+DWARF expression E (see Section \refersec{chap:dwarfexpressions}).\\
architectural
&The rule is defined externally to this specification by the augmenter.\\
-\end{tabular}
+\end{longtable}
\textit{This table would be extremely large if actually constructed
as described. Most of the entries at any point in the table
This number is specific to the call frame information
and is independent of the DWARF version number.
-
+\needlines{8}
\item augmentation (\addtoindex{UTF\dash 8} string) \\
A null\dash terminated UTF\dash 8 string that identifies the augmentation
to this CIE or to the FDEs that use it. If a reader encounters
\item initial\_instructions (array of \addtoindex{ubyte}) \\
A sequence of rules that are interpreted to create the initial
-setting of each column in the table. The default rule for
+setting of each column in the table.
+
+The default rule for
all columns before interpretation of the initial instructions
is the undefined rule. However, an ABI authoring body or a
compilation system authoring body may specify an alternate
An FDE contains the following fields, in order:
\begin{enumerate}[1. ]
\item length (initial length) \\
-
A constant that gives the number of bytes of the header and
instruction stream for this function, not including the length
field itself
-(see Section \refersec{datarep:initiallengthvalues}).
+(see Section \refersec{datarep:initiallengthvalues}).
The size of the length field
plus the value of length must be an integral multiple of the
address size.
The instructions are defined in
the following sections.
+\needlines{8}
Some call frame instructions have operands that are encoded
as DWARF expressions
(see Section \refersec{chap:generaloperations}).
\item \textbf{DW\-\_CFA\-\_advance\-\_loc} \\
-The \livetarg{chap:DWCFAadvanceloc}{DW\-\_CFA\-\_advanceloc} instruction takes a single operand (encoded
+The \livetarg{chap:DWCFAadvanceloc}{DW\-\_CFA\-\_advance\_loc} instruction takes a single operand (encoded
with the opcode) that represents a constant delta. The required
action is to create a new table row with a location value that
is computed by taking the current entry\textquoteright s location value
is identical to \livelink{chap:DWCFAadvanceloc}{DW\-\_CFA\-\_advance\-\_loc} except for the encoding
and size of the delta operand.
+\needlines{6}
\item \textbf{DW\-\_CFA\-\_advance\-\_loc2} \\
The \livetarg{chap:DWCFAadvanceloc2}{DW\-\_CFA\-\_advance\-\_loc2} instruction takes a single
\addtoindex{uhalf}
offset. The required action is to define the current CFA rule
to use the provided register and offset.
+\needlines{6}
\item \textbf{ DW\-\_CFA\-\_def\-\_cfa\-\_sf} \\
The \livetarg{chap:DWCFAdefcfasf}{DW\-\_CFA\-\_def\-\_cfa\-\_sf} instruction takes two operands:
an unsigned LEB128 value\addtoindexx{LEB128!unsigned}
regarding restrictions on the DWARF
expression operators that can be used.}
+\needlines{6}
\item \textbf{ DW\-\_CFA\-\_restore} \\
The \livetarg{chap:DWCFArestore}{DW\-\_CFA\-\_restore} instruction takes a single operand (encoded
with the opcode) that represents a register number. The
\item \textit{ If a \livelink{chap:DWCFAadvanceloc}{DW\-\_CFA\-\_advance\-\_loc} or \livelink{chap:DWCFAsetloc}{DW\-\_CFA\-\_set\-\_loc}
instruction is encountered, then compute a new location value
-(L2). If L1 >= L2 then process the instruction and go back
+(L2). If L1 $\geq$ L2 then process the instruction and go back
to step 2.}
\item \textit{ The end of the instruction stream can be thought
\textit{A normal compilation unit typically represents the text and
data contributed to an executable by a single relocatable
object file. It may be derived from several source files,
-including pre\dash processed ``include files.''
+including pre\dash processed \doublequote{include files}.
A \addtoindex{partial compilation unit} typically represents a part of the text
and data of a relocatable object file, in a manner that can
potentially be shared with the results of other compilations
-to save space. It may be derived from an ``include file'',
+to save space. It may be derived from an \doublequote{include file},
template instantiation, or other implementation\dash dependent
portion of a compilation. A normal compilation unit can also
function in a manner similar to a partial compilation unit
(see Section \refersec{chap:linenumberinformation}).
\item A \livelink{chap:DWATmacroinfo}{DW\-\_AT\-\_macro\-\_info} attribute
-\addtoindex{macro information attribute}
+\addtoindexx{macro information attribute}
whose value is a
\addtoindexx{section offset!in macro information attribute}
section
\hypertarget{chap:DWATmacroinfomacroinformation}
offset to the macro information for this compilation unit.
+
This information is placed in a separate object file section
from the debugging information entries themselves. The
value of the macro information attribute is the offset in
An
imported declaration is represented by one or
-\addtoindex{imported declaration entry}
+\addtoindexx{imported declaration entry}
more debugging information entries with the
tag \livetarg{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration}.
When
\end{lstlisting}
\textit{the imported declaration entry for Q within module C refers
-directly to the variable declaration entry for A in module A
+directly to the variable declaration entry for X in module A
because there is no explicit representation for X in module B.
}
\label{chap:generalsubroutineandentrypointinformation}
The subroutine or entry point entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name}
attribute whose value is a null-terminated string containing the
-subroutine or entry point name as it appears in the source.
+subroutine or entry point name as it appears in the source program.
It may also have a \livelink{chap:DWATlinkagename}{DW\-\_AT\-\_linkage\-\_name} attribute as
described in Section \refersec{chap:linkagenames}.
If the name of the subroutine described by an entry with the
-\addtoindex{subprogram entry}
+\addtoindexx{subprogram entry}
tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}
is visible outside of its containing
\hypertarget{chap:DWATexternalexternalsubroutine}
\addtoindexx{exception thrown|see{thrown type entry}}
an
\addtoindexx{thrown exception|see{thrown type entry}}
-exception for one or more types, each such type is
+exception of one or more types, each such type is
represented by a debugging information entry with
\addtoindexx{thrown type entry}
the tag
\label{chap:functiontemplateinstantiations}
\textit{In \addtoindex{C++}, a function template is a generic definition of
-a function that is instantiated differently when called with
+a function that is instantiated differently for calls with
values of different types. DWARF does not represent the generic
template definition, but does represent each instantiation.}
\livelink{chap:DWATranges}{DW\-\_AT\-\_ranges},
\livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc},
\livelink{chap:DWATlocation}{DW\-\_AT\-\_location},
-\livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr}, \livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope},
+\livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr},
+\livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope},
and
-\livelink{chap:DWATsegment}{DW\-\_AT\-\_segment!and abstract instance}
+\livelink{chap:DWATsegment}{DW\-\_AT\-\_segment}
attributes
\addtoindexx{location attribute!and abstract instance}
typically
be
\addtoindexx{low PC attribute!and abstract instance}
omitted;
-\addtoindex{segment attribute!and abstract instance}
+\addtoindexx{segment attribute!and abstract instance}
however,
\addtoindexx{return address attribute!and abstract instance}
this
control. (A trampoline entry may but need not also have a
\livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial} attribute.)
+\needlines{5}
The value of the trampoline attribute may be represented
using any of the following forms, which are listed in order
of preference:
\addtoindexx{ranges attribute}
whose values encode the contiguous or non-contiguous address
ranges, respectively, of the machine instructions generated
-for the lexical \livelink{chap:lexicalblock}{block}
+for the lexical \nolink{block}
(see Section \refersec{chap:codeaddressesandranges}).
If a name has been given to the
-lexical \livelink{chap:lexicalblock}{block}
+lexical \nolink{block}
in the source
program, then the corresponding
-lexical \livelink{chap:lexicalblockentry}{block} entry has a
+lexical \nolink{block} entry has a
\livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose
\addtoindexx{name attribute}
value is a null\dash terminated string
-containing the name of the lexical \livelink{chap:lexicalblock}{block}
+containing the name of the lexical \nolink{block}
as it appears in
the source program.
\textit{This is not the same as a \addtoindex{C} or
\addtoindex{C++} label (see below).}
-The lexical \livelink{chap:lexicalblockentry}{block} entry owns
+The lexical \nolink{block} entry owns
debugging information entries that
-describe the declarations within that lexical \livelink{chap:lexicalblock}{block}.
+describe the declarations within that lexical \nolink{block}.
There is
one such debugging information entry for each local declaration
-of an identifier or inner lexical \livelink{chap:lexicalblock}{block}.
+of an identifier or inner lexical \nolink{block}.
\section{Label Entries}
\label{chap:labelentries}
is the amount of storage needed to hold
a value of the type.
+\needlines{5}
\textit{For example, the
\addtoindex{C} type int on a machine that uses 32\dash bit
integers is represented by a base type entry with a name