\livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr} is not necessary
for a local label.)}
-% This should be a subsubsubsection header but that does work...
-\textbf{Use of \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit} versus
-\livelink{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit}}
+
+\subsubsection{Use of DW\-\_TAG\-\_compile\-\_unit versus
+DW\-\_TAG\-\_partial\-\_unit}
A \addtoindex{section group} compilation unit that uses
\livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit}
the attributes assigned to a \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit}.
-\textbf{Use of \livelink{chap:DWTAGimportedunit}{DW\-\_TAG\-\_imported\-\_unit}}
+\subsubsection{Use of DW\-\_TAG\-\_imported\-\_unit}
A \livelink{chap:DWTAGimportedunit}{DW\-\_TAG\-\_imported\-\_unit} debugging information entry has an
\livelink{chap:DWATimport}{DW\-\_AT\-\_import} attribute referencing a \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit} or
\livelink{chap:DWTAGimportedunit}{DW\-\_TAG\-\_imported\-\_unit} entry.
-\textbf{Use of \livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}}
+\subsubsection{Use of DW\-\_FORM\-\_ref\-\_addr}
Use
\livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr} to reference from one compilation
is used to illustrate the DWARF
representation intended to allow duplicate elimination.
-\begin{figure}[t]
+\begin{figure}[ht]
\textit{File wa.h}
\begin{lstlisting}[numbers=none]
struct A {
==== Section group name:
my.compiler.company.cpp.wa.h.123456
== section \addtoindex{.debug\_info}
-DW.cpp.wa.h.123456.1: ! linker global symbol
+DW.cpp.wa.h.123456.1: ! linker global symbol
\livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit}
\livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}(\livelink{chap:DWLANGCplusplus}{DW\-\_LANG\-\_C\-\_plus\-\_plus})
... ! other unit attributes
-DW.cpp.wa.h.123456.2: ! linker global symbol
+DW.cpp.wa.h.123456.2: ! linker global symbol
\livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("int")
-DW.cpp.wa.h.123456.3: ! linker global symbol
+DW.cpp.wa.h.123456.3: ! linker global symbol
\livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("A")
-DW.cpp.wa.h.123456.4: ! linker global symbol
+DW.cpp.wa.h.123456.4: ! linker global symbol
\livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("i")
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(\livelink{chap:DWFORMrefn}{DW\-\_FORM\-\_refn} to DW.cpp.wa.h.123456.2)
! for n 1,2,4, or 8 can be used)
\end{alltt}
\end{dwflisting}
+\vspace{2mm}
\caption{Duplicate elimination example \#1: DWARF section group}
\label{fig:duplicateeliminationexample1dwarfsectiongroup}
\end{figure}
[generated code for function f]
== section \addtoindex{.debug\_info}
\livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit}
-.L1: ! local (non-linker) symbol
+.L1: ! local (non-linker) symbol
\livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type}
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to DW.cpp.wa.h.123456.3)
\livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}
\livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}(\livelink{chap:DWLANGFortran90}{DW\-\_LANG\-\_Fortran90})
\livelink{chap:DWATidentifiercase}{DW\-\_AT\-\_identifier\-\_case}(\livelink{chap:DWIDcaseinsensitive}{DW\-\_ID\-\_case\-\_insensitive})
-DW.myf90.CommonStuff.fh.654321.2: ! linker global symbol
+DW.myf90.CommonStuff.fh.654321.2: ! linker global symbol
3\$: \livelink{chap:DWTAGarraytype}{DW\-\_TAG\-\_array\-\_type}
! unnamed
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to DW.f90.F90\$main.f.2)
\livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}(constant 1)
\livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}(constant 100)
-DW.myf90.CommonStuff.fh.654321.3: ! linker global symbol
+DW.myf90.CommonStuff.fh.654321.3: ! linker global symbol
\livelink{chap:DWTAGcommonblock}{DW\-\_TAG\-\_common\-\_block}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("Common1")
\livelink{chap:DWATlocation}{DW\-\_AT\-\_location}(Address of common \nolink{block} Common1)
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to 3\$)
\livelink{chap:DWATlocation}{DW\-\_AT\-\_location}(address of C)
-DW.myf90.CommonStuff.fh.654321.4: ! linker global symbol
+DW.myf90.CommonStuff.fh.654321.4: ! linker global symbol
\livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant}
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("SEVEN")
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to DW.f90.F90\$main.f.2)
containing the type definitions shown
in Figure \refersec{fig:typesignatureexamplescsource}.
-\begin{figure}
+\begin{figure}[h]
\begin{lstlisting}
namespace N {
\label{fig:typesignaturecomputation1flattenedbytestream}
\end{figure}
+\needlines{4}
Running an \addtoindex{MD5 hash} over this byte stream, and taking the
low\dash order 64 bits, yields the final signature:
0xd28081e8 dcf5070a.
\begin{alltt}
signature
: opt-context debug-entry attributes children
-opt-context // Step 2
+opt-context // Step 2
: 'C' tag-code string opt-context
: empty
-debug-entry // Step 3
+debug-entry // Step 3
: 'D' tag-code
-attributes // Steps 4, 5, 6
+attributes // Steps 4, 5, 6
: attribute attributes
: empty
attribute
: 'N' at-code opt-context 'E' string // Reference to type by name
: 'R' at-code back-ref // Back-reference to visited type
: 'T' at-code signature // Recursive type
-children // Step 7
+children // Step 7
: child children
: '0'
child
\chapter{Debug Section Relationships (Informative)}
\label{app:debugsectionrelationshipsinformative}
-%
DWARF information is organized into multiple program sections,
each of which holds a particular kind of information. In some
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.
-\begin{figure}[h]
-\small
+\begin{figure}[H]
\begin{tikzpicture}
- [sect/.style={rectangle, rounded corners, draw, fill=blue!20, inner sep=.2cm, minimum width=4.5cm},
- link/.style={rectangle, draw, inner sep=.2cm, minimum width=5.0cm}]
+ [sect/.style={rectangle, rounded corners=10pt, draw, fill=blue!10, inner sep=.2cm, minimum width=4.5cm},
+ link/.style={rectangle, draw, inner sep=.2cm, minimum width=5.0cm}]
% The left column, first sections, then links, from top to bottom
%
\node(zlinkb) at ( 0, 2.0) [link] {To compilation unit (b)};
\node(zsectpub) at ( 0, 0.0) [sect] {\begin{tabular}{c} \dotdebugpubnames \\ \dotdebugpubtypes \end{tabular}};
-\draw[thick,-o] (zlinka) -- (zsectara);
-\draw[thick,angle 90-] (zsectinf) -- (zlinka);
-\draw[thick,-angle 90] (zlinkb) -- (zsectinf);
-\draw[thick,o-] (zsectpub) -- (zlinkb);
+\draw[thick,-to reversed] (zlinka) -- (zsectara);
+\draw[thick,angle 90-] (zsectinf) -- (zlinka);
+\draw[thick,-angle 90] (zlinkb) -- (zsectinf);
+\draw[thick,to reversed-] (zsectpub) -- (zlinkb);
% The middle column, similarly
%
% Links between left and center
%
-\draw[thick,o-] (zsectinf) -- (zlinkc.west);
-\draw[thick,o-] (zsectinf) -- (zlinkd.west);
-\draw[thick,angle 90-] (zsectinf) -- (zlinke.west);
-\draw[thick,o-] (zsectinf) -- (zlinkf.west);
-\draw[thick,o-] (zsectinf) -- (zlinkg.west);
-\draw[thick,o-] (zsectinf) -- (zlinkh.west);
-\draw[thick,o-] (zsectinf) -- (zlinki.west);
+\draw[thick,to reversed-] (zsectinf) -- (zlinkc.west);
+\draw[thick,to reversed-] (zsectinf) -- (zlinkd.west);
+\draw[thick,angle 90-] (zsectinf) -- (zlinke.west);
+\draw[thick,to reversed-] (zsectinf) -- (zlinkf.west);
+\draw[thick,to reversed-] (zsectinf) -- (zlinkg.west);
+\draw[thick,to reversed-] (zsectinf) -- (zlinkh.west);
+\draw[thick,to reversed-] (zsectinf) -- (zlinki.west);
% The right column
%
%
\draw[thick,-angle 90] (zlinkc.east) -- (zsectabb.west);
\draw[thick,-angle 90] (zlinkd.east) -- (zsectstr.west);
-\draw[thick,-o] (zlinke.east) -- (zsectloc.west);
+\draw[thick,-to reversed] (zlinke.east) -- (zsectloc.west);
\draw[thick,-angle 90] (zlinkf.east) -- (zsectloc.south west);
\draw[thick,-angle 90] (zlinkg.east) -- (zsectran.west);
\draw[thick,-angle 90] (zlinkh.east) -- (zsectmac.west);
\draw[thick,-angle 90] (zlinki.east) -- (zsectlin.west);
\end{tikzpicture}
-
-\vspace{1cm}
+\vspace{5mm}
\caption{Debug section relationships}
\label{fig:debugsectionrelationships}
\end{figure}
% 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}{25 April 2013 (***Draft***)}
+\newcommand{\docdate}{May 2, 2013 \hspace{1cm}(***\textbf{DRAFT}***)}
%
\usepackage[T1]{fontenc}
-\usepackage{bookman}
+\usepackage{palatino}
\usepackage{cmtt}
\renewcommand{\ttdefault}{cmtt} % Use Computer Modern Typewriter instead of Courier
%\usepackage{ascii}
%\DisableLigatures[f]{encoding=T1}
%\renewcommand{\familydefault}{phv} % font family helvetica
%
+
\usepackage{url} % For color in letters. Links instead?
\usepackage[usenames]{color} % For color in letters. Links instead?
\usepackage{ellipsis} % Provides ... as \dots
\lstset{ %
language={}, % choose the language of the code
basicstyle=\footnotesize\ttfamily, % the size of the fonts that are used for the code
-numbers=left, % where to put the line-numbers
+numbers=none, % where to put the line-numbers
numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
numberfirstline=true,
firstnumber=1, % first line number in each listing
\flushleft
\raggedbottom
-\chapterstyle{section}
+\chapterstyle{default}
\setlength{\parindent}{0pt}
\include{programscope} \emptypage
\include{dataobject} \emptypage
\include{typeentries} \emptypage
-\include{otherdebugginginformation} \emptypage
-\include{datarepresentation} %\emptypage
+\include{otherdebugginginformation} \emptypage
+\include{datarepresentation} \emptypage
+
% 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
\include{sectionversionnumbers}
\include{gnulicense}
+
\printindex
+
\end{document}
% These eliminate the need to use escapes for the underscores and
% add entries for indexing
%
-\newcommand{\DWFORMstrp}[1][]{\addtoindex{DW\_FORM\_strp}}
-\newcommand{\DWOPcallref}[1][]{\addtoindex{DW\_OP\_call\_ref}}
+\newcommand{\DWFORMstrp}[1][]{\addtoindex{DW\-\_FORM\-\_strp}}
+\newcommand{\DWOPcallref}[1][]{\addtoindex{DW\-\_OP\-\_call\_ref}}
\newcommand{\DWATlocation}[1][]{\addtoindex{DW\_AT\_location}}
\newcommand{\DWATranges}[1][]{\addtoindex{DW\_AT\_ranges}}
\newcommand{\DWATmacroinfo}[1][]{\addtoindex{DW\_AT\_macro\_info}}
\newcommand{\dotdebugranges}[1][]{\addtoindex{\texttt{.debug\_ranges}}}
\newcommand{\dotdebugstr}[1][]{\addtoindex{\texttt{.debug\_str}}}
\newcommand{\dotdebugtypes}[1][]{\addtoindex{\texttt{.debug\_types}}}
+
+\newcommand{\dotdata}[1][]{\addtoindex{\texttt{.data}}}
+\newcommand{\dottext}[1][]{\addtoindex{\texttt{.text}}}
byte = low order 7 bits of value;
value >>= 7;
/* the following is unnecessary if the
- * implementation of >>= uses an arithmetic rather
- * than logical shift for a signed left operand
- */
+ * implementation of >>= uses an arithmetic rather
+ * than logical shift for a signed left operand
+ */
if (negative)
/* sign extend */
value |= - (1 <<(size - 7));
\begin{figure}[here]
\begin{lstlisting}
struct desc {
- long el_len; // Element length
- void * base; // Address of raw data
+ long el_len; // Element length
+ void * base; // Address of raw data
int ptr_assoc : 1; // Pointer is associated flag
int ptr_alloc : 1; // Pointer is allocated flag
int num_dims : 6; // Number of dimensions
- struct dims_str { // For each dimension...
+ struct dims_str { // For each dimension...
long low_bound;
long upper_bound;
long stride;
\livelink{chap:DWATname}{DW\-\_AT\-\_name}("arrays")
\livelink{chap:DWATtype}{DW\-\_AT\-\_type}(reference to 6\$)
\livelink{chap:DWATlocation}{DW\-\_AT\-\_location}(expression=
- ...as appropriate...) ! Assume static allocation
+ ...as appropriate...) ! Assume static allocation
\end{alltt}
\end{dwflisting}
\begin{center}
\livetarg{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
&\livelinki{chap:DWATbitsizebasetypebitsize}{Base type bit size}{base type bit size} \\
&\livelinki{chap:DWATbitsizedatamemberbitsize}{Data member bit size}{data member bit size} \\
+\newpage
\livetarg{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}
&\livelinki{chap:DWATbitstridearrayelementstrideofarraytype}{Array element stride (of array type)}{array element stride (of array type)} \\
&\livelinki{chap:DWATbitstridesubrangestridedimensionofarraytype}{Subrange stride (dimension of array type)}{subrange stride (dimension of array type)} \\
&\livelinki{chap:DWATbitstrideenumerationstridedimensionofarraytype}{Enumeration stride (dimension of array type)}{enumeration stride (dimension of array type)} \\
\livetarg{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
&\livelinki{chap:DWATbytesizedataobjectordatatypesize}{Data object or data type size}{data object or data type size} \\
-\newpage
\livetarg{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
&\livelinki{chap:DWATbytestridearrayelementstrideofarraytype}{Array element stride (of array type)}{array element stride (of array type)} \\
&\livelinki{chap:DWATbytestridesubrangestridedimensionofarraytype}{Subrange stride (dimension of array type)}{subrange stride (dimension of array type)} \\
zero bits) by the number of bits specified by the former top
of the stack, and pushes the result.
+\needlines{6}
\itembfnl{\livetarg{chap:DWOPshra}{DW\-\_OP\-\_shra}}
The \livelink{chap:DWOPshra}{DW\-\_OP\-\_shra} operation pops the top two stack entries,
shifts the former second entry right arithmetically (divide
A structure member is four bytes from the start of the structure
instance. The base address is assumed to be already on the stack.
-\descriptionitemnl{\livelink{chap:DWOPreg}{DW\-\_OP\-\_reg3} \livelink{chap:DWOPpiece}{DW\-\_OP\-\_piece} 4 \livetarg{chap:DWOPreg10}{DW\-\_OP\-\_reg10} \livelink{chap:DWOPpiece}{DW\-\_OP\-\_piece} 2}
+\descriptionitemnl{\livelink{chap:DWOPreg}{DW\-\_OP\-\_reg3} \livelink{chap:DWOPpiece}{DW\-\_OP\-\_piece} 4 \livelink{chap:DWOPreg}{DW\-\_OP\-\_reg10} \livelink{chap:DWOPpiece}{DW\-\_OP\-\_piece} 2}
A variable whose first four bytes reside in register 3 and whose next
two bytes reside in register 10.
register of the state machine.
\end{enumerate}
-\subsubsection{ExtendedOpcodes}
+\needlines{8}
+\subsubsection{Extended Opcodes}
\label{chap:extendedopcodes}
The extended opcodes are as follows:
\end{itemize}
If there is no augmentation, this value is a zero byte.
+\needlines{5}
\textit{The augmentation string allows users to indicate that there
is additional target\dash specific information in the CIE or FDE
which is needed to unwind a stack frame. For example, this
match the length value above.
\end{enumerate}
+\needlines{5}
An FDE contains the following fields, in order:
\begin{enumerate}[1. ]
\item length (initial length) \\
any corresponding debugging compilation unit information,
thus there is no way to interpret the call offset.
+\needlines{5}
\item \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address} is not meaningful in an operand
of these instructions because there is no object context to
provide a value to push.
entries used by entries in the current compilation unit
(see Section \refersec{chap:basetypeentries}).
+\needlines{6}
This attribute provides a consumer a way to find the definition
of base types for a compilation unit that does not itself
contain such definitions. This allows a consumer, for example,
in the same order as the corresponding declarations in the
source program.
+\needlines{5}
\textit{There is no ordering requirement for entries for declarations
that are children of subroutine or entry point entries but
that do not represent formal parameters. The formal parameter
%a hyperref to the def itself, which is earlier in this document.
\end{enumerate}
+\needlines{5}
\textit{Some languages support nested subroutines. In such languages,
it is possible to reference the local variables of an
outer subroutine from within an inner subroutine. The
\addtoindexx{start scope attribute!and abstract instance}
is not exhaustive.
+\needlines{5}
\textit{It would not make sense normally to put these attributes into
abstract instance entries since such entries do not represent
actual (concrete) instances and thus do not actually exist at
defines the following combinations of attributes:}
\begin{itemize}
-\item \textit{DW\-\_AT\-\_byte\-\_size}
-\item \textit{DW\-\_AT\-\_bit\-\_size}
+\item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}}
+\item \textit{\livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}}
\item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size},
\livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
and optionally \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}}
% FIXME: the figure below interferes with the following
% bullet list, which looks horrible as a result.
\begin{itemize}
-\item \textit{DW\-\_AT\-\_byte\-\_size}
+\item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}}
\item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size},
\livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and
\livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}}
(using \livelink{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}) may have a
\livelink{chap:DWATcount}{DW\-\_AT\-\_count} attribute
\addtoindexx{count attribute}
-whose value is a constant expressing the blocksize of the
-type. If no count attribute is present, then the \doublequote{infinite}
+whose value is a constant expressing the (explicit or implied) blocksize specified for the
+type in the source. If no count attribute is present, then the \doublequote{infinite}
blocksize is assumed.
When multiple type modifiers are chained together to modify
for function members, location descriptions for data members)
and will have a \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute.
+\needlines{5}
\textit{Consider a nested class whose
definition occurs outside of the containing class definition, as in:}
\label{chap:accessdeclarations}
\textit{In \addtoindex{C++}, a derived class may contain access declarations that
-\addtoindex{access declaration entry}
+\addtoindexx{access declaration entry}
change the accessibility of individual class members from the
overall accessibility specified by the inheritance declaration.
A single access declaration may refer to a set of overloaded
entities.
+\needlines{6}
\subsection{Friends}
\label{chap:friends}
string containing the member name as it appears in the source
program. If the member entry describes an
\addtoindex{anonymous union},
-the
-name attribute is omitted or consists of a single zero byte.
+the name attribute is omitted or the value of the attribute
+consists of a single zero byte.
The data member entry has
\addtoindexx{type attribute}
member was declared with the mutable storage class specifier.
The beginning of a data member
-\addtoindex{beginning of a data member}
+\addtoindexx{beginning of a data member}
is described relative to
\addtoindexx{beginning of an object}
the beginning of the object in which it is immediately
is the amount
of storage needed to hold the value of the data member.
-\textit{\addtoindex{C} and \addtoindex{C++}
+\textit{Bit fields in \addtoindex{C} and \addtoindex{C++}
typically
-\addtoindex{bit fields}
+\addtoindexx{bit fields}
require the use
\addtoindexx{data bit offset}
of
\livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} and
\livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attributes.}
+\needlines{6}
\textit{This Standard uses the following bit numbering and direction
conventions in examples. These conventions are for illustrative
purposes and other conventions may apply on particular
architectures.}
-
-
\begin{itemize}
\item \textit{For big\dash endian architectures, bit offsets are
counted from high-order to low\dash order bits within a byte (or
value parameter for this instantiation as represented on the
target architecture.
+\needlines{5}
\item The class type entry and each of its child entries references
a \addtoindex{template type parameter entry} in any circumstance where the
source template definition references a formal parameterized
information entry representing the special compilation unit
should be empty or omitted.
+\needlines{5}
\item If the class type entry representing the template
instantiation or any of its child entries contains declaration
coordinate attributes, those attributes should refer to