author Ron Brender Thu, 9 May 2013 18:02:17 +0000 (14:02 -0400) committer Ron Brender Thu, 9 May 2013 18:02:17 +0000 (14:02 -0400)
last several months.

Signed-off-by: Ron Brender <ron.brender@gmail.com>
14 files changed:

index ecdf6cb..87bffc0 100644 (file)
@@ -15,7 +15,8 @@ entry. Therefore, the list may be taken as instructive, but
cannot be considered definitive.

In the following table,
+\livetarg{chap:DECL}
means include all three of the
@@ -37,7 +38,7 @@ means include all three of the
\endlastfoot

-& DECL \\
@@ -45,7 +46,7 @@ means include all three of the

\hline
-&DECL \\
@@ -66,7 +67,7 @@ means include all three of the

\hline
-&DECL \\
@@ -88,7 +89,7 @@ means include all three of the

\hline
-&DECL \\*
@@ -98,7 +99,7 @@ means include all three of the

\hline
-&DECL \\
@@ -117,7 +118,7 @@ means include all three of the

\hline
-&DECL \\
@@ -129,7 +130,7 @@ means include all three of the

\hline
-&DECL \\
@@ -154,7 +155,7 @@ means include all three of the

\hline
-&DECL \\

@@ -169,7 +170,7 @@ means include all three of the

\hline
-&DECL \\
@@ -189,7 +190,7 @@ means include all three of the

\hline
-&DECL \\
@@ -204,7 +205,7 @@ means include all three of the

\hline
-&DECL \\
@@ -227,7 +228,7 @@ means include all three of the

\hline
-&DECL \\
@@ -235,7 +236,7 @@ means include all three of the

\hline
-&DECL \\
@@ -251,7 +252,7 @@ means include all three of the

\hline
-&DECL \\
@@ -268,14 +269,14 @@ means include all three of the

\hline
-&DECL \\

\hline
-&DECL \\
@@ -285,7 +286,7 @@ means include all three of the

\hline
-&DECL \\
@@ -296,7 +297,7 @@ means include all three of the

\hline
-&DECL \\
@@ -322,7 +323,7 @@ means include all three of the

\hline
-&DECL \\
@@ -331,7 +332,7 @@ means include all three of the

\hline
-&DECL \\
@@ -342,7 +343,7 @@ means include all three of the

\hline
-&DECL \\
@@ -354,7 +355,7 @@ means include all three of the

\hline
-&DECL \\
@@ -371,7 +372,7 @@ means include all three of the

\hline
-&DECL \\
@@ -388,7 +389,7 @@ means include all three of the

\hline
-&DECL \\
@@ -398,13 +399,13 @@ means include all three of the

\hline
-&DECL \\

\hline
-&DECL \\
@@ -440,7 +441,7 @@ means include all three of the

\hline
-&DECL  \\
@@ -451,7 +452,7 @@ means include all three of the

\hline
-&DECL  \\
@@ -487,7 +488,7 @@ means include all three of the

\hline
-&DECL  \\
@@ -498,7 +499,7 @@ means include all three of the

\hline
-&DECL  \\
@@ -526,7 +527,7 @@ means include all three of the

\hline
-&DECL  \\
@@ -544,7 +545,7 @@ means include all three of the

\hline
-&DECL  \\
@@ -563,7 +564,7 @@ means include all three of the

\hline
-&DECL  \\
@@ -601,7 +602,7 @@ means include all three of the

\hline
-&DECL  \\
@@ -624,7 +625,7 @@ means include all three of the

\hline
-&DECL  \\
@@ -642,7 +643,7 @@ means include all three of the

\hline
-&DECL   \\
@@ -659,7 +660,7 @@ means include all three of the

\hline
-&DECL   \\
@@ -667,7 +668,7 @@ means include all three of the

\hline
-&DECL   \\
@@ -676,7 +677,7 @@ means include all three of the

\hline
-&DECL   \\
@@ -685,7 +686,7 @@ means include all three of the

\hline
-&DECL   \\
@@ -695,7 +696,7 @@ means include all three of the

\hline
-&DECL   \\
@@ -715,7 +716,7 @@ means include all three of the

\hline
-&DECL   \\
@@ -734,20 +735,20 @@ means include all three of the

\hline
-&DECL   \\

\hline
-&DECL   \\

\hline
-&DECL    \\
@@ -768,7 +769,7 @@ means include all three of the

\hline
-&DECL    \\
@@ -778,7 +779,7 @@ means include all three of the

\hline
-&DECL   \\
index eb9c847..229399d 100644 (file)
@@ -55,24 +55,24 @@ A traditional relocatable object output
from a single compilation might contain sections
named:
\begin{alltt}
+    \dotdata{}
+    \dottext{}
+    \dotdebuginfo{}
+    \dotdebugabbrev{}
+    \dotdebugline{}
+    \dotdebugaranges{}
\end{alltt}
A relocatable object from a compilation system
attempting duplicate DWARF elimination might
contain sections as in:

\begin{alltt}
+    \dotdata{}
+    \dottext{}
+    \dotdebuginfo{}
+    \dotdebugabbrev{}
+    \dotdebugline{}
+    \dotdebugaranges{}
\end{alltt}

followed (or preceded, the order is not significant)
@@ -81,18 +81,18 @@ by a series of
section groups:
\begin{alltt}
==== Section group 1
+    \dotdebuginfo{}
+    \dotdebugabbrev{}
+    \dotdebugline{}
==== ...
==== Section group N
+    \dotdebuginfo{}
+    \dotdebugabbrev{}
+    \dotdebugline{}
\end{alltt}

where each \addtoindex{section group} might or might not contain executable
-code (\textit{.text} sections) or data (\textit{.data} sections).
+code (\dottext{} sections) or data (\dotdata{} sections).

\needlines{6}
A \textit{\addtoindex{section group}} is a named set
@@ -144,13 +144,13 @@ linker (outside of DWARF itself, and normal object/linker
facilities such as simple relocations) are:
\begin{enumerate}[1. ]

-\item A means of referencing from inside one \addtoindex{.debug\_info}
+\item A means of referencing from inside one \dotdebuginfo{}
compilation unit to another
+\dotdebuginfo{} compilation unit

\item A means of having multiple contributions to specific sections
-(for example, \addtoindex{.debug\_info}, and so on) in a single object file.
+(for example, \dotdebuginfo{}, and so on) in a single object file.

\item  A means of identifying a \addtoindex{section group} (giving it a name).

@@ -250,7 +250,7 @@ section groups.}

So, for example, the \addtoindex{section group}
corresponding to file wa.h
-above is given the name \textit{my.compiler.company.cpp.wa.h.123456}.
+above is given the name \texttt{my.compiler.company.cpp.wa.h.123456}.

@@ -292,7 +292,7 @@ during compilation.
In general, every point in the
section group
+\dotdebuginfo{} that
could be referenced from outside by \emph{any} compilation unit must
normally have an external name generated for it in the linker
symbol table, whether the current compilation references all
@@ -399,8 +399,8 @@ unit's debugging information entries to those of another
compilation unit.

When referencing into a removable \addtoindex{section group}
-from another \addtoindex{.debug\_info} (from anywhere), the
+\dotdebuginfo{}
+from another \dotdebuginfo{} (from anywhere), the
\texttt{<prefix>.<file-designator>.<gid-number>.<die-number>}
name should be used for an external symbol and a relocation
generated based on that name.
@@ -408,8 +408,8 @@ generated based on that name.
\textit{When referencing into a
non-section group
+\dotdebuginfo{},
+from another \dotdebuginfo{} (from anywhere)
still the form to be used, but a section\dash relative relocation
generated by use of a non-exported name (often called an
@@ -426,17 +426,17 @@ concrete basis for discussion.

In these examples, the focus is on the arrangement of DWARF
information into sections (specifically the
+\dotdebuginfo{}
section) and the naming conventions used to achieve references
into
section groups.
In practice, all of the examples that
follow involve DWARF sections other than just
+\dotdebuginfo{}
+(for example, \dotdebugline{},
+\dotdebugaranges{}, or others);
+however, only the \dotdebuginfo{}
section is shown to keep the
examples compact and easier to read.

@@ -482,7 +482,7 @@ wa.h.
\begin{alltt}
==== Section group name:
my.compiler.company.cpp.wa.h.123456
+== section \dotdebuginfo{}
@@ -516,9 +516,9 @@ in the \addtoindex{section group} shown above.
\begin{figure}
\begin{dwflisting}
\begin{alltt}
-== section .text
+== section \dottext{}
[generated code for function f]
+== section \dotdebuginfo{}
@@ -585,7 +585,7 @@ CommonStuff.fh.

my.f90.company.f90.CommonStuff.fh.654321

+== section \dotdebuginfo{}

@@ -631,10 +631,10 @@ shows the sections for the primary compilation unit.
\begin{figure}
\begin{dwflisting}
\begin{alltt}
-== section .text
+== section \dottext{}
[code for function Foo]

+== section \dotdebuginfo{}
@@ -674,7 +674,7 @@ END
\needlines{3}
That main program results in an object file that
contained a duplicate of the \addtoindex{section group} named
-my.f90.company.f90.CommonStuff.fh.654321
+\texttt{my.f90.company.f90.CommonStuff.fh.654321}
corresponding to the
included file as well as the remainder of the main subprogram
as shown in
@@ -683,7 +683,7 @@ Figure \refersec{fig:duplicateeliminationexample2companiondwarf}.
\begin{figure}
\begin{dwflisting}
\begin{alltt}
+== section \dotdebuginfo{}
\livelink{chap:DWATtype}{DW\_AT\_type}(reference to 6\$) \livelink{chap:DWATlocation}{DW\_AT\_location}(expression= ...as appropriate...) ! Assume static allocation @@ -461,13 +461,13 @@ of the do loop. Suppose further that the user enters the following debug command: \begin{lstlisting}[numbers=none] -debug> print arrays(5)%ap(2) +debug> print arrayvar(5)%ap(2) \end{lstlisting} Interpretation of this expression proceeds as follows: \begin{enumerate}[1. ] -\item Lookup name arrays. We find that it is a variable, +\item Lookup name \texttt{arrayvar}. We find that it is a variable, whose type is given by the unnamed type at 6\$. Notice that
the type is an array type.

@@ -487,11 +487,12 @@ bound too, but we will skip that for this example. \rbrack

\end{enumerate}

-For a), check for a \livelink{chap:DWATdatalocation}{DW\_AT\_data\_location} attribute. Since
-there is one, go execute the expression, whose result is
+For a), check for a
+Since there is one, go execute the expression, whose result is
is the object we are working on, namely the variable named
be the same as the address from step 1.)

@@ -499,13 +500,13 @@ For b), for each dimension of the array (only one
in this case), go interpret the usual lower bound
attribute. Again this is an expression, which again begins
-\textbf{still} arrays,
+\textbf{still} \texttt{arrayvar},
from step 1, because we have not begun to actually perform
any indexing yet.

For c), the default stride applies. Since there is no
\livelink{chap:DWATbytestride}{DW\_AT\_byte\_stride} attribute, use the size of the array element
-type, which is the size of type array\_ptr (at 3\$). +type, which is the size of type \texttt{array\_ptr} (at 3\$).

\clearpage

@@ -515,15 +516,15 @@ any of the attributes involved up to now. Those just provide
the actual values used in the indexing step.

The result is an object within the memory that was dynamically
-allocated for arrays.
+allocated for \texttt{arrayvar}.

-\item  Find the ap component of the object just identified,
-whose type is array\_ptr.
+\item  Find the \texttt{ap} component of the object just identified,
+whose type is \texttt{array\_ptr}.

This is a conventional record component lookup and
-interpretation. It happens that the ap component in this case
+interpretation. It happens that the \texttt{ap} component in this case
begins at offset 4 from the beginning of the containing object.
-Component ap has the unnamed array type defined at 1\$in the +Component \texttt{ap} has the unnamed array type defined at 1\$ in the
symbol table.

\item  Find the second element of the array object found in step 3. To do array indexing requires
@@ -580,19 +581,19 @@ OBJ2B : REC2;
\end{figure}

-VEC1 illustrates an (unnamed) array type where the upper bound
+\texttt{VEC1} illustrates an (unnamed) array type where the upper bound
of the first and only dimension is determined at runtime.
semantics require that the value of an array bound is fixed at
-the time the array type is elaborated (where elaboration refers
+the time the array type is elaborated (where \textit{elaboration} refers
to the runtime executable aspects of type processing). For
the purposes of this example, we assume that there are no
-other assignments to M so that it safe for the REC1 type
+other assignments to \texttt{M} so that it safe for the \texttt{REC1} type
description to refer directly to that variable (rather than
-a compiler generated copy).
+a compiler-generated copy).

-REC2 illustrates another array type (the unnamed type of
-component VEC2) where the upper bound of the first and only
+\texttt{REC2} illustrates another array type (the unnamed type of
+component \texttt{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 \textit{discriminant} is a component of a record whose value
@@ -606,12 +607,12 @@ Figure \refersec{fig:adaexampledwarfdescription}.

Interesting aspects about this example are:
\begin{enumerate}[1. ]
-\item The array VEC2 is immediately'' contained within structure
-REC2 (there is no intermediate descriptor or indirection),
+\item The array \texttt{VEC2} is \doublequote{immediately} contained within structure
+\texttt{REC2} (there is no intermediate descriptor or indirection),
which is reflected in the absence of a \livelink{chap:DWATdatalocation}{DW\_AT\_data\_location}
attribute on the array type at 28\. -\item One of the bounds of VEC2 is nonetheless dynamic and part of +\item One of the bounds of \texttt{VEC2} is nonetheless dynamic and part of the same containing record. It is described as a reference to a member, and the location of the upper bound is determined as for any member. That is, the location is determined using @@ -626,7 +627,7 @@ 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 type ARR is not needed for the purposes +the unconstrained array type \texttt{ARR} is not needed for the purposes of this example and therefore is not shown. \end{enumerate} @@ -1198,14 +1199,15 @@ the style of the Motorola 88000. by adding the contents of the source register with the constant. -\item There are 8 4\dash byte registers: -\begin{alltt} - R0 always 0 - R1 holds return address on call - R2-R3 temp registers (not preserved on call) - R4-R6 preserved on call - R7 stack pointer. -\end{alltt} +\item There are eight 4\dash byte registers: +\newline +\begin{tabular}{p{5mm}l} + & R0 always 0 \\ + & R1 holds return address on call \\ + & R2-R3 temp registers (not preserved on call) \\ + & R4-R6 preserved on call \\ + & R7 stack pointer \\ +\end{tabular} \item The stack grows in the negative direction. @@ -1225,19 +1227,19 @@ pointer). The first column values are byte addresses. \begin{figure}[here] \begin{lstlisting} ;; start prologue -foo sub R7, R7, <fs> ; Allocate frame -foo+4 store R1, R7, (<fs>-4) ; Save the return address -foo+8 store R6, R7, (<fs>-8) ; Save R6 -foo+12 add R6, R7, 0 ; R6 is now the Frame ptr -foo+16 store R4, R6, (<fs>-12) ; Save a preserved reg +foo sub R7, R7, <fs> ; Allocate frame +foo+4 store R1, R7, (<fs>-4) ; Save the return address +foo+8 store R6, R7, (<fs>-8) ; Save R6 +foo+12 add R6, R7, 0 ; R6 is now the Frame ptr +foo+16 store R4, R6, (<fs>-12) ; Save a preserved reg ;; This subroutine does not change R5 ... ;; Start epilogue (R7 is returned to entry value) -foo+64 load R4, R6, (<fs>-12) ; Restore R4 -foo+68 load R6, R7, (<fs>-8) ; Restore R6 -foo+72 load R1, R7, (<fs>-4) ; Restore return address -foo+76 add R7, R7, <fs> ; Deallocate frame -foo+80 jump R1 ; Return +foo+64 load R4, R6, (<fs>-12) ; Restore R4 +foo+68 load R6, R7, (<fs>-8) ; Restore R6 +foo+72 load R1, R7, (<fs>-4) ; Restore return address +foo+76 add R7, R7, <fs> ; Deallocate frame +foo+80 jump R1 ; Return foo+84 \end{lstlisting} \caption{Call frame information example: machine code fragments} @@ -1250,20 +1252,20 @@ An abstract table for the foo subroutine is shown in Table \referfol{tab:callframeinformationexampleconceptualmatrix}. Corresponding fragments from the -\addtoindex{.debug\_frame} section are shown in +\dotdebugframe{} section are shown in Table \refersec{tab:callframeinformationexamplecommoninformationentryencoding}. The following notations apply in Table \refersec{tab:callframeinformationexampleconceptualmatrix}: - -\begin{alltt} -1. R8 is the return address -2. s = same\_value rule -3. u = undefined rule -4. rN = register(N) rule -5. cN = offset(N) rule -6. a = architectural rule -\end{alltt} +\newline +\begin{tabular}{p{5mm}l} +&1. R8 is the return address \\ +&2. s = same\_value rule \\ +&3. u = undefined rule \\ +&4. rN = register(N) rule \\ +&5. cN = offset(N) rule \\ +&6. a = architectural rule \\ +\end{tabular} \begin{centering} \setlength{\extrarowheight}{0.1cm} @@ -1338,12 +1340,12 @@ cie+40 && \\ The following notations apply in Table \refersec{tab:callframeinformationexampleframedescriptionentryencoding}: - -\begin{alltt} -1. <fs> = frame size -2. <caf> = code alignment factor -3. <daf> = data alignment factor -\end{alltt} +\newline +\begin{tabular}{p{5mm}l} +&\texttt{<fs> =} frame size \\ +&\texttt{<caf> =} code alignment factor \\ +&\texttt{<daf> =} data alignment factor \\ +\end{tabular} \begin{centering} @@ -1395,9 +1397,9 @@ Figure \referfol{fig:inliningexamplespseudosourcefragment} is used to illustrate the \addtoindexx{inlined subprogram call!examples} use of DWARF to describe inlined subroutine calls. This -example involves a nested subprogram INNER that makes uplevel +example involves a nested subprogram \texttt{INNER} that makes uplevel references to the formal parameter and local variable of the -containing subprogram OUTER. +containing subprogram \texttt{OUTER}. \begin{figure}[here] \begin{lstlisting} @@ -1425,22 +1427,22 @@ OUTER(7); There are several approaches that a compiler might take to inlining for this sort of example. This presentation considers three such approaches, all of which involve inline expansion -of subprogram OUTER. (If OUTER is not inlined, the inlining +of subprogram \texttt{OUTER}. (If \texttt{OUTER} is not inlined, the inlining reduces to a simpler single level subset of the two level approaches considered here.) The approaches are: \begin{enumerate}[1. ] -\item Inline both OUTER and INNER in all cases +\item Inline both \texttt{OUTER} and \texttt{INNER} in all cases -\item Inline OUTER, multiple INNERs \\ -Treat INNER as a non\dash inlinable part of OUTER, compile and -call a distinct normal version of INNER defined within each -inlining of OUTER. +\item Inline \texttt{OUTER}, multiple \texttt{INNER}s \\ +Treat \texttt{INNER} as a non\dash inlinable part of \texttt{OUTER}, compile and +call a distinct normal version of \texttt{INNER} defined within each +inlining of \texttt{OUTER}. -\item Inline OUTER, one INNER \\ -Compile INNER as a single normal subprogram which is called -from every inlining of OUTER. +\item Inline \texttt{OUTER}, one \texttt{INNER} \\ +Compile \texttt{INNER} as a single normal subprogram which is called +from every inlining of \texttt{OUTER}. \end{enumerate} This discussion does not consider why a compiler might choose @@ -1456,7 +1458,7 @@ form where \begin{description} \item[\textless io\textgreater] -is either INNER or OUTER to indicate to which +is either \texttt{INNER} or \texttt{OUTER} to indicate to which subprogram the debugging information entry applies, \item[\textless ac\textgreater] is either AI or CI to indicate abstract instance'' or @@ -1478,18 +1480,18 @@ For conciseness, declaration coordinates and call coordinates are omitted. \label{app:inlinebothouterandinner} A suitable abstract instance for an alternative where both -OUTER and INNER are always inlined is shown in +\texttt{OUTER} and \texttt{INNER} are always inlined is shown in Figure \refersec{fig:inliningexample1abstractinstance}. Notice in -Figure \refersec{fig:inliningexample1abstractinstance} +Figure \ref{fig:inliningexample1abstractinstance} that the debugging information entry for -INNER (labelled INNER.AI.1.1) is nested in (is a child of) -that for OUTER (labelled OUTER.AI.1.1). Nonetheless, the -abstract instance tree for INNER is considered to be separate -and distinct from that for OUTER. +\texttt{INNER} (labelled \texttt{INNER.AI.1.1}) is nested in (is a child of) +that for \texttt{OUTER} (labelled \texttt{OUTER.AI.1.1}). Nonetheless, the +abstract instance tree for \texttt{INNER} is considered to be separate +and distinct from that for \texttt{OUTER}. -The call of OUTER shown in +The call of \texttt{OUTER} shown in Figure \refersec{fig:inliningexamplespseudosourcefragment} might be described as shown in @@ -1585,7 +1587,7 @@ INNER.CI.1.2: \livelink{chap:DWATabstractorigin}{DW\_AT\_abstract\_origin}(reference to INNER.AI.1.2) \livelink{chap:DWATlocation}{DW\_AT\_location}(...) INNER.CI.1.3: - \livelink{chap:DWTAGvariable}{DW\_TAG\_variable} + \livelink{chap:DWTAGvariable}{DW\_TAG\_variable} ! No name \livelink{chap:DWATabstractorigin}{DW\_AT\_abstract\_origin}(reference to INNER.AI.1.3) \livelink{chap:DWATlocation}{DW\_AT\_location}(...) @@ -1605,52 +1607,54 @@ INNER.CI.1.3: \label{app:inlineoutermultiipleinners} -In the second alternative we assume that subprogram INNER -is not inlinable for some reason, but subprogram OUTER is +In the second alternative we assume that subprogram \texttt{INNER} +is not inlinable for some reason, but subprogram \texttt{OUTER} is inlinable. \addtoindexx{concrete instance!example} -Each concrete inlined instance of OUTER has its -own normal instance of INNER -The abstract instance for OUTER, +Each concrete inlined instance of \texttt{OUTER} has its +own normal instance of \texttt{INNER} +The abstract instance for \texttt{OUTER}, \addtoindexx{abstract instance!example} -which includes INNER, is shown in +which includes \texttt{INNER}, is shown in Figure \refersec{fig:inliningexample2abstractinstance}. -Note that the debugging information in this Figure differs from -that in +Note that the debugging information in +Figure \ref{fig:inliningexample2abstractinstance} +differs from that in Figure \refersec{fig:inliningexample1abstractinstance} -in that INNER lacks a +in that \texttt{INNER} lacks a \livelink{chap:DWATinline}{DW\_AT\_inline} attribute -and therefore is not a distinct abstract instance. INNER -is merely an out\dash of\dash line routine that is part of OUTER\textquoteright s +and therefore is not a distinct abstract instance. \texttt{INNER} +is merely an out\dash of\dash line routine that is part of \texttt{OUTER}\textquoteright s abstract instance. This is reflected in the Figure by \addtoindexx{abstract instance!example} -the fact that the labels for INNER use the substring OUTER -instead of INNER. +the fact that the labels for \texttt{INNER} use the substring \texttt{OUTER} +instead of \texttt{INNER}. A resulting \addtoindexx{concrete instance!example} -concrete inlined instance of OUTER is shown in +concrete inlined instance of \texttt{OUTER} is shown in Figure \refersec{fig:inliningexample2concreteinstance}. Notice in -Figure \refersec{fig:inliningexample2concreteinstance}. -that OUTER is expanded as a concrete +Figure \ref{fig:inliningexample2concreteinstance} +that \texttt{OUTER} is expanded as a concrete \addtoindexx{concrete instance!example} -inlined instance, and that INNER is nested within it as a -concrete out\dash of\dash line subprogram. Because INNER is cloned -for each inline expansion of OUTER, only the invariant -attributes of INNER +inlined instance, and that \texttt{INNER} is nested within it as a +concrete out\dash of\dash line subprogram. Because \texttt{INNER} is cloned +for each inline expansion of \texttt{OUTER}, only the invariant +attributes of \texttt{INNER} (for example, \livelink{chap:DWATname}{DW\_AT\_name}) are specified -in the abstract instance of OUTER, and the low\dash level, +in the abstract instance of \texttt{OUTER}, and the low\dash level, \addtoindexx{abstract instance!example} -instance\dash specific attributes of INNER (for example, +instance\dash specific attributes of \texttt{INNER} (for example, \livelink{chap:DWATlowpc}{DW\_AT\_low\_pc}) are specified in -each concrete instance of OUTER. +each concrete instance of \texttt{OUTER}. \addtoindexx{concrete instance!example} -The several calls of INNER within OUTER are compiled as normal -calls to the instance of INNER that is specific to the same -instance of OUTER that contains the calls. + +The several calls of \texttt{INNER} within \texttt{OUTER} are compiled as normal +calls to the instance of \texttt{INNER} that is specific to the same +instance of \texttt{OUTER} that contains the calls. \begin{figure}[t] \begin{dwflisting} @@ -1756,19 +1760,19 @@ OUTER.CI.2.6: \subsection{Alternative \#3: inline OUTER, one normal INNER} \label{app:inlineouteronenormalinner} -In the third approach, one normal subprogram for INNER is +In the third approach, one normal subprogram for \texttt{INNER} is compiled which is called from all concrete inlined instances of \addtoindexx{concrete instance!example} \addtoindexx{abstract instance!example} -OUTER. The abstract instance for OUTER is shown in +\texttt{OUTER}. The abstract instance for \texttt{OUTER} is shown in Figure \refersec{fig:inliningexample3abstractinstance}. The most distinctive aspect of that Figure is that subprogram -INNER exists only within the abstract instance of OUTER, -and not in OUTER\textquoteright s concrete instance. In the abstract +\texttt{INNER} exists only within the abstract instance of \texttt{OUTER}, +and not in \texttt{OUTER}\textquoteright s concrete instance. In the abstract \addtoindexx{concrete instance!example} \addtoindexx{abstract instance!example} -instance of OUTER, the description of INNER has the full +instance of \texttt{OUTER}, the description of \texttt{INNER} has the full complement of attributes that would be expected for a normal subprogram. While attributes such as @@ -1784,47 +1788,47 @@ an abstract instance because they are not invariant across instances of the containing abstract instance, in this case those same attributes are included precisely because they are -invariant -- there is only one subprogram INNER to be described +invariant -- there is only one subprogram \texttt{INNER} to be described and every description is the same. -A concrete inlined instance of OUTER is illustrated in +A concrete inlined instance of \texttt{OUTER} is illustrated in Figure \refersec{fig:inliningexample3concreteinstance}. Notice in -Figure \refersec{fig:inliningexample3abstractinstance} +Figure \ref{fig:inliningexample3concreteinstance} that there is no DWARF representation for -INNER at all; the representation of INNER does not vary across -instances of OUTER and the abstract instance of OUTER includes -the complete description of INNER, so that the description of -INNER may be (and for reasons of space efficiency, should be) +\texttt{INNER} at all; the representation of \texttt{INNER} does not vary across +instances of \texttt{OUTER} and the abstract instance of \texttt{OUTER} includes +the complete description of \texttt{INNER}, so that the description of +\texttt{INNER} may be (and for reasons of space efficiency, should be) omitted from each \addtoindexx{concrete instance!example} -concrete instance of OUTER. +concrete instance of \texttt{OUTER}. There is one aspect of this approach that is problematical from -the DWARF perspective. The single compiled instance of INNER -is assumed to access up\dash level variables of OUTER; however, +the DWARF perspective. The single compiled instance of \texttt{INNER} +is assumed to access up\dash level variables of \texttt{OUTER}; however, those variables may well occur at varying positions within the frames that contain the \addtoindexx{concrete instance!example} concrete inlined instances. A compiler might implement this in several ways, including the -use of additional compiler generated parameters that provide -reference parameters for the up\dash level variables, or a compiler -generated static link like parameter that points to the group +use of additional compiler-generated parameters that provide +reference parameters for the up\dash level variables, or a +compiler-generated static link like parameter that points to the group of up\dash level entities, among other possibilities. In either of these cases, the DWARF description for the location attribute of each uplevel variable needs to be different if accessed -from within INNER compared to when accessed from within the -instances of OUTER. An implementation is likely to require +from within \texttt{INNER} compared to when accessed from within the +instances of \texttt{OUTER}. An implementation is likely to require vendor\dash specific DWARF attributes and/or debugging information entries to describe such cases. Note that in C++, a member function of a class defined within a function definition does not require any vendor\dash specific extensions because the C++ language disallows access to -entities that would give rise to this problem. (Neither extern -variables nor static members require any form of static link +entities that would give rise to this problem. (Neither \texttt{extern} +variables nor \texttt{static} members require any form of static link for accessing purposes.) \begin{figure}[t] @@ -1948,26 +1952,26 @@ float arr[square(9)]; // square() called and inlined \livelink{chap:DWATname}{DW\_AT\_name}("square") \livelink{chap:DWATtype}{DW\_AT\_type}(reference to "int") \livelink{chap:DWATinline}{DW\_AT\_inline}(\livelink{chap:DWINLinlined}{DW\_INL\_inlined}) -11\:    \livelink{chap:DWTAGformalparameter}{DW\_TAG\_formal\_parameter}
+11\$: \livelink{chap:DWTAGformalparameter}{DW\_TAG\_formal\_parameter} + \livelink{chap:DWATname}{DW\_AT\_name}("x") + \livelink{chap:DWATtype}{DW\_AT\_type}(reference to "int") ! Concrete instance for square(9) ! \addtoindexx{concrete instance!example} 20\$:    \livelink{chap:DWTAGinlinedsubroutine}{DW\_TAG\_inlined\_subroutine}
\livelink{chap:DWATabstractorigin}{DW\_AT\_abstract\_origin}(reference to 10\$) \livelink{chap:DWATconstexpr}{DW\_AT\_const\_expr}(present) \livelink{chap:DWATconstvalue}{DW\_AT\_const\_value}(81) - \livelink{chap:DWTAGformalparameter}{DW\_TAG\_formal\_parameter} - \livelink{chap:DWATabstractorigin}{DW\_AT\_abstract\_origin}(reference to 11\$)
+                \livelink{chap:DWATabstractorigin}{DW\_AT\_abstract\_origin}(reference to 11\$) + \livelink{chap:DWATconstvalue}{DW\_AT\_const\_value}(9) ! Anonymous array type for arr ! 30\$:    \livelink{chap:DWTAGarraytype}{DW\_TAG\_array\_type}
-            \livelink{chap:DWATupperbound}{DW\_AT\_upper\_bound}(reference to 20\$) + \livelink{chap:DWTAGsubrangetype}{DW\_TAG\_subrange\_type} + \livelink{chap:DWATtype}{DW\_AT\_type}(reference to "int") + \livelink{chap:DWATupperbound}{DW\_AT\_upper\_bound}(reference to 20\$)
! Variable arr
!
40\$: \livelink{chap:DWTAGvariable}{DW\_TAG\_variable} @@ -2034,6 +2038,8 @@ Figure \refersec{fig:ctypesafeenumerationexamplesource} can be described in DWARF as illustrated in Figure \refersec{fig:ctypesafeenumerationexampledwarf}. +\clearpage % Get following source and DWARF on same page + \begin{figure}[H] \begin{lstlisting}[numbers=none] // C++ source @@ -2050,20 +2056,19 @@ E e1; \begin{alltt} ! DWARF description ! -11\$: \livelink{chap:DWTAGenumerationtype}{DW\_TAG\_enumeration\_type}
-12\$: \livelink{chap:DWTAGenumerator}{DW\_TAG\_enumerator} - \livelink{chap:DWATname}{DW\_AT\_name}("E1") - \livelink{chap:DWATconstvalue}{DW\_AT\_const\_value}(0) -13\$:
-14\$: \livelink{chap:DWTAGvariable}{DW\_TAG\_variable} - \livelink{chap:DWATname}{DW\_AT\_name}("e1") - \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 11\$)
+11\$: \livelink{chap:DWTAGenumerationtype}{DW\_TAG\_enumeration\_type} + \livelink{chap:DWATname}{DW\_AT\_name}("E") + \livelink{chap:DWATtype}{DW\_AT\_type}(reference to "int") + \livelink{chap:DWATenumclass}{DW\_AT\_enum\_class}(present) +12\$:      \livelink{chap:DWTAGenumerator}{DW\_TAG\_enumerator}
+13\$: \livelink{chap:DWTAGenumerator}{DW\_TAG\_enumerator} + \livelink{chap:DWATname}{DW\_AT\_name}("E2") + \livelink{chap:DWATconstvalue}{DW\_AT\_const\_value}(100) +14\$:  \livelink{chap:DWTAGvariable}{DW\_TAG\_variable}
+         \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 11\$) \end{alltt} \end{dwflisting} \caption{Type-safe enumeration example: DWARF description} @@ -2101,12 +2106,12 @@ wrapper<int> obj; ! 11\$: \livelink{chap:DWTAGstructuretype}{DW\_TAG\_structure\_type}
-12\$: \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter} - \livelink{chap:DWATname}{DW\_AT\_name}("T") - \livelink{chap:DWATtype}{DW\_AT\_type}(reference to "int") -13\$ \livelink{chap:DWTAGmember}{DW\_TAG\_member}
-        \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 12\$) +12\$:    \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter}
+13\$: \livelink{chap:DWTAGmember}{DW\_TAG\_member} + \livelink{chap:DWATname}{DW\_AT\_name}("comp") + \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 12\$)
14\$: \livelink{chap:DWTAGvariable}{DW\_TAG\_variable} \livelink{chap:DWATname}{DW\_AT\_name}("obj") \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 11\$)
@@ -2116,16 +2121,17 @@ wrapper<int> obj;
\label{fig:ctemplateexample1dwarf}
\end{figure}

-The actual type of the component comp is int, but in the DWARF
+The actual type of the component \texttt{comp} is \texttt{int}, but in the DWARF
the type references the
-for T, which in turn references int. This implies that in the
-original template comp was of type T and that was replaced
-with int in the instance. There exist situations where it is
-not possible for the DWARF to imply anything about the nature
-of the original template.
+for \texttt{T}, which in turn references \texttt{int}. This implies that in the
+original template comp was of type \texttt{T} and that was replaced
+with \texttt{int} in the instance.

\needlines{10}
+There exist situations where it is
+not possible for the DWARF to imply anything about the nature
+of the original template.
Consider the C++ template source in
Figure \refersec{fig:ctemplateexample2source}
and the DWARF that can describe it in
@@ -2156,25 +2162,25 @@ Figure \refersec{fig:ctemplateexample2dwarf}.
\begin{alltt}
! DWARF description
!
-11\$: \livelink{chap:DWTAGstructuretype}{DW\_TAG\_structure\_type} - \livelink{chap:DWATname}{DW\_AT\_name}("wrapper") -12\$:   \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter}
-13\$\livelink{chap:DWTAGmember}{DW\_TAG\_member} - \livelink{chap:DWATname}{DW\_AT\_name}("comp") - \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 12\$)
-14\$: \livelink{chap:DWTAGvariable}{DW\_TAG\_variable} - \livelink{chap:DWATname}{DW\_AT\_name}("obj") - \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 11\$)
-21\$: \livelink{chap:DWTAGsubprogram}{DW\_TAG\_subprogram} - \livelink{chap:DWATname}{DW\_AT\_name}("consume") -22\$:   \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter}
-23\$: \livelink{chap:DWTAGformalparameter}{DW\_TAG\_formal\_parameter} - \livelink{chap:DWATname}{DW\_AT\_name}("formal") - \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 11\$)
+11\$: \livelink{chap:DWTAGstructuretype}{DW\_TAG\_structure\_type} + \livelink{chap:DWATname}{DW\_AT\_name}("wrapper") +12\$:      \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter}
+13\$: \livelink{chap:DWTAGmember}{DW\_TAG\_member} + \livelink{chap:DWATname}{DW\_AT\_name}("comp") + \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 12\$)
+14\$: \livelink{chap:DWTAGvariable}{DW\_TAG\_variable} + \livelink{chap:DWATname}{DW\_AT\_name}("obj") + \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 11\$)
+21\$: \livelink{chap:DWTAGsubprogram}{DW\_TAG\_subprogram} + \livelink{chap:DWATname}{DW\_AT\_name}("consume") +22\$:      \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter}
+23\$: \livelink{chap:DWTAGformalparameter}{DW\_TAG\_formal\_parameter} + \livelink{chap:DWATname}{DW\_AT\_name}("formal") + \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 11\$)
\end{alltt}
\end{dwflisting}
\caption{C++ template example \#2: DWARF description}
@@ -2182,7 +2188,7 @@ Figure \refersec{fig:ctemplateexample2dwarf}.
\end{figure}

-entry for the instance of consume, U is described as int
+entry for the instance of consume, \texttt{U} is described as \texttt{int}
The type of formal is \texttt{wrapper\textless U\textgreater} in
the source. DWARF only represents instantiations of templates;
there is no entry which represents \texttt{wrapper\textless U\textgreater}
@@ -2194,12 +2200,12 @@ in the \livelink{chap:DWATtype}{DW\_AT\_type} attribute at
23\$. There is no description of the relationship between template type parameter -T at 12\$ and U at 22\$which was used to instantiate +\texttt{T} at 12\$ and \texttt{U} at 22\$which was used to instantiate \texttt{wrapper\textless U\textgreater}. A consequence of this is that the DWARF information would not distinguish between the existing example and one where -the formal of consume were declared in the source to be +the formal parameter of \texttt{consume} were declared in the source to be \texttt{wrapper\textless int\textgreater}. @@ -2234,29 +2240,29 @@ Beta<long> b; \begin{alltt} ! DWARF representation for variable 'b' ! -20\$: \livelink{chap:DWTAGstructuretype}{DW\_TAG\_structure\_type}
-21\$: \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter} - \livelink{chap:DWATname}{DW\_AT\_name}("T") - \livelink{chap:DWATtype}{DW\_AT\_type}(reference to "long") -22\$:   \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter}
-23\$: \livelink{chap:DWTAGmember}{DW\_TAG\_member} - \livelink{chap:DWATname}{DW\_AT\_name}("tango") - \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 21\$)
-24\$: \livelink{chap:DWTAGmember}{DW\_TAG\_member} - \livelink{chap:DWATname}{DW\_AT\_name}("uniform") - \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 22\$)
-25\$: \livelink{chap:DWTAGtemplatealias}{DW\_TAG\_template\_alias} - \livelink{chap:DWATname}{DW\_AT\_name}("Beta") - \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 20\$)
-26\$: \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter} - \livelink{chap:DWATname}{DW\_AT\_name}("V") - \livelink{chap:DWATtype}{DW\_AT\_type}(reference to "long") -27\$: \livelink{chap:DWTAGvariable}{DW\_TAG\_variable}
-        \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 25\$) +20\$:  \livelink{chap:DWTAGstructuretype}{DW\_TAG\_structure\_type}
+21\$: \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter} + \livelink{chap:DWATname}{DW\_AT\_name}("T") + \livelink{chap:DWATtype}{DW\_AT\_type}(reference to "long") +22\$:      \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter}
+23\$: \livelink{chap:DWTAGmember}{DW\_TAG\_member} + \livelink{chap:DWATname}{DW\_AT\_name}("tango") + \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 21\$)
+24\$: \livelink{chap:DWTAGmember}{DW\_TAG\_member} + \livelink{chap:DWATname}{DW\_AT\_name}("uniform") + \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 22\$)
+25\$: \livelink{chap:DWTAGtemplatealias}{DW\_TAG\_template\_alias} + \livelink{chap:DWATname}{DW\_AT\_name}("Beta") + \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 20\$)
+26\$: \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter} + \livelink{chap:DWATname}{DW\_AT\_name}("V") + \livelink{chap:DWATtype}{DW\_AT\_type}(reference to "long") +27\$:  \livelink{chap:DWTAGvariable}{DW\_TAG\_variable}
+          \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 25\$) \end{alltt} \end{dwflisting} \caption{C++ template alias example \#1: DWARF description} @@ -2289,39 +2295,39 @@ X<Z<int>> z; \begin{alltt} ! DWARF representation for X<Y<int>> ! -30\$: \livelink{chap:DWTAGstructuretype}{DW\_TAG\_structure\_type}
-31\$: \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter} - \livelink{chap:DWATname}{DW\_AT\_name}("TY") - \livelink{chap:DWATtype}{DW\_AT\_type}(reference to "int") -32\$: \livelink{chap:DWTAGstructuretype}{DW\_TAG\_structure\_type}
-33\$: \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter} - \livelink{chap:DWATname}{DW\_AT\_name}("TX") - \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 30\$)
-
+30\$: \livelink{chap:DWTAGstructuretype}{DW\_TAG\_structure\_type} + \livelink{chap:DWATname}{DW\_AT\_name}("Y") +31\$:      \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter}
+32\$: \livelink{chap:DWTAGstructuretype}{DW\_TAG\_structure\_type} + \livelink{chap:DWATname}{DW\_AT\_name}("X") +33\$:      \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter}
+              \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 30\$) +! ! DWARF representation for X<Z<int>> ! -40\$: \livelink{chap:DWTAGtemplatealias}{DW\_TAG\_template\_alias}
-using Z = Y<int>;
-        \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 30\$) -41\$:   \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter}
-42\$: \livelink{chap:DWTAGstructuretype}{DW\_TAG\_structure\_type} - \livelink{chap:DWATname}{DW\_AT\_name}("X") -43\$:   \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter}
-            \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 40\$) +40\$:  \livelink{chap:DWTAGtemplatealias}{DW\_TAG\_template\_alias}
+          \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 30\$) +41\$:      \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter}
+42\$: \livelink{chap:DWTAGstructuretype}{DW\_TAG\_structure\_type} + \livelink{chap:DWATname}{DW\_AT\_name}("X") +43\$:      \livelink{chap:DWTAGtemplatetypeparameter}{DW\_TAG\_template\_type\_parameter}
+              \livelink{chap:DWATtype}{DW\_AT\_type}(reference to 40\$) +! ! Note that 32\$ and 42\$are actually the same type ! -50\$: \livelink{chap:DWTAGvariable}{DW\_TAG\_variable}
-        \livelink{chap:DWATtype}{DW\_AT\_type}(reference to \$32) -51\$: \livelink{chap:DWTAGvariable}{DW\_TAG\_variable}
-        \livelink{chap:DWATtype}{DW\_AT\_type}(reference to \$42) +50\$:  \livelink{chap:DWTAGvariable}{DW\_TAG\_variable}
+          \livelink{chap:DWATtype}{DW\_AT\_type}(reference to \$32) +51\$:  \livelink{chap:DWTAGvariable}{DW\_TAG\_variable}
+          \livelink{chap:DWATtype}{DW\_AT\_type}(reference to \42) \end{alltt} \end{dwflisting} \caption{C++ template alias example \#2: DWARF description} index f2cc8cd..2d74561 100644 (file) @@ -599,7 +599,7 @@ value is truncated to the element size and the low\dash order bits are pushed on the stack. \begin{enumerate}[1. ] \itembfnl{\livetarg{chap:DWOPlit0}{DW\_OP\_lit0}, \livetarg{chap:DWOPlit1}{DW\_OP\_lit1}, \dots, \livetarg{chap:DWOPlit31}{DW\_OP\_lit31}} -The \livetarg{chap:DWOPlit}{DW\_OP\_lit}n operations encode the unsigned literal values +The \livetarg{chap:DWOPlit}{DW\_OP\_lit}\textit{n} operations encode the unsigned literal values from 0 through 31, inclusive. \itembfnl{\livetarg{chap:DWOPaddr}{DW\_OP\_addr}} @@ -611,16 +611,16 @@ on the target machine. The single operand of a \livetarg{chap:DWOPconstnu}{DW\_OP\_constnu} operation provides a 1, 2, 4, or 8\dash byte unsigned integer constant, respectively. -\itembfnl{\livetarg{chap:DWOPconst1s}{DW\_OP\_const1s} , \livetarg{chap:DWOPconst2s}{DW\_OP\_const2s}, \livetarg{chap:DWOPconst4s}{DW\_OP\_const4s}, \livetarg{chap:DWOPconst8s}{DW\_OP\_const8s}} +\itembfnl{\livetarg{chap:DWOPconst1s}{DW\_OP\_const1s}, \livetarg{chap:DWOPconst2s}{DW\_OP\_const2s}, \livetarg{chap:DWOPconst4s}{DW\_OP\_const4s}, \livetarg{chap:DWOPconst8s}{DW\_OP\_const8s}} The single operand of a \livetarg{chap:DWOPconstns}{DW\_OP\_constns} operation provides a 1, 2, 4, or 8\dash byte signed integer constant, respectively. \itembfnl{\livetarg{chap:DWOPconstu}{DW\_OP\_constu}} -The single operand of the \livelink{chap:DWOPconstu}{DW\_OP\_constu} operation provides +The single operand of the \livetarg{chap:DWOPconstu}{DW\_OP\_constu} operation provides an unsigned LEB128 integer constant. \itembfnl{\livetarg{chap:DWOPconsts}{DW\_OP\_consts}} -The single operand of the \livelink{chap:DWOPconsts}{DW\_OP\_consts} operation provides +The single operand of the \livetarg{chap:DWOPconsts}{DW\_OP\_consts} operation provides a signed LEB128 integer constant. \end{enumerate} @@ -634,7 +634,7 @@ the result of adding the contents of a register to a given signed offset. \begin{enumerate}[1. ] \itembfnl{\livetarg{chap:DWOPfbreg}{DW\_OP\_fbreg}} -The \livelink{chap:DWOPfbreg}{DW\_OP\_fbreg} operation provides a signed LEB128 offset +The \livetarg{chap:DWOPfbreg}{DW\_OP\_fbreg} operation provides a signed LEB128 offset from the address specified by the location description in the \livelink{chap:DWATframebase}{DW\_AT\_frame\_base} attribute of the current function. (This is typically a \doublequote{stack pointer} register plus or minus @@ -649,7 +649,7 @@ a signed LEB128 offset from the specified register. \itembfnl{\livetarg{chap:DWOPbregx}{DW\_OP\_bregx} } -The \livelink{chap:DWOPbregx}{DW\_OP\_bregx} operation has two operands: a register +The \livetarg{chap:DWOPbregx}{DW\_OP\_bregx} operation has two operands: a register which is specified by an unsigned LEB128 number, followed by a signed LEB128 offset. @@ -665,36 +665,36 @@ that index the stack assume that the top of the stack (most recently added entry) has index 0. \begin{enumerate}[1. ] \itembfnl{\livetarg{chap:DWOPdup}{DW\_OP\_dup}} -The \livelink{chap:DWOPdup}{DW\_OP\_dup} operation duplicates the value at the top of the stack. +The \livetarg{chap:DWOPdup}{DW\_OP\_dup} operation duplicates the value at the top of the stack. \itembfnl{\livetarg{chap:DWOPdrop}{DW\_OP\_drop}} -The \livelink{chap:DWOPdrop}{DW\_OP\_drop} operation pops the value at the top of the stack. +The \livetarg{chap:DWOPdrop}{DW\_OP\_drop} operation pops the value at the top of the stack. \itembfnl{\livetarg{chap:DWOPpick}{DW\_OP\_pick}} -The single operand of the \livelink{chap:DWOPpick}{DW\_OP\_pick} operation provides a +The single operand of the \livetarg{chap:DWOPpick}{DW\_OP\_pick} operation provides a 1\dash byte index. A copy of the stack entry with the specified index (0 through 255, inclusive) is pushed onto the stack. \itembfnl{\livetarg{chap:DWOPover}{DW\_OP\_over}} -The \livelink{chap:DWOPover}{DW\_OP\_over} operation duplicates the entry currently second +The \livetarg{chap:DWOPover}{DW\_OP\_over} operation duplicates the entry currently second in the stack at the top of the stack. This is equivalent to a \livelink{chap:DWOPpick}{DW\_OP\_pick} operation, with index 1. \itembfnl{\livetarg{chap:DWOPswap}{DW\_OP\_swap}} -The \livelink{chap:DWOPswap}{DW\_OP\_swap} operation swaps the top two stack entries. +The \livetarg{chap:DWOPswap}{DW\_OP\_swap} operation swaps the top two stack entries. The entry at the top of the stack becomes the second stack entry, and the second entry becomes the top of the stack. \itembfnl{\livetarg{chap:DWOProt}{DW\_OP\_rot}} -The \livelink{chap:DWOProt}{DW\_OP\_rot} operation rotates the first three stack +The \livetarg{chap:DWOProt}{DW\_OP\_rot} operation rotates the first three stack entries. The entry at the top of the stack becomes the third stack entry, the second entry becomes the top of the stack, and the third entry becomes the second entry. \itembfnl{\livetarg{chap:DWOPderef}{DW\_OP\_deref}} -The \livelink{chap:DWOPderef}{DW\_OP\_deref} +The \livetarg{chap:DWOPderef}{DW\_OP\_deref} operation pops the top stack entry and treats it as an address. The value retrieved from that address is pushed. @@ -703,10 +703,11 @@ The size of the data retrieved from the address is the \addtoindex{size of an address} on the target machine. \itembfnl{\livetarg{chap:DWOPderefsize}{DW\_OP\_deref\_size}} -The \livelink{chap:DWOPderefsize}{DW\_OP\_deref\_size} operation behaves like the \livelink{chap:DWOPderef}{DW\_OP\_deref} +The \livetarg{chap:DWOPderefsize}{DW\_OP\_deref\_size} operation behaves like the +\livelink{chap:DWOPderef}{DW\_OP\_deref} operation: it pops the top stack entry and treats it as an address. The value retrieved from that address is pushed. In -the \livelink{chap:DWOPderefsize}{DW\_OP\_deref\_size} operation, however, the size in bytes +the \addtoindex{DW\_OP\_deref\_size} operation, however, the size in bytes of the data retrieved from the dereferenced address is specified by the single operand. This operand is a 1\dash byte unsigned integral constant whose value may not be larger @@ -715,7 +716,7 @@ retrieved is zero extended to the size of an address on the target machine before being pushed onto the expression stack. \itembfnl{\livetarg{chap:DWOPxderef}{DW\_OP\_xderef}} -The \livelink{chap:DWOPxderef}{DW\_OP\_xderef} operation provides an extended dereference +The \livetarg{chap:DWOPxderef}{DW\_OP\_xderef} operation provides an extended dereference mechanism. The entry at the top of the stack is treated as an address. The second stack entry is treated as an \doublequote{address space identifier} for those architectures that support @@ -729,8 +730,8 @@ address is the \addtoindex{size of an address} on the target machine. \itembfnl{\livetarg{chap:DWOPxderefsize}{DW\_OP\_xderef\_size}} -The \livelink{chap:DWOPxderefsize}{DW\_OP\_xderef\_size} operation behaves like the -\livelink{chap:DWOPxderef}{DW\_OP\_xderef} operation.The entry at the top of the stack is +The \livetarg{chap:DWOPxderefsize}{DW\_OP\_xderef\_size} operation behaves like the +\livelink{chap:DWOPxderef}{DW\_OP\_xderef} operation. The entry at the top of the stack is treated as an address. The second stack entry is treated as an \doublequote{address space identifier} for those architectures that support @@ -738,7 +739,7 @@ that support address spaces. The top two stack elements are popped, and a data item is retrieved through an implementation\dash defined address calculation and pushed as the -new stack top. In the \livelink{chap:DWOPxderefsize}{DW\_OP\_xderef\_size} operation, however, +new stack top. In the \addtoindex{DW\_OP\_xderef\_size} operation, however, the size in bytes of the data retrieved from the \addtoindexi{dereferenced}{address!dereference operator} address is specified by the single operand. This operand is a @@ -748,7 +749,7 @@ retrieved is zero extended to the \addtoindex{size of an address} on the target machine before being pushed onto the expression stack. \itembfnl{\livetarg{chap:DWOPpushobjectaddress}{DW\_OP\_push\_object\_address}} -The \livelink{chap:DWOPpushobjectaddress}{DW\_OP\_push\_object\_address} +The \livetarg{chap:DWOPpushobjectaddress}{DW\_OP\_push\_object\_address} operation pushes the address of the object currently being evaluated as part of evaluation of a user presented expression. This object may correspond @@ -762,19 +763,20 @@ evaluation. (especially for arrays involving descriptors) that is analogous to the implicit push of the base \addtoindexi{address}{address!implicit push of base} -of a structure prior -to evaluation of a \livelink{chap:DWATdatamemberlocation}{DW\_AT\_data\_member\_location} to access a -data member of a structure. For an example, see +of a structure prior to evaluation of a +\livelink{chap:DWATdatamemberlocation}{DW\_AT\_data\_member\_location} +to access a data member of a structure. For an example, see Appendix \refersec{app:aggregateexamples}.} \needlines{4} \itembfnl{\livetarg{chap:DWOPformtlsaddress}{DW\_OP\_form\_tls\_address}} -The \livelink{chap:DWOPformtlsaddress}{DW\_OP\_form\_tls\_address} operation pops a value from the +The \livetarg{chap:DWOPformtlsaddress}{DW\_OP\_form\_tls\_address} +operation pops a value from the stack, translates it into an address in the current thread's \addtoindexx{thread-local storage} thread\dash local storage \nolink{block}, and pushes the address. If the DWARF expression containing -the \livelink{chap:DWOPformtlsaddress}{DW\_OP\_form\_tls\_address} +the \addtoindex{DW\_OP\_form\_tls\_address} operation belongs to the main executable's DWARF info, the operation uses the main executable's thread\dash local storage \nolink{block}; if the expression belongs to a shared library's @@ -794,15 +796,16 @@ declared in each shared library. Computing the address of the appropriate \nolink{block} can be complex (in some cases, the compiler emits a function call to do it), and difficult to describe using ordinary DWARF location descriptions. -\livelink{chap:DWOPformtlsaddress}{DW\_OP\_form\_tls\_address} leaves the computation to the +\addtoindex{DW\_OP\_form\_tls\_address} leaves the computation to the consumer.} \itembfnl{\livetarg{chap:DWOPcallframecfa}{DW\_OP\_call\_frame\_cfa}} -The \livelink{chap:DWOPcallframecfa}{DW\_OP\_call\_frame\_cfa} operation pushes the value of the +The \livetarg{chap:DWOPcallframecfa}{DW\_OP\_call\_frame\_cfa} +operation pushes the value of the CFA, obtained from the Call Frame Information (see Section \refersec{chap:callframeinformation}). -\textit{Although the value of \livelink{chap:DWATframebase}{DW\_AT\_frame\_base} +\textit{Although the value of \addtoindex{DW\_AT\_frame\_base} can be computed using other DWARF expression operators, in some cases this would require an extensive location list because the values of the registers used in computing the @@ -827,49 +830,49 @@ bits). Such operations do not cause an exception on overflow. \begin{enumerate}[1. ] \itembfnl{\livetarg{chap:DWOPabs}{DW\_OP\_abs}} -The \livelink{chap:DWOPabs}{DW\_OP\_abs} operation pops the top stack entry, interprets +The \livetarg{chap:DWOPabs}{DW\_OP\_abs} operation pops the top stack entry, interprets it as a signed value and pushes its absolute value. If the absolute value cannot be represented, the result is undefined. \itembfnl{\livetarg{chap:DWOPand}{DW\_OP\_and}} -The \livelink{chap:DWOPand}{DW\_OP\_and} operation pops the top two stack values, performs +The \livetarg{chap:DWOPand}{DW\_OP\_and} operation pops the top two stack values, performs a bitwise and operation on the two, and pushes the result. \itembfnl{\livetarg{chap:DWOPdiv}{DW\_OP\_div}} -The \livelink{chap:DWOPdiv}{DW\_OP\_div} operation pops the top two stack values, divides the former second entry by +The \livetarg{chap:DWOPdiv}{DW\_OP\_div} operation pops the top two stack values, divides the former second entry by the former top of the stack using signed division, and pushes the result. \itembfnl{\livetarg{chap:DWOPminus}{DW\_OP\_minus}} -The \livelink{chap:DWOPminus}{DW\_OP\_minus} operation pops the top two stack values, subtracts the former top of the +The \livetarg{chap:DWOPminus}{DW\_OP\_minus} operation pops the top two stack values, subtracts the former top of the stack from the former second entry, and pushes the result. \itembfnl{\livetarg{chap:DWOPmod}{DW\_OP\_mod}} -The \livelink{chap:DWOPmod}{DW\_OP\_mod} operation pops the top two stack values and pushes the result of the +The \livetarg{chap:DWOPmod}{DW\_OP\_mod} operation pops the top two stack values and pushes the result of the calculation: former second stack entry modulo the former top of the stack. \itembfnl{\livetarg{chap:DWOPmul}{DW\_OP\_mul}} -The \livelink{chap:DWOPmul}{DW\_OP\_mul} operation pops the top two stack entries, multiplies them together, and +The \livetarg{chap:DWOPmul}{DW\_OP\_mul} operation pops the top two stack entries, multiplies them together, and pushes the result. \itembfnl{\livetarg{chap:DWOPneg}{DW\_OP\_neg}} -The \livelink{chap:DWOPneg}{DW\_OP\_neg} operation pops the top stack entry, interprets +The \livetarg{chap:DWOPneg}{DW\_OP\_neg} operation pops the top stack entry, interprets it as a signed value and pushes its negation. If the negation cannot be represented, the result is undefined. \itembfnl{\livetarg{chap:DWOPnot}{DW\_OP\_not}} -The \livelink{chap:DWOPnot}{DW\_OP\_not} operation pops the top stack entry, and pushes +The \livetarg{chap:DWOPnot}{DW\_OP\_not} operation pops the top stack entry, and pushes its bitwise complement. \itembfnl{\livetarg{chap:DWOPor}{DW\_OP\_or}} -The \livelink{chap:DWOPor}{DW\_OP\_or} operation pops the top two stack entries, performs +The \livetarg{chap:DWOPor}{DW\_OP\_or} operation pops the top two stack entries, performs a bitwise or operation on the two, and pushes the result. \itembfnl{\livetarg{chap:DWOPplus}{DW\_OP\_plus}} -The \livelink{chap:DWOPplus}{DW\_OP\_plus} operation pops the top two stack entries, +The \livetarg{chap:DWOPplus}{DW\_OP\_plus} operation pops the top two stack entries, adds them together, and pushes the result. \itembfnl{\livetarg{chap:DWOPplusuconst}{DW\_OP\_plus\_uconst}} -The \livelink{chap:DWOPplusuconst}{DW\_OP\_plus\_uconst} operation pops the top stack entry, +The \livetarg{chap:DWOPplusuconst}{DW\_OP\_plus\_uconst} operation pops the top stack entry, adds it to the unsigned LEB128 constant operand and pushes the result. @@ -880,27 +883,27 @@ done with \needlines{3} \itembfnl{\livetarg{chap:DWOPshl}{DW\_OP\_shl}} -The \livelink{chap:DWOPshl}{DW\_OP\_shl} operation pops the top two stack entries, +The \livetarg{chap:DWOPshl}{DW\_OP\_shl} operation pops the top two stack entries, shifts the former second entry left (filling with zero bits) by the number of bits specified by the former top of the stack, and pushes the result. \itembfnl{\livetarg{chap:DWOPshr}{DW\_OP\_shr}} -The \livelink{chap:DWOPshr}{DW\_OP\_shr} operation pops the top two stack entries, +The \livetarg{chap:DWOPshr}{DW\_OP\_shr} operation pops the top two stack entries, shifts the former second entry right logically (filling with 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, +The \livetarg{chap:DWOPshra}{DW\_OP\_shra} operation pops the top two stack entries, shifts the former second entry right arithmetically (divide the magnitude by 2, keep the same sign for the result) by the number of bits specified by the former top of the stack, and pushes the result. \itembfnl{\livetarg{chap:DWOPxor}{DW\_OP\_xor}} -The \livelink{chap:DWOPxor}{DW\_OP\_xor} operation pops the top two stack entries, +The \livetarg{chap:DWOPxor}{DW\_OP\_xor} operation pops the top two stack entries, performs a bitwise exclusive\dash or operation on the two, and pushes the result. @@ -927,20 +930,20 @@ constant value 0 if the result of the operation is false. \end{itemize} Comparisons are performed as signed operations. The six -operators are \livelink{chap:DWOPle}{DW\_OP\_le} (less than or equal to), \livelink{chap:DWOPge}{DW\_OP\_ge} -(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). +operators are \addtoindex{DW\_OP\_le} (less than or equal to), \addtoindex{DW\_OP\_ge} +(greater than or equal to), \addtoindex{DW\_OP\_eq} (equal to), \addtoindex{DW\_OP\_lt} (less +than), \addtoindex{DW\_OP\_gt} (greater than) and \addtoindex{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 +\livetarg{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 the number of bytes of the DWARF expression to skip forward or backward from the current operation, beginning after the 2\dash byte constant. \itembfnl{\livetarg{chap:DWOPbra}{DW\_OP\_bra}} -\livelink{chap:DWOPbra}{DW\_OP\_bra} is a conditional branch. Its single operand is a +\livetarg{chap:DWOPbra}{DW\_OP\_bra} is a conditional branch. Its single operand is a 2\dash byte signed integer constant. This operation pops the top of stack. If the value popped is not the constant 0, the 2\dash byte constant operand is the number of bytes of the @@ -951,33 +954,31 @@ operation, beginning after the 2\dash byte constant. % to an overfull hbox and a visible artifact. % So we use \- to suggest hyphenation in this rare situation. \itembfnl{\livetarg{chap:DWOPcall2}{DW\_OP\_call2}, \livetarg{chap:DWOPcall4}{DW\_OP\_call4}, \livetarg{chap:DWOPcallref}{DW\_OP\_call\_ref}} -\livelink{chap:DWOPcall2}{DW\_OP\_call2}, -\livelink{chap:DWOPcall4}{DW\_OP\_call4}, -and \livelink{chap:DWOPcallref}{DW\_OP\_call\_ref} perform +\addtoindex{DW\_OP\_call2}, +\addtoindex{DW\_OP\_call4}, +and \addtoindex{DW\_OP\_call\_ref} perform subroutine calls during evaluation of a DWARF expression or location description. -For \livelink{chap:DWOPcall2}{DW\_OP\_call2} and -\livelink{chap:DWOPcall4}{DW\_OP\_call4}, -the -operand is the 2\dash~ or 4\dash byte -unsigned offset, respectively, +For \addtoindex{DW\_OP\_call2} and \addtoindex{DW\_OP\_call4}, +the operand is the 2\dash~ or 4\dash byte unsigned offset, respectively, of a debugging information entry in the current compilation -unit. The \livelink{chap:DWOPcallref}{DW\_OP\_call\_ref} operator has a single operand. In the -32\dash bit DWARF format, the operand is a 4\dash byte unsigned value; -in the 64\dash bit DWARF format, it is an 8\dash byte unsigned value +unit. The \addtoindex{DW\_OP\_call\_ref} operator has a single operand. In the +\thirtytwobitdwarfformat, +the operand is a 4\dash byte unsigned value; +in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value (see Section \refersec{datarep:32bitand64bitdwarfformats}). The operand is used as the offset of a debugging information entry in a -\addtoindex{.debug\_info} +\dotdebuginfo{} or -\addtoindex{.debug\_types} +\dotdebugtypes{} section which may be contained in a shared object or executable other than that containing the operator. For references from one shared object or executable to another, the relocation must be performed by the consumer. \textit{Operand interpretation of -\livelink{chap:DWOPcall2}{DW\_OP\_call2}, \livelink{chap:DWOPcall4}{DW\_OP\_call4} and \livelink{chap:DWOPcallref}{DW\_OP\_call\_ref} is exactly like +\addtoindex{DW\_OP\_call2}, \addtoindex{DW\_OP\_call4} and \addtoindex{DW\_OP\_call\_ref} is exactly like that for \livelink{chap:DWFORMref2}{DW\_FORM\_ref2}, \livelink{chap:DWFORMref4}{DW\_FORM\_ref4} and \livelink{chap:DWFORMrefaddr}{DW\_FORM\_ref\_addr}, respectively (see Section \refersec{datarep:attributeencodings}). @@ -1009,7 +1010,7 @@ There is one special operation currently defined: \begin{enumerate}[1. ] \itembfnl{\livetarg{chap:DWOPnop}{DW\_OP\_nop}} -The \livelink{chap:DWOPnop}{DW\_OP\_nop} operation is a place holder. It has no effect +The \livetarg{chap:DWOPnop}{DW\_OP\_nop} operation is a place holder. It has no effect on the location stack or any of its values. \end{enumerate} @@ -1207,7 +1208,7 @@ registers, numbered from 0 through 31, inclusive. The object 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 +The \livetarg{chap:DWOPregx}{DW\_OP\_regx} operation has a single unsigned LEB128 literal operand that encodes the name of a register. \end{enumerate} @@ -1234,7 +1235,8 @@ that has no location in the program but is a known constant or is computed from other locations and values in the program. \begin{enumerate}[1. ] \itembfnl{\livetarg{chap:DWOPimplicitvalue}{DW\_OP\_implicit\_value}} -The \livelink{chap:DWOPimplicitvalue}{DW\_OP\_implicit\_value} operation specifies an immediate value +The \livetarg{chap:DWOPimplicitvalue}{DW\_OP\_implicit\_value} +operation specifies an immediate value using two operands: an unsigned LEB128 length, followed by %FIXME: should this block be a reference? To what? a \nolink{block} representing the value in the memory representation @@ -1242,12 +1244,13 @@ of the target machine. The length operand gives the length in bytes of the \nolink{block}. \itembfnl{\livetarg{chap:DWOPstackvalue}{DW\_OP\_stack\_value}} -The \livelink{chap:DWOPstackvalue}{DW\_OP\_stack\_value} operation specifies that the object +The \livetarg{chap:DWOPstackvalue}{DW\_OP\_stack\_value} +operation specifies that the object does not exist in memory but its value is nonetheless known and is at the top of the DWARF expression stack. In this form of location description, the DWARF expression represents the actual value of the object, rather than its location. The -\livelink{chap:DWOPstackvalue}{DW\_OP\_stack\_value} operation terminates the expression. +\addtoindex{DW\_OP\_stack\_value} operation terminates the expression. \end{enumerate} @@ -1275,7 +1278,7 @@ location description which describes the location where part of the resultant value is contained. \begin{enumerate}[1. ] \itembfnl{\livetarg{chap:DWOPpiece}{DW\_OP\_piece}} -The \livelink{chap:DWOPpiece}{DW\_OP\_piece} operation takes a +The \livetarg{chap:DWOPpiece}{DW\_OP\_piece} operation takes a single operand, which is an unsigned LEB128 number. The number describes the size in bytes of the piece of the object referenced by the preceding simple @@ -1285,12 +1288,13 @@ the piece within that register is defined by the ABI. \textit{Many compilers store a single variable in sets of registers, or store a variable partially in memory and partially in -registers. \livelink{chap:DWOPpiece}{DW\_OP\_piece} provides a way of describing how large +registers. \addtoindex{DW\_OP\_piece} provides a way of describing how large a part of a variable a particular DWARF location description refers to. } \itembfnl{\livetarg{chap:DWOPbitpiece}{DW\_OP\_bit\_piece}} -The \livelink{chap:DWOPbitpiece}{DW\_OP\_bit\_piece} operation takes two operands. The first +The \livetarg{chap:DWOPbitpiece}{DW\_OP\_bit\_piece} +operation takes two operands. The first is an unsigned LEB128 number that gives the size in bits of the piece. The second is an unsigned LEB128 number that gives the offset in bits from the location defined by the @@ -1299,22 +1303,22 @@ preceding DWARF location description. Interpretation of the offset depends on the kind of location description. If the location description is empty, the offset doesn\textquoteright t matter and -the \livelink{chap:DWOPbitpiece}{DW\_OP\_bit\_piece} operation describes a piece consisting +the \addtoindex{DW\_OP\_bit\_piece} operation describes a piece consisting of the given number of bits whose values are undefined. If the location is a register, the offset is from the least significant bit end of the register. If the location is a -memory address, the \livelink{chap:DWOPbitpiece}{DW\_OP\_bit\_piece} operation describes a +memory address, the \addtoindex{DW\_OP\_bit\_piece} operation describes a sequence of bits relative to the location whose address is on the top of the DWARF stack using the bit numbering and direction conventions that are appropriate to the current language on the target system. If the location is any implicit -value or stack value, the \livelink{chap:DWOPbitpiece}{DW\_OP\_bit\_piece} operation describes +value or stack value, the \addtoindex{DW\_OP\_bit\_piece} operation describes a sequence of bits using the least significant bits of that value. \end{enumerate} -\textit{\livelink{chap:DWOPbitpiece}{DW\_OP\_bit\_piece} is -used instead of \livelink{chap:DWOPpiece}{DW\_OP\_piece} when +\textit{\addtoindex{DW\_OP\_bit\_piece} is +used instead of \addtoindex{DW\_OP\_piece} when the piece to be assembled into a value or assigned to is not byte-sized or is not at the start of a register or addressable unit of memory.} @@ -1371,6 +1375,7 @@ 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 } +\vspace{-\parsep} \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 @@ -1389,9 +1394,9 @@ can change location during its lifetime. Location lists \addtoindexx{location list} are contained in a separate object file section called -\addtoindex{.debug\_loc}. A location list is indicated by a location +\dotdebugloc{}. A location list is indicated by a location attribute whose value is an offset from the beginning of -the \addtoindex{.debug\_loc} section to the first byte of the list for the +the \dotdebugloc{} section to the first byte of the list for the object in question. Each entry in a location list is either a location @@ -1997,12 +2002,12 @@ may have a value of class Range lists are contained in a separate object file section called -\addtoindex{.debug\_ranges}. A +\dotdebugranges{}. A \addtoindex{range list} is indicated by a \livelink{chap:DWATranges}{DW\_AT\_ranges} attribute whose \addtoindexx{ranges attribute} value is represented as an offset from the beginning of the -\addtoindex{.debug\_ranges} section to the beginning of the +\dotdebugranges{} section to the beginning of the \addtoindex{range list}. Each entry in a \addtoindex{range list} is either a index e0dea09..0d5ca4e 100644 (file) @@ -277,7 +277,7 @@ Version 2 DWARF information is not binary compatible with Version 1 information. To make it easier for consumers to support both Version 1 and Version 2 DWARF information, the Version 2 information has been moved to a different object -file section, \addtoindex{.debug\_info}. +file section, \dotdebuginfo{}. \textit{ A summary of the major changes made in index a115230..d68db43 100644 (file) @@ -3,18 +3,19 @@ % references to chapter 7 look like {datarep:...} This section describes debugging information that is not represented in the form of debugging information entries and -is not contained within a \addtoindex{.debug\_info} or -\addtoindex{.debug\_types} section. +is not contained within a \dotdebuginfo{} or +\dotdebugtypes{} section. In the descriptions that follow, these terms are used to specify the representation of DWARF sections: - +\begin{itemize} +\item Initial length, section offset and \addtoindex{section length}, which are defined in Sections \refersec{datarep:locationdescriptions} and \refersec{datarep:32bitand64bitdwarfformats}. - +\item Sbyte, \addtoindex{ubyte}, \addtoindex{uhalf}, and @@ -23,6 +24,7 @@ which \addtoindexx{sbyte} are defined in Section \refersec{datarep:integerrepresentationnames}. +\end{itemize} \section{Accelerated Access} \label{chap:acceleratedaccess} @@ -72,9 +74,9 @@ For lookup by name, two tables are maintained in separate \addtoindexx{accelerated access!by name} object file sections named -\addtoindex{.debug\_pubnames} for objects and +\dotdebugpubnames{} for objects and functions, and -\addtoindex{.debug\_pubtypes} +\dotdebugpubtypes{} for types. Each table consists of sets of variable length entries. Each set describes the names of global objects and functions, or global types, @@ -85,13 +87,13 @@ information entries owned by a single compilation unit. are definitions in every compilation unit containing the class declaration, but if there is no concrete out\dash of\dash line instance there is no need to have a -\addtoindex{.debug\_pubnames} entry +\dotdebugpubnames{} entry for the member function.} Each set begins with a header containing four values: \begin{enumerate}[1. ] -\item unit\_length (initial length) \\ +\item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\ \addtoindexx{unit\_length} The total length of the all of the entries for that set, not including the length field itself @@ -112,7 +114,7 @@ The offset \addtoindexx{section offset!in .debug\_pubtypes header} from the beginning of the -\addtoindex{.debug\_info} section of +\dotdebuginfo{} section of the compilation unit header referenced by the set. \item debug\_info\_length (section length) \\ @@ -120,7 +122,7 @@ the compilation unit header referenced by the set. The \addtoindexx{section length!in .debug\_pubtypes header} size in bytes of the contents of the -\addtoindex{.debug\_info} section +\dotdebuginfo{} section generated to represent that compilation unit. \end{enumerate} @@ -138,7 +140,7 @@ no following string). In the case of the name of a function member or static data member of a C++ structure, class or union, the name presented in the -\addtoindex{.debug\_pubnames +\dotdebugpubnames{ section is not the simple name given by the \livelink{chap:DWATname}{DW\_AT\_name} attribute of the referenced debugging information entry, but rather the fully qualified name of @@ -151,15 +153,15 @@ For lookup by address, a table is maintained in a separate \addtoindexx{accelerated access!by address} object file section called -\addtoindex{.debug\_aranges}. The table consists +\dotdebugaranges{}. The table consists of sets of variable length entries, each set describing the portion of the program\textquoteright s address space that is covered by a single compilation unit. Each set begins with a header containing five values: \begin{enumerate}[1. ] -\item unit\_length (initial length) \\ -\addtoindexx{unit\_length} +\item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\ +\addtoindexx{\texttt{unit\_length}} The total length of all of the entries for that set, not including the length field itself (see Section \refersec{datarep:initiallengthvalues}). @@ -173,8 +175,8 @@ independent of the DWARF version number. \item debug\_info\_offset (section offset) \\ The offset from the \addtoindexx{section offset!in .debug\_pubnames header} -beginning of the \addtoindex{.debug\_info} or -\addtoindex{.debug\_types} section of the +beginning of the \dotdebuginfo{} or +\dotdebugtypes{} section of the compilation unit header referenced by the set. \item address\_size (\addtoindex{ubyte}) \\ @@ -234,11 +236,11 @@ or statement to statement.} Line number information generated for a compilation unit is represented in the -\addtoindex{.debug\_line} section of an object file and +\dotdebugline{} section of an object file and is referenced by a corresponding compilation unit debugging information entry (see Section \refersec{chap:normalandpartialcompilationunitentries}) -in the \addtoindex{.debug\_info} +in the \dotdebuginfo{} section. \textit{Some computer architectures employ more than one instruction @@ -250,10 +252,10 @@ MIPS architectures support a 32\dash bit as well as a 16\dash bit instruction set). Because the instruction set is a function of the program counter, it is convenient to encode the applicable instruction set in the -\addtoindex{.debug\_line} section as well.} +\dotdebugline{} section as well.} \textit{If space were not a consideration, the information provided -in the \addtoindex{.debug\_line +in the \dotdebugline{ section could be represented as a large matrix, with one row for each instruction in the emitted object code. The matrix would have columns for:} @@ -335,63 +337,63 @@ registers: \endfoot \hline \endlastfoot -\addtoindexi{address}{address register!in line number machine}& +\addtoindexi{\texttt{address}}{address register!in line number machine}& The program\dash counter value corresponding to a machine instruction generated by the compiler. \\ -\addtoindex{op\_index} & +\addtoindex{\texttt{op\_index}} & An unsigned integer representing the index of an operation within a VLIW instruction. The index of the first operation is 0. For non\dash VLIW architectures, this register will always be 0. -The address and \addtoindex{op\_index} registers, +The \texttt{address} and \addtoindex{\texttt{op\_index}} registers, taken together, form an operation -pointer that can reference any individual operation with the instruction +pointer that can reference any individual operation within the instruction stream. \\ -\addtoindex{file} & +\addtoindex{\texttt{file}} & An unsigned integer indicating the identity of the source file corresponding to a machine instruction. \\ -\addtoindex{line} & +\addtoindex{\texttt{line}} & An unsigned integer indicating a source line number. Lines are numbered beginning at 1. The compiler may emit the value 0 in cases where an instruction cannot be attributed to any source line. \\ -\addtoindex{column} & +\addtoindex{\texttt{column}} & An unsigned integer indicating a column number within a source line. Columns are numbered beginning at 1. The value 0 is reserved to indicate that a statement begins at the left edge'' of the line. \\ -\addtoindex{is\_stmt} & +\addtoindex{\texttt{is\_stmt}} & A boolean indicating that the current instruction is a recommended breakpoint location. A recommended breakpoint location -is intended to represent'' a line, a +is intended to \doublequote{represent} a line, a statement and/or a semantically distinct subpart of a statement. \\ -\addtoindex{basic\_block} & +\addtoindex{\texttt{basic\_block}} & A boolean indicating that the current instruction is the beginning of a \addtoindex{basic block}. \\ -\addtoindex{end\_sequence} & +\addtoindex{\texttt{end\_sequence}} & A boolean indicating that the current address is that of the first byte after the end of a sequence of target machine instructions. -\addtoindex{end\_sequence} +\addtoindex{\texttt{end\_sequence}} terminates a sequence of lines; therefore other information in the same row is not meaningful. \\ -\addtoindex{prologue\_end} & +\addtoindex{\texttt{prologue\_end}} & A boolean indicating that the current address is one (of possibly many) where execution should be suspended for an entry breakpoint of a function. \\ -\addtoindex{epilogue\_begin} & +\addtoindex{\texttt{epilogue\_begin}} & A boolean indicating that the current address is one (of possibly many) where execution should be suspended for an exit breakpoint of a function. \\ -\addtoindex{isa} & +\addtoindex{\texttt{isa}} & An unsigned integer whose value encodes the applicable instruction set architecture for the current instruction. @@ -400,7 +402,7 @@ users of a given architecture. It is recommended that this encoding be defined by the ABI authoring committee for each architecture.} \\ -\addtoindex{discriminator} & +\addtoindex{\texttt{discriminator}} & An unsigned integer identifying the block to which the current instruction belongs. Discriminator values are assigned arbitrarily by the DWARF producer and serve to distinguish @@ -413,24 +415,26 @@ should be zero. \\ \clearpage % Keep this sentence with the following table At the beginning of each sequence within a line number program, the state of the registers is: - -\begin{tabular}{lp{9cm}} -address & 0 \\ -\addtoindex{op\_index} & 0 \\ -file & 1 \\ -line & 1 \\ -column & 0 \\ -\addtoindex{is\_stmt} & determined by \addtoindex{default\_is\_stmt} in the line number program header \\ -\addtoindex{basic\_block} & \doublequote{false} \addtoindexx{basic block} \\ -\addtoindex{end\_sequence} & \doublequote{false} \\ -\addtoindex{prologue\_end} & \doublequote{false} \\ -\addtoindex{epilogue\_begin} & \doublequote{false} \\ -\addtoindex{isa} & 0 \\ -discriminator & 0 \\ +\begin{center} +\begin{tabular}{lp{9.5cm}} +\texttt{address} & 0 \\ +\addtoindex{\texttt{op\_index}} & 0 \\ +\texttt{file} & 1 \\ +\texttt{line} & 1 \\ +\texttt{column} & 0 \\ +\addtoindex{\texttt{is\_stmt}} & determined by \addtoindex{\texttt{default\_is\_stmt}} + in the line number program header \\ +\addtoindex{\texttt{basic\_block}} & \doublequote{false} \addtoindexx{basic block} \\ +\addtoindex{\texttt{end\_sequence}} & \doublequote{false} \\ +\addtoindex{\texttt{prologue\_end}} & \doublequote{false} \\ +\addtoindex{\texttt{epilogue\_begin}} & \doublequote{false} \\ +\addtoindex{\texttt{isa}} & 0 \\ +\addtoindex{\texttt{discriminator}} & 0 \\ \end{tabular} +\end{center} \textit{The -\addtoindex{isa} value 0 specifies that the instruction set is the +\addtoindex{\texttt{isa}} value 0 specifies that the instruction set is the architecturally determined default instruction set. This may be fixed by the ABI, or it may be specified by other means, for example, by the object file description.} @@ -475,61 +479,62 @@ The line number program for each compilation unit begins with a header containing the following fields in order: \begin{enumerate}[1. ] -\item unit\_length (initial length) \\ -\addtoindexx{unit\_length} +\item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\ +\addtoindexx{\texttt{unit\_length}} The size in bytes of the line number information for this -compilation unit, not including the unit\_length field itself +compilation unit, not including the length field itself (see Section \refersec{datarep:initiallengthvalues}). -\item version (\addtoindex{uhalf}) \\ +\item \texttt{version} (\addtoindex{uhalf}) \\ A version number\addtoindexx{version number!line number information} (see Appendix \refersec{datarep:linenumberinformation}). This number is specific to the line number information and is independent of the DWARF version number. -\item header\_length \\ -The number of bytes following the \addtoindex{header\_length} field to the +\item \texttt{header\_length} \\ +The number of bytes following the \addtoindex{\texttt{header\_length}} field to the beginning of the first byte of the line number program itself. -In the 32\dash bit DWARF format, this is a 4\dash byte unsigned -length; in the 64\dash bit DWARF format, this field is an +In the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned +length; in the \sixtyfourbitdwarfformat, this field is an 8\dash byte unsigned length (see Section \refersec{datarep:32bitand64bitdwarfformats}). -\item minimum\_instruction\_length (\addtoindex{ubyte}) \\ -\addtoindexx{minimum\_instruction\_length} +\item \texttt{minimum\_instruction\_length} (\addtoindex{ubyte}) \\ +\addtoindexx{\texttt{minimum\_instruction\_length}} The size in bytes of the smallest target machine instruction. Line number program opcodes that alter -the address and \addtoindex{op\_index} registers use this and -\addtoindexx{maximum\_operations\_per\_instruction} -maximum\-\_operations\-\_per\-\_instruction in their calculations. +the \texttt{address} and \addtoindex{\texttt{op\_index}} +registers use this and +\addtoindex{\texttt{maximum\_operations\_per\_instruction}} +(see following) in their calculations. \needlines{9} -\item maximum\_operations\_per\_instruction (\addtoindex{ubyte}) \\ +\item \texttt{maximum\_operations\_per\_instruction} (\addtoindex{ubyte}) \\ The -\addtoindexx{maximum\_operations\_per\_instruction} +\addtoindexx{\texttt{maximum\_operations\_per\_instruction}} maximum number of individual operations that may be encoded in an instruction. Line number program opcodes -that alter the address and -\addtoindex{op\_index} registers use this and -\addtoindex{minimum\_instruction\_length} +that alter the \texttt{address} and +\addtoindex{\texttt{op\_index}} registers use this and +\addtoindex{\texttt{minimum\_instruction\_length}} (see preceeding) in their calculations. For non-VLIW -architectures, this field is 1, the \addtoindex{op\_index} register is always -0, and the operation pointer is simply the address register. +architectures, this field is 1, the \addtoindex{\texttt{op\_index}} register is always +0, and the operation pointer is simply the \texttt{address} register. \needlines{4} -\item default\_is\_stmt (\addtoindex{ubyte}) \\ -\addtoindexx{default\_is\_stmt} -The initial value of the \addtoindex{is\_stmt} register. +\item \texttt{default\_is\_stmt} (\addtoindex{ubyte}) \\ +\addtoindexx{\texttt{default\_is\_stmt}} +The initial value of the \addtoindex{\texttt{is\_stmt}} register. \textit{A simple approach to building line number information when machine instructions are emitted in an order corresponding to the source program -is to set \addtoindex{default\_is\_stmt +is to set \addtoindex{\texttt{default\_is\_stmt} to true'' and to not change the -value of the \addtoindex{is\_stmt} register +value of the \addtoindex{\texttt{is\_stmt}} register within the line number program. One matrix entry is produced for each line that has code generated for it. The effect is that every entry in the @@ -543,25 +548,25 @@ the matrix for a line number; in this case, at least one entry breakpoint location for the line number. \livelink{chap:DWLNSnegatestmt}{DW\_LNS\_negate\_stmt} opcodes in the line number program control which matrix entries constitute such a recommendation and -\addtoindex{default\_is\_stmt} might +\addtoindex{\texttt{default\_is\_stmt}} might be either true'' or false''. This approach might be used as part of support for debugging optimized code.} -\item line\_base (\addtoindex{sbyte}) \\ -\addtoindexx{line\_base} +\item \texttt{line\_base} (\addtoindex{sbyte}) \\ +\addtoindexx{\texttt{line\_base}} This parameter affects the meaning of the special opcodes. See below. -\item line\_range (\addtoindex{ubyte}) \\ -\addtoindexx{line\_range} +\item \texttt{line\_range} (\addtoindex{ubyte}) \\ +\addtoindexx{\texttt{line\_range}} This parameter affects the meaning of the special opcodes. See below. -\item opcode\_base (\addtoindex{ubyte}) \\ +\item \texttt{opcode\_base} (\addtoindex{ubyte}) \\ The -\addtoindexx{opcode\_base} +\addtoindexx{\texttt{opcode\_base}} number assigned to the first special opcode. \textit{Opcode base is typically one greater than the highest-numbered -\addtoindexx{opcode\_base} +\addtoindexx{\texttt{opcode\_base}} standard opcode defined for the specified version of the line number information (12 in \addtoindex{DWARF Version 3} and @@ -570,24 +575,24 @@ Version 4, 9 in \addtoindexx{DWARF Version 2} Version 2). If opcode\_base is less than the typical value, -\addtoindexx{opcode\_base} +\addtoindexx{\texttt{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 +(and the codes are treated as special opcodes). If \texttt{opcode\_base} is greater than the typical value, then the numbers between that of the highest standard opcode and the first special opcode (not inclusive) are used for vendor specific extensions.} -\item standard\_opcode\_lengths (array of \addtoindex{ubyte}) \\ -\addtoindexx{standard\_opcode\_lengths} +\item \texttt{standard\_opcode\_lengths} (array of \addtoindex{ubyte}) \\ +\addtoindexx{\texttt{standard\_opcode\_lengths}} This array specifies the number of \addtoindex{LEB128} operands for each of the standard opcodes. The first element of the array corresponds to the opcode whose value is 1, and the last element corresponds to the opcode whose value -is opcode\_base - 1. +is \texttt{opcode\_base - 1}. -\textit{By increasing opcode\_base, and adding elements to this array, -\addtoindexx{opcode\_base} +\textit{By increasing \texttt{opcode\_base}, and adding elements to this array, +\addtoindexx{\texttt{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.} @@ -595,9 +600,9 @@ do not know about these new opcodes to be able to skip them.} just like standard opcodes.} \needlines{3} -\item include\_directories (sequence of path names) \\ +\item \texttt{include\_directories} (sequence of path names) \\ Entries -\addtoindexx{include\_directories} +\addtoindexx{\texttt{include\_directories}} in this sequence describe each path that was searched for included source files in this compilation. (The paths include those directories specified explicitly by the user for @@ -612,11 +617,11 @@ entries in order, beginning with 1. The current directory of the compilation is understood to be the zeroth entry and is not explicitly represented. -\item file\_names (sequence of file entries) \\ +\item \texttt{file\_names} (sequence of file entries) \\ Entries \addtoindexx{file names} in -\addtoindexx{file\_names} +\addtoindexx{\texttt{file\_names}} this sequence describe source files that contribute to the line number information for this compilation unit or is used in other contexts, such as in a declaration coordinate or @@ -632,12 +637,12 @@ to either the compilation directory (as specified by the \livelink{chap:DWATcompdir}{DW\_AT\_comp\_dir} attribute given in the compilation unit) or one of the directories listed in the -\addtoindex{include\_directories} section. +\addtoindex{\texttt{include\_directories}} section. \item An unsigned LEB128\addtoindexx{LEB128!unsigned} number representing the directory index of a directory in the -\addtoindex{include\_directories} section. +\addtoindex{\texttt{include\_directories}} section. \item An unsigned LEB128\addtoindexx{LEB128!unsigned} @@ -654,11 +659,11 @@ bytes of the file, or 0 if not available. The last entry is followed by a single null byte. The directory index represents an entry in the -\addtoindex{include\_directories} section. +\addtoindex{\texttt{include\_directories}} section. The index is 0 if the file was found in the current directory of the compilation, 1 if it was found in the first directory in the -\addtoindex{include\_directories} +\addtoindex{\texttt{include\_directories}} section, and so on. The directory index is ignored for file names that represent full path names. @@ -695,24 +700,24 @@ Each \addtoindex{ubyte} special opcode has the following effect on the state mac \begin{enumerate}[1. ] -\item Add a signed integer to the line register. +\item Add a signed integer to the \texttt{line} register. \item Modify the \addtoindex{operation pointer} by incrementing the -address and \addtoindex{op\_index} registers as described below. +\texttt{address} and \addtoindex{\texttt{op\_index|}} registers as described below. \item Append a row to the matrix using the current values of the state machine registers. -\item Set the \addtoindex{basic\_block} register to false.'' \addtoindexx{basic block} -\item Set the \addtoindex{prologue\_end} register to false.'' -\item Set the \addtoindex{epilogue\_begin} register to false.'' -\item Set the \addtoindex{discriminator} register to 0. +\item Set the \addtoindex{\texttt{basic\_block}} register to \doublequote{false.} \addtoindexx{basic block} +\item Set the \addtoindex{\texttt{prologue\_end}} register to \doublequote{false.} +\item Set the \addtoindex{\texttt{epilogue\_begin}} register to \doublequote{false.} +\item Set the \addtoindex{\texttt{discriminator}} register to 0. \end{enumerate} All of the special opcodes do those same seven things; they differ from one another only in what values they add to the -line, address and \addtoindex{op\_index} registers. +\texttt{line}, \texttt{address} and \addtoindex{\texttt{op\_index}} registers. \textit{Instead of assigning a fixed meaning to each special opcode, @@ -721,38 +726,37 @@ to configure the instruction set. There are two reasons for this. First, although the opcode space available for special opcodes now ranges from 13 through 255, the lower bound may increase if one adds new standard opcodes. Thus, the -opcode\_base field of the line number program header gives the +\texttt{opcode\_base} field of the line number program header gives the value of the first special opcode. Second, the best choice of special\dash opcode meanings depends on the target architecture. For example, for a RISC machine where the compiler\dash generated code interleaves instructions from different lines to schedule the pipeline, it is important to be able to add a negative -value to the line register to express the fact that a later +value to the \texttt{line} register to express the fact that a later instruction may have been emitted for an earlier source line. For a machine where pipeline scheduling never occurs, it is advantageous to trade away the ability to decrease -the line register (a standard opcode provides an alternate +the \texttt{line} register (a standard opcode provides an alternate way to decrease the line number) in return for the ability -to add larger positive values to the address register. To +to add larger positive values to the \texttt{address} register. To permit this variety of strategies, the line number program header defines a -\addtoindex{line\_base} +\addtoindex{\texttt{line\_base}} field that specifies the minimum value which a special opcode can add to the line register and a -\addtoindex{line\_range} +\addtoindex{\texttt{line\_range}} field that defines the range of values it can add to the line register.} A special opcode value is chosen based on the amount that needs -to be added to the line, address and \addtoindex{op\_index} registers. -The -maximum line increment for a special opcode is the value +to be added to the \texttt{line}, \texttt{address} and \addtoindex{\texttt{op\_index}} registers. +The maximum line increment for a special opcode is the value of the -\addtoindex{line\_base} +\addtoindex{\texttt{line\_base}} field in the header, plus the value of the -\addtoindex{line\_range} field, minus 1 (line base + +\addtoindex{\texttt{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 @@ -768,17 +772,17 @@ The special opcode is then calculated using the following formula: If the resulting opcode is greater than 255, a standard opcode must be used instead. -\textit{When \addtoindex{maximum\_operations\_per\_instruction} is 1, the operation -advance is simply the address increment divided by the -\addtoindex{minimum\_instruction\_length}.} +\textit{When \addtoindex{\texttt{maximum\_operations\_per\_instruction}} is 1, +the operation advance is simply the address increment divided by the +\addtoindex{\texttt{minimum\_instruction\_length}}.} \needlines{6} -To decode a special opcode, subtract the opcode\_base from +To decode a special opcode, subtract the \addtoindex{\texttt{opcode\_base}} from the opcode itself to give the \textit{adjusted opcode}. The \textit{operation advance} is the result of the adjusted opcode divided by the -line\_range. The new address and \addtoindex{op\_index} values -are given by +\texttt{line\_range}. The new \texttt{address} and +\addtoindex{\texttt{op\_index}} values are given by \begin{alltt} \textit{adjusted opcode} = opcode \dash opcode\_base \textit{operation advance} = \textit{adjusted opcode} / line\_range @@ -791,16 +795,16 @@ are given by (\addtoindex{op\_index} + \addtoindex{operation advance}) \% \addtoindex{maximum\_operations\_per\_instruction} \end{alltt} -\textit{When the \addtoindex{maximum\_operations\_per\_instruction} field is 1, -op\_index is always 0 and these calculations simplify to those +\textit{When the \addtoindex{\texttt{maximum\_operations\_per\_instruction}} field is 1, +\texttt{op\_index} is always 0 and these calculations simplify to those given for addresses in \addtoindex{DWARF Version 3}.} The amount to increment the line register is the -\addtoindex{line\_base} plus +\addtoindex{\texttt{line\_base}} plus the result of the -\addtoindex{adjusted opcode} modulo the -\addtoindex{line\_range}. That +\textit{\addtoindex{adjusted opcode}} modulo the +\addtoindex{\texttt{line\_range}}. That is, \begin{alltt} @@ -808,11 +812,11 @@ is, \end{alltt} \textit{As an example, suppose that the opcode\_base is 13, -\addtoindex{line\_base} -is -3, \addtoindex{line\_range} is 12, -\addtoindex{minimum\_instruction\_length} is 1 +\addtoindex{\texttt{line\_base}} is -3, +\addtoindex{\texttt{line\_range}} is 12, +\addtoindex{\texttt{minimum\_instruction\_length}} is 1 and -\addtoindex{maximum\_operations\_per\_instruction} is 1. +\addtoindex{\texttt{maximum\_operations\_per\_instruction}} is 1. This means that we can use a special opcode whenever two successive rows in the matrix have source line numbers differing by any value @@ -857,8 +861,8 @@ Figure \refersec{fig:examplelinenumberspecialopcodemapping}.} \end{figure} \textit{There is no requirement that the expression -255 - \addtoindex{line\_base} + 1 be an integral multiple of -\addtoindex{line\_range}. } +255 - \addtoindex{\texttt{line\_base}} + 1 be an integral multiple of +\addtoindex{\texttt{line\_range}}. } \subsubsection{Standard Opcodes} \label{chap:standardopcodes} @@ -873,41 +877,42 @@ actions performed by these opcodes are as follows: The \livetarg{chap:DWLNScopy}{DW\_LNS\_copy} opcode takes no operands. It appends a row to the matrix using the current values of the state machine -registers. Then it sets the \addtoindex{discriminator} register to 0, -and sets the \addtoindex{basic\_block}, -\addtoindex{prologue\_end} and -\addtoindex{epilogue\_begin} +registers. Then it sets the \addtoindex{\texttt{discriminator}} register to 0, +and sets the \addtoindex{\texttt{basic\_block}}, +\addtoindex{\texttt{prologue\_end}} and +\addtoindex{\texttt{epilogue\_begin}} registers to false.'' \item \textbf{DW\_LNS\_advance\_pc} \\ The \livetarg{chap:DWLNSadvancepc}{DW\_LNS\_advance\_pc} opcode takes a single unsigned LEB128\addtoindexx{LEB128!unsigned} -operand as the \addtoindex{operation advance} and modifies the address -and \addtoindex{op\_index} registers as specified in +operand as the \addtoindex{operation advance} and modifies the \texttt{address} +and \addtoindex{\texttt{op\_index}} registers as specified in Section \refersec{chap:specialopcodes}. \item \textbf{DW\_LNS\_advance\_line} \\ The \livetarg{chap:DWLNSadvanceline}{DW\_LNS\_advance\_line} opcode takes a single signed LEB128\addtoindexx{LEB128!signed} -operand and adds that value to the line register of the +operand and adds that value to the \texttt{line} register of the state machine. \needlines{4} \item \textbf{DW\_LNS\_set\_file} \\ The \livetarg{chap:DWLNSsetfile}{DW\_LNS\_set\_file} opcode takes a single unsigned LEB128\addtoindexx{LEB128!unsigned} -operand and stores it in the file register +operand and stores it in the \texttt{file} register of the state machine. \item \textbf{DW\_LNS\_set\_column} \\ The \livetarg{chap:DWLNSsetcolumn}{DW\_LNS\_set\_column} opcode takes a -single unsigned LEB128\addtoindexx{LEB128!unsigned} operand and stores it in the column +single unsigned LEB128\addtoindexx{LEB128!unsigned} operand +and stores it in the \texttt{column} register of the state machine. \needlines{4} \item \textbf{DW\_LNS\_negate\_stmt} \\ The \livetarg{chap:DWLNSnegatestmt}{DW\_LNS\_negate\_stmt} opcode takes no -operands. It sets the \addtoindex{is\_stmt} register of the state machine +operands. It sets the \addtoindex{\texttt{is\_stmt}} register of the state machine to the logical negation of its current value. \needlines{4} @@ -916,20 +921,20 @@ The \livetarg{chap:DWLNSsetbasicblock}{DW\_LNS\_set\_basic\_block} opcode \addtoindexx{basic block} takes no operands. -It sets the basic\_block register of the +It sets the \texttt{basic\_block} register of the state machine to true.'' \item \textbf{DW\_LNS\_const\_add\_pc} \\ The \livetarg{chap:DWLNSconstaddpc}{DW\_LNS\_const\_add\_pc} opcode takes -no operands. It advances the address and op\_index registers +no operands. It advances the \texttt{address} and \texttt{op\_index} registers by the increments corresponding to special opcode 255. -\textit{When the line number program needs to advance the address +\textit{When the line number program needs to advance the \texttt{address} by a small amount, it can use a single special opcode, which occupies a single byte. When it needs to advance the -address by up to twice the range of the last special opcode, +\texttt{address} by up to twice the range of the last special opcode, it can use \livelink{chap:DWLNSconstaddpc}{DW\_LNS\_const\_add\_pc} followed by a special opcode, for a total of two bytes. Only if it needs to advance the address by more than twice that range will it need to use @@ -939,11 +944,12 @@ or more bytes.} \item \textbf{DW\_LNS\_fixed\_advance\_pc} \\ The \livetarg{chap:DWLNSfixedadvancepc}{DW\_LNS\_fixed\_advance\_pc} opcode takes a single \addtoindex{uhalf} (unencoded) operand and adds it to the -address register of the state machine and sets the op\_index +\texttt{address} register of the state machine and sets the \texttt{op\_index} register to 0. This is the only standard opcode whose operand is \textbf{not} a variable length number. It also does \textbf{not} multiply the -operand by the \addtoindex{minimum\_instruction\_length} field of the header. +operand by the \addtoindex{\texttt{minimum\_instruction\_length}} +field of the header. \textit{Existing assemblers cannot emit \livelink{chap:DWLNSadvancepc}{DW\_LNS\_advance\_pc} or special @@ -956,8 +962,8 @@ use \livelink{chap:DWLNSfixedadvancepc}{DW\_LNS\_fixed\_advance\_pc} instead, sa \item \textbf{DW\_LNS\_set\_prologue\_end} \\ The \livetarg{chap:DWLNSsetprologueend}{DW\_LNS\_set\_prologue\_end} opcode takes no operands. It sets the -\addtoindex{prologue\_end} register -to true''. +\addtoindex{\texttt{prologue\_end}} register +to \doublequote{true}. \textit{When a breakpoint is set on entry to a function, it is generally desirable for execution to be suspended, not on the @@ -983,7 +989,7 @@ subroutines).} \item \textbf{DW\_LNS\_set\_epilogue\_begin} \\ The \livetarg{chap:DWLNSsetepiloguebegin}{DW\_LNS\_set\_epilogue\_begin} opcode takes no operands. It -sets the \addtoindex{epilogue\_begin} register to true''. +sets the \addtoindex{\texttt{epilogue\_begin}} register to \doublequote{true}. \textit{When a breakpoint is set on the exit of a function or execution steps over the last executable statement of a function, it is @@ -1007,7 +1013,7 @@ subroutines).} \item \textbf{DW\_LNS\_set\_isa} \\ The \livetarg{chap:DWLNSsetisa}{DW\_LNS\_set\_isa} opcode takes a single unsigned LEB128\addtoindexx{LEB128!unsigned} operand and stores that value in the -\addtoindex{isa} +\addtoindex{\texttt{isa}} register of the state machine. \end{enumerate} @@ -1021,7 +1027,7 @@ The extended opcodes are as follows: \item \textbf{DW\_LNE\_end\_sequence} \\ The \livetarg{chap:DWLNEendsequence}{DW\_LNE\_end\_sequence} opcode takes no operands. It sets the -\addtoindex{end\_sequence} +\addtoindex{\texttt{end\_sequence}} register of the state machine to \doublequote{true} and appends a row to the matrix using the current values of the state-machine registers. Then it resets the registers to the @@ -1036,12 +1042,12 @@ byte after the last target machine instruction of the sequence. \item \textbf{DW\_LNE\_set\_address} \\ The \livetarg{chap:DWLNEsetaddress}{DW\_LNE\_set\_address} opcode takes a single relocatable address as an operand. The size of the operand is the size -of an address on the target machine. It sets the address +of an address on the target machine. It sets the \texttt{address} register to the value given by the relocatable address and -sets the op\_index register to 0. +sets the \texttt{op\_index} register to 0. \textit{All of the other line number program opcodes that -affect the address register add a delta to it. This instruction +affect the \texttt{address} register add a delta to it. This instruction stores a relocatable value into it instead.} \needlines{4} @@ -1056,7 +1062,7 @@ name or a relative path name, the file is located relative to either the compilation directory (as specified by the \livelink{chap:DWATcompdir}{DW\_AT\_comp\_dir} attribute given in the compilation unit) or one of the directories in the -\addtoindex{include\_directories} section. +\addtoindex{\texttt{include\_directories}} section. \item An unsigned LEB128\addtoindexx{LEB128!unsigned} number representing the directory index @@ -1072,10 +1078,10 @@ not available. \end{enumerate} The directory index represents an entry in the -\addtoindex{include\_directories} section of the line number program +\addtoindex{\texttt{include\_directories}} section of the line number program header. The index is 0 if the file was found in the current directory of the compilation, 1 if it was found in the first -directory in the \addtoindex{include\_directories} section, +directory in the \addtoindex{\texttt{include\_directories}} section, and so on. The directory index is ignored for file names that represent full path names. @@ -1093,7 +1099,7 @@ The \livetarg{chap:DWLNEsetdiscriminator}{DW\_LNE\_set\_discriminator} opcode takes a single parameter, an unsigned LEB128\addtoindexx{LEB128!unsigned} integer. It sets the -\addtoindex{discriminator} register to the new value. +\addtoindex{\texttt{discriminator}} register to the new value. \end{enumerate} @@ -1120,7 +1126,7 @@ As described in Section \refersec{chap:normalandpartialcompilationunitentries}, the macro information for a given compilation unit is represented in the -\addtoindex{.debug\_macinfo} +\dotdebugmacinfo{} section of an object file. The macro information for each compilation unit is represented as a series of \doublequote{macinfo} entries. Each macinfo entry consists of a \doublequote{type code} and @@ -1251,7 +1257,7 @@ and should encode the value 0 in their line number operands. \subsection{General rules and restrictions} \label{chap:generalrulesandrestrictions} -All macinfo entries within a \addtoindex{.debug\_macinfo} +All macinfo entries within a \dotdebugmacinfo{} section for a given compilation unit appear in the same order in which the directives were processed by the compiler. @@ -1462,8 +1468,8 @@ the program.} The virtual unwind information is encoded in a self-contained section called -\addtoindex{.debug\_frame}. Entries in a -\addtoindex{.debug\_frame} section +\dotdebugframe{}. Entries in a +\dotdebugframe{} section are aligned on a multiple of the address size relative to the start of the section and come in two forms: a Common \addtoindexx{common information entry} @@ -1478,28 +1484,28 @@ to the parts of that function.} A Common Information Entry holds information that is shared among many Frame Description Entries. There is at least one -CIE in every non-empty \addtoindex{.debug\_frame} section. A CIE contains +CIE in every non-empty \dotdebugframe{} section. A CIE contains the following fields, in order: \begin{enumerate}[1. ] -\item length (initial length) \\ +\item \texttt{length} (\livelink{datarep:initiallengthvalues}{initial length}) \\ A constant that gives the number of bytes of the CIE structure, not including the length field itself (see Section \refersec{datarep:initiallengthvalues}). The -size of the length field plus the value of length must be an +size of the \texttt{length} field plus the value of \texttt{length} must be an integral multiple of the address size. -\item CIE\_id (4 or 8 bytes, see Section \refersec{datarep:32bitand64bitdwarfformats}) \\ +\item \texttt{CIE\_id} (4 or 8 bytes, see Section \refersec{datarep:32bitand64bitdwarfformats}) \\ A constant that is used to distinguish CIEs from FDEs. -\item version (\addtoindex{ubyte}) \\ +\item \texttt{version} (\addtoindex{ubyte}) \\ A version number\addtoindexx{version number!call frame information} (see Section \refersec{datarep:callframeinformation}). 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) \\ +\item \texttt{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 an augmentation string that is unexpected, then only the @@ -1508,9 +1514,9 @@ following fields can be read: \begin{itemize} -\item CIE: length, CIE\_id, version, augmentation +\item CIE: \texttt{length, CIE\_id, version, augmentation} -\item FDE: length, CIE\_pointer, initial\_location, address\_range +\item FDE: \texttt{length, CIE\_pointer, initial\_location, address\_range} \end{itemize} If there is no augmentation, this value is a zero byte. @@ -1522,48 +1528,48 @@ which is needed to unwind a stack frame. For example, this might be information about dynamically allocated data which needs to be freed on exit from the routine.} -\textit{Because the \addtoindex{.debug\_frame} section is useful independently of -any \addtoindex{.debug\_info} section, the augmentation string always uses +\textit{Because the \dotdebugframe{} section is useful independently of +any \dotdebuginfo{} section, the augmentation string always uses UTF\dash 8 encoding.} -\item address\_size (\addtoindex{ubyte}) \\ +\item \texttt{address\_size} (\addtoindex{ubyte}) \\ The size of a target address -\addtoindexx{address\_size} +\addtoindexx{\texttt{address\_size}} in this CIE and any FDEs that use it, in bytes. If a compilation unit exists for this frame, its address size must match the address size here. -\item segment\_size (\addtoindex{ubyte}) \\ -The \addtoindexx{segment\_size} +\item \texttt{segment\_size} (\addtoindex{ubyte}) \\ +The \addtoindexx{\texttt{segment\_size}} size of a segment selector in this CIE and any FDEs that use it, in bytes. -\item \addtoindex{code\_alignment\_factor} (unsigned LEB128) +\item \addtoindex{\texttt{code\_alignment\_factor}} (unsigned LEB128) \addtoindexx{LEB128!unsigned}\addtoindexx{unsigned LEB128|see{LEB128, unsigned}} -\addtoindexx{code alignment factor} \\ +\addtoindexx{\texttt{code alignment factor}} \\ A -\addtoindexx{\textless caf\textgreater|see{code alignment factor}} +\addtoindexx{\texttt{\textless caf\textgreater}|see{code alignment factor}} constant that is factored out of all advance location instructions (see Section \refersec{chap:rowcreationinstructions}). -\item \addtoindex{data\_alignment\_factor} (signed LEB128) +\item \addtoindex{\texttt{data\_alignment\_factor}} (signed LEB128) \addtoindexx{LEB128!signed}\addtoindexx{signed LEB128|see{LEB128, signed}} \\ \addtoindexx{data alignment factor} A -\addtoindexx{\textless daf\textgreater|see{data alignment factor}} +\addtoindexx{\texttt{\textless daf\textgreater}|see{data alignment factor}} constant that is factored out of certain offset instructions -(see below). The resulting value is \textit{(operand * -data\_alignment\_factor)}. +(see below). The resulting value is \textit{(operand} * +\texttt{data\_alignment\_factor}). -\item return\_address\_register (unsigned LEB128)\addtoindexx{LEB128!unsigned} \\ +\item \texttt{return\_address\_register} (unsigned LEB128)\addtoindexx{LEB128!unsigned} \\ An unsigned LEB128 constant that indicates which column in the rule table represents the return address of the function. Note that this column might not correspond to an actual machine register. -\item initial\_instructions (array of \addtoindex{ubyte}) \\ +\item \texttt{initial\_instructions} (array of \addtoindex{ubyte}) \\ A sequence of rules that are interpreted to create the initial setting of each column in the table. @@ -1573,7 +1579,7 @@ is the undefined rule. However, an ABI authoring body or a compilation system authoring body may specify an alternate default value for any or all columns. -\item padding (array of \addtoindex{ubyte}) \\ +\item \texttt{padding} (array of \addtoindex{ubyte}) \\ Enough \livelink{chap:DWCFAnop}{DW\_CFA\_nop} instructions to make the size of this entry match the length value above. \end{enumerate} @@ -1581,42 +1587,42 @@ match the length value above. \needlines{5} An FDE contains the following fields, in order: \begin{enumerate}[1. ] -\item length (initial length) \\ +\item \texttt{length} (\livelink{datarep:initiallengthvalues}{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}). -The size of the length field +The size of the \texttt{length} field plus the value of length must be an integral multiple of the address size. \item CIE\_pointer (4 or 8 bytes, see Section \refersec{datarep:32bitand64bitdwarfformats}) \\ A constant \addtoindexx{section offset!in FDE header} -offset into the \addtoindex{.debug\_frame} +offset into the \dotdebugframe{} section that denotes the CIE that is associated with this FDE. -\item initial\_location (segment selector and target address) \\ +\item \texttt{initial\_location} (segment selector and target address) \\ The -\addtoindexx{initial\_location} +\addtoindexx{\texttt{initial\_location}} address of the first location associated with this table entry. -If the \addtoindex{segment\_size} field of this FDE's CIE is non-zero, +If the \addtoindex{\texttt{segment\_size}} field of this FDE's CIE is non-zero, the initial location is preceded by a segment selector of the given length. -\item address\_range (target address) \\ +\item \texttt{address\_range} (target address) \\ The -\addtoindexx{address\_range} +\addtoindexx{\texttt{address\_range}} number \addtoindexx{target address} of bytes of program instructions described by this entry. -\item instructions (array of \addtoindex{ubyte}) \\ +\item \texttt{instructions} (array of \addtoindex{ubyte}) \\ A sequence of table defining instructions that are described below. -\item padding (array of \addtoindex{ubyte}) \\ +\item \texttt{padding} (array of \addtoindex{ubyte}) \\ Enough \livelink{chap:DWCFAnop}{DW\_CFA\_nop} instructions to make the size of this entry match the length value above. \end{enumerate} @@ -1672,9 +1678,9 @@ new table row using the specified address as the location. All other values in the new row are initially identical to the current row. The new location value is always greater than the current one. -If the \addtoindex{segment\_size} field of this FDE's +If the \addtoindex{\texttt{segment\_size}} field of this FDE's \addtoindex{CIE} -is non- zero, the initial location is preceded by a segment +is non\dash zero, the initial location is preceded by a segment selector of the given length. @@ -1684,9 +1690,8 @@ 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 and adding the value of -\textit{delta * \addtoindex{code\_alignment\_factor}}. -All -other values in the new row are initially identical to the +\textit{delta} * \addtoindex{\texttt{code\_alignment\_factor}}. +All other values in the new row are initially identical to the current row \item \textbf{DW\_CFA\_advance\_loc1} \\ @@ -1730,8 +1735,8 @@ an unsigned LEB128 value\addtoindexx{LEB128!unsigned} representing a register number and a signed LEB128\addtoindexx{LEB128!signed} factored offset. This instruction is identical to \livelink{chap:DWCFAdefcfa}{DW\_CFA\_def\_cfa} except that the second operand is signed -and factored. The resulting offset is factored\_offset * -\addtoindex{data\_alignment\_factor}. +and factored. The resulting offset is \textit{factored\_offset} * +\addtoindex{\texttt{data\_alignment\_factor}}. \item \textbf{DW\_CFA\_def\_cfa\_register} \\ @@ -1759,7 +1764,7 @@ The \livetarg{chap:DWCFAdefcfaoffsetsf}{DW\_CFA\_def\_cfa\_offset\_sf} instructi LEB128\addtoindexx{LEB128!signed} operand representing a factored offset. This instruction is identical to \livelink{chap:DWCFAdefcfaoffset}{DW\_CFA\_def\_cfa\_offset} except that the operand is signed and factored. The resulting offset is -factored\_offset * \addtoindex{data\_alignment\_factor}. +\textit{factored\_offset} * \addtoindex{\texttt{data\_alignment\_factor}}. This operation is valid only if the current CFA rule is defined to use a register and offset. @@ -1787,13 +1792,13 @@ expression operators that can be used.} The \livetarg{chap:DWCFAundefined}{DW\_CFA\_undefined} instruction takes a single unsigned LEB128\addtoindexx{LEB128!unsigned} operand that represents a register number. The required action is to set the rule for the specified register to -undefined.'' +\doublequote{undefined.} \item \textbf{DW\_CFA\_same\_value} \\ The \livetarg{chap:DWCFAsamevalue}{DW\_CFA\_same\_value} instruction takes a single unsigned LEB128 operand\addtoindexx{LEB128!unsigned} that represents a register number. The required action is to set the rule for the specified register to -same value.'' +\doublequote{same value.} \item \textbf{DW\_CFA\_offset} \\ The \livetarg{chap:DWCFAoffset}{DW\_CFA\_offset} instruction takes two operands: a register @@ -1802,7 +1807,7 @@ constant representing a factored offset. The required action is to change the rule for the register indicated by the register number to be an offset(N) rule where the value of N is -\textit{factored offset * \addtoindex{data\_alignment\_factor}}. +\textit{factored offset} * \addtoindex{\texttt{data\_alignment\_factor}}. \item \textbf{DW\_CFA\_offset\_extended} \\ The \livetarg{chap:DWCFAoffsetextended}{DW\_CFA\_offset\_extended} @@ -1821,7 +1826,7 @@ signed LEB128 factored offset. This instruction is identical to \livelink{chap:DWCFAoffsetextended}{DW\_CFA\_offset\_extended} except that the second operand is signed and factored. The resulting offset is -\textit{factored\_offset * \addtoindex{data\_alignment\_factor}}. +\textit{factored\_offset} * \addtoindex{\texttt{data\_alignment\_factor}}. \item \textbf{DW\_CFA\_val\_offset} \\ The \livetarg{chap:DWCFAvaloffset}{DW\_CFA\_val\_offset} @@ -1830,7 +1835,7 @@ LEB128 operands\addtoindexx{LEB128!unsigned} representing a register number and factored offset. The required action is to change the rule for the register indicated by the register number to be a val\_offset(N) rule where the value of N is -\textit{factored\_offset * \addtoindex{data\_alignment\_factor}}. +\textit{factored\_offset} * \addtoindex{\texttt{data\_alignment\_factor}}. \item \textbf{DW\_CFA\_val\_offset\_sf} \\ The \livetarg{chap:DWCFAvaloffsetsf}{DW\_CFA\_val\_offset\_sf} instruction takes two operands: an @@ -1838,7 +1843,7 @@ unsigned LEB128\addtoindexx{LEB128!unsigned} value representing a register numbe signed LEB128\addtoindexx{LEB128!signed} factored offset. This instruction is identical to \livelink{chap:DWCFAvaloffset}{DW\_CFA\_val\_offset} except that the second operand is signed and factored. The resulting offset is -\textit{factored\_offset * \addtoindex{data\_alignment\_factor}}. +\textit{factored\_offset} * \addtoindex{\texttt{data\_alignment\_factor}}. \item \textbf{DW\_CFA\_register} \\ The \livetarg{chap:DWCFAregister}{DW\_CFA\_register} @@ -1889,7 +1894,7 @@ expression operators that can be used.} The \livetarg{chap:DWCFArestore}{DW\_CFA\_restore} instruction takes a single operand (encoded with the opcode) that represents a register number. The required action is to change the rule for the indicated -register to the rule assigned it by the initial\_instructions +register to the rule assigned it by the \texttt{initial\_instructions} in the CIE. \item \textbf{DW\_CFA\_restore\_extended} \\ @@ -1941,25 +1946,26 @@ appropriate size \textit{To determine the virtual unwind rule set for a given location (L1), one searches through the FDE headers looking at the -initial\_location and address\_range values to see if L1 is +\texttt{initial\_location} and \texttt{address\_range} values to see if L1 is contained in the FDE. If so, then:} \begin{enumerate}[1. ] \item \textit{Initialize a register set by reading the -initial\_instructions field of the associated CIE.} +\texttt{initial\_instructions} field of the associated CIE.} \item \textit{Read and process the FDE\textquoteright s instruction sequence until a \livelink{chap:DWCFAadvanceloc}{DW\_CFA\_advance\_loc}, \livelink{chap:DWCFAsetloc}{DW\_CFA\_set\_loc}, or the end of the instruction stream is encountered.} -\item \textit{ If a \livelink{chap:DWCFAadvanceloc}{DW\_CFA\_advance\_loc} or \livelink{chap:DWCFAsetloc}{DW\_CFA\_set\_loc} +\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\geq\$ L2 then process the instruction and go back
to step 2.}

\item \textit{ The end of the instruction stream can be thought
instruction. Note that the FDE is ill-formed if L2 is less
than L1.}

index ee1d69a..5fe2e5c 100644 (file)
@@ -176,7 +176,7 @@ unit.
This information is placed in a separate object file
section from the debugging information entries themselves. The
value of the statement list attribute is the offset in the
-\addtoindex{.debug\_line} section of the first byte of the line number
+\dotdebugline{} section of the first byte of the line number
information for this compilation unit
(see Section \refersec{chap:linenumberinformation}).

@@ -191,7 +191,7 @@ 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
-the \addtoindex{.debug\_macinfo} section of the first byte of the macro
+the \dotdebugmacinfo{} section of the first byte of the macro
information for this compilation unit
(see Section \refersec{chap:macroinformation}).

@@ -879,8 +879,8 @@ a

-language allows the keywords elemental, pure
-and recursive to be included as part of the declaration of
+language allows the keywords \texttt{elemental}, \texttt{pure}
+and \texttt{recursive} to be included as part of the declaration of
a subroutine; these attributes reflect that usage. These
attributes are not relevant for languages that do not support
similar keywords or syntax. In particular, the \livelink{chap:DWATrecursive}{DW\_AT\_recursive}
@@ -1255,7 +1255,7 @@ Name&Meaning\\ \hline
\end{table}

\textit{In \addtoindex{C++}, a function or a constructor declared with
-constexpr is implicitly declared inline. The abstract inline
+\addtoindex{\texttt{constexpr}} is implicitly declared inline. The abstract inline
instance (see below) is represented by a debugging information
entry with the tag \livelink{chap:DWTAGsubprogram}{DW\_TAG\_subprogram}. Such an entry has a
@@ -1430,7 +1430,8 @@ representation of the subroutine's return value. The value of
this attribute is the actual return value of the subroutine,
represented as it would be on the target architecture.

-\textit{In \addtoindex{C++}, if a function or a constructor declared with constexpr
+\textit{In \addtoindex{C++}, if a function or a constructor declared with
is called with constant expressions, then the corresponding
concrete inlined instance has a
index dffb6f6..103aeba 100644 (file)
@@ -21,11 +21,11 @@ numbers are in use for each section.

There are sections with no version number encoded in them;
they are only accessed via the
+\dotdebuginfo{} and
+\dotdebugtypes{}
sections and so an incompatible change in those sections'
format would be represented by a change in the
+and \dotdebugtypes{} section version number.

\clearpage
\begin{centering}
@@ -40,18 +40,18 @@ and \addtoindex{.debug\_types} section version number.
\endfoot
\hline
\endlastfoot
-\addtoindex{.debug\_abbrev}& -  & -  & -  \\
-\addtoindex{.debug\_loc}& -  & -  & -  \\
-\addtoindex{.debug\_macinfo}& -  & - & -   \\
-\addtoindex{.debug\_str}& -  & -  & -  \\
+\dotdebugabbrev{}& -  & -  & -  \\
+\dotdebugaranges{}&2&2&2 \\
+\dotdebugframe{}&1&3&4 \\
+\dotdebuginfo{}&2&3&4 \\
+\dotdebugline{}&2&3&4   \\
+\dotdebugloc{}& -  & -  & -  \\
+\dotdebugmacinfo{}& -  & - & -   \\
+\dotdebugpubnames{}&2&2&2    \\
+\dotdebugpubtypes{}&x&2&2   \\
+\dotdebugranges{}&x& - & -  \\
+\dotdebugstr{}& -  & -  & -  \\
+\dotdebugtypes{}&x&x&4   \\
\end{longtable}
\end{centering}

@@ -67,12 +67,12 @@ Notes:
\item  x'' means that the section was not defined in that
version of the DWARF standard.

+\item  The version numbers for the \dotdebuginfo{} and \dotdebugtypes{}
sections must be the same.

\end{itemize}

-\textit{For \addtoindex{.debug\_frame}, section version 2 is unused.}
+\textit{For \dotdebugframe{}, section version 2 is unused.}

Higher numbers are reserved for future use.

index 4bee7a4..2e040da 100644 (file)

Each debugging information entry owned by a subroutine
-type entry has a tag whose value has one of two possible
-interpretations:
+type entry correspond to either a formal parameter or the sequence of
+unspecified parameters of the subprogram type:

\begin{enumerate}[1. ]
-\item The formal parameters of a parameter list (that have a
-specific type) are represented by a debugging information entry
+\item A formal parameter of a parameter list (that has a
+specific type) is represented by a debugging information entry
Each formal parameter
entry has
@@ -1914,7 +1914,7 @@ the formal parameter.
\item The unspecified parameters of a variable parameter list
are
represented by a debugging information entry with the
\end{enumerate}
@@ -2109,17 +2109,20 @@ If the upper bound and count are missing, then the upper bound value is

If the subrange entry has no type attribute describing the
-basis type, the basis type is assumed to be the same as
-the object described by the lower bound attribute (if it
-references an object). If there is no lower bound attribute,
-or that attribute does not reference an object, the basis type
-is the type of the upper bound or \addtoindex{count attribute}
-(if either
-of them references an object). If there is no upper bound or
-count attribute, or neither references an object, the type is
+basis type, the basis type is determined as follows:
+\begin{enumerate}[1. ]
+\item
+If there is a lower bound attribute that references an object,
+the basis type is assumed to be the same as the type of that object.
+\item
+Otherwise, if there is an upper bound or count attribute that references
+an object, the basis type is assumed to be the same as the type of that object.
+\item
+Otherwise, the type is
assumed to be the same type, in the source language of the
compilation unit containing the subrange entry, as a signed
integer with the same size as an address on the target machine.
+\end{enumerate}

If the subrange type occurs as the description of a dimension
of an array type, and the stride for that dimension is
@@ -2174,11 +2177,9 @@ attribute, whose value is a reference to a debugging
information entry for the class or structure to whose members
objects of this type may point.

-The
\hypertarget{chap:DWATuselocationmemberlocationforpointertomembertype}
-has