Skip to content

Commit

Permalink
Grammar and formatting fixes for DataflowAPI manual.
Browse files Browse the repository at this point in the history
  • Loading branch information
morehouse committed Jun 7, 2016
1 parent da7c751 commit 4b099da
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 42 deletions.
2 changes: 1 addition & 1 deletion common/doc/manual_frontpage.tex
Expand Up @@ -44,7 +44,7 @@
\node [anchor=west,font=\sffamily] (rel1) at ($(origin)+(0.75in,-5.0in)$)
{\fontsize{24}{32}\selectfont 9.2 Release};
\node [anchor=west,font=\sffamily] (rel2) at ($(rel1.west)+(0in,-32pt)$)
{\fontsize{24}{32}\selectfont Apr 2016};
{\fontsize{24}{32}\selectfont June 2016};

% Contact information
% \matrix (UWaddress) [%
Expand Down
4 changes: 2 additions & 2 deletions dataflowAPI/doc/AST.tex
Expand Up @@ -4,11 +4,11 @@ \subsection{Class AST}

We provide a generic AST framework to represent tree structures.
One example use case is to represent instruction semantics with symbolic expressions.
This AST framework include the base class definitions for tree nodes and visitors.
The AST framework includes the base class definitions for tree nodes and visitors.
Users can inherit tree node classes to create their own AST structure and
AST visitors to write their own analyses for the AST.

All AST node classes should be derived from class AST and currently we have the
All AST node classes should be derived from the AST class. Currently we have the
following types of AST nodes.

\begin{center}
Expand Down
12 changes: 6 additions & 6 deletions dataflowAPI/doc/AbsLocs.tex
Expand Up @@ -59,7 +59,7 @@ \subsection{Class Absloc}
ParseAPI::Function *f);
\end{apient}
\apidesc{Create a Stack type abstract location, representing a stack variable in
the frame of function \code{f} and at offset \code{o} within the frame.}
the frame of function \code{f}, within abstract region \code{r}, and at offset \code{o} within the frame.}

\begin{apient}
std::string format() const;
Expand Down Expand Up @@ -214,9 +214,9 @@ \subsection{Class AbsRegionConverter}
\begin{apient}
void convertAll(InstructionAPI::Expression::Ptr expr,
Address addr,
ParseAPI::Function *func,
ParseAPI::Block *block,
std::vector<AbsRegion> &regions);
ParseAPI::Function *func,
ParseAPI::Block *block,
std::vector<AbsRegion> &regions);
\end{apient}
\apidesc{Create all abstract regions used in \code{expr} and return them in
\code{regions}. All registers appear in \code{expr} will have a separate
Expand All @@ -235,9 +235,9 @@ \subsection{Class AbsRegionConverter}
std::vector<AbsRegion> &used,
std::vector<AbsRegion> &defined);
\end{apient}
\apidesc{Create abstract regions appeared in instruction \code{insn}. Input
\apidesc{Create abstract regions appearing in instruction \code{insn}. Input
abstract regions of this instructions are returned in \code{used} and output
abstract regions are returned in \code{defined}.If the expression represents a memory access, we will also
abstract regions are returned in \code{defined}. If the expression represents a memory access, we will also
create a heap or stack abstract region depending on where it accesses.
\code{addr}, \code{func}, and \code{blocks} specify the contexts of the
expression.
Expand Down
12 changes: 6 additions & 6 deletions dataflowAPI/doc/Abstractions.tex
Expand Up @@ -7,32 +7,32 @@ \section{Abstractions}
\begin{itemize}[leftmargin=0pt,label=$\circ$]
{\item {\scshape Abstract Location}
represents a register or memory location in the program.
DataflowAPI provides three types of abstract locations: registers, stack, and
help. A register abstract location represents a register and a register at two
DataflowAPI provides three types of abstract locations: register, stack, and
heap. A register abstract location represents a register, and the same register at two
different program locations is treated as the same abstract location.
A stack abstract location consists of the stack frame to which it belongs and
the offset within the stack frame.
A heap abstract location represents the virtual address of the heap variable.
A heap abstract location consists of the virtual address of the heap variable.
}

{\item {\scshape Abstract Region}
represents a set of abstract locations of the same type.
If an abstract region contains only a single abstract location, the
abstract location is precisely represented.
If an abstract region contains more than one abstract locations, the region
If an abstract region contains more than one abstract location, the region
contains the type of the locations. In the cases where it represents memory
(either heap or stack), an abstract region also contains
the memory address calculation that gives rise to this region.
}

{\item {\scshape Abstract Syntax Tree (AST)}
represents a symbolic expression of an instruction's semantics.
Specifically, an AST specifies how the value of an abstract location is modified by this
Specifically, an AST specifies how the value of an abstract location is modified by the
instruction.
}

{\item {\scshape Assignment}
represents a single data dependency of abstract regions in an instruction. For example, xchg eax, ebx creates two assignments: one from pre-instruction eax to post-instruction ebx, and one from pre-instruction ebx to post-instruction eax.
represents a single data dependency of abstract regions in an instruction. For example, \texttt{xchg eax, ebx} creates two assignments: one from pre-instruction \texttt{eax} to post-instruction \texttt{ebx}, and one from pre-instruction \texttt{ebx} to post-instruction \texttt{eax}.
}

{\item {\scshape Stack Height}
Expand Down
9 changes: 5 additions & 4 deletions dataflowAPI/doc/Examples.tex
@@ -1,15 +1,15 @@
\section{Examples}
\label{sec:examples}
We show several examples of how to use DataflowAPI. In these examples, we assume
that the mutatee has been parsed and we have a function and block to analyze.
Users can refer to ParseAPI manual for how to get these functions and blocks.
that the mutatee has been parsed and we have function and block objects to analyze.
Users may refer to the ParseAPI manual for how to obtain these function and block objects.

\subsection{Slicing}
The following example uses DataflowAPI to perform a backward slice on an
indirect jump instruction to determine the instructions that affect the
calculation of the jump target. The goal of this example is to show (1) how to
convert an instruction to assignments; (2) how to perform slicing on a given
assignment; (3) how to extend the default \code{Slicer::Predicates} and write
assignment; (3) how to extend the default \texttt{Slicer::Predicates} and write
call back functions to control the behavior of slicing.

\lstset{language=[GNU]C++,basicstyle=\fontfamily{fvm}\selectfont\small}
Expand Down Expand Up @@ -182,7 +182,7 @@ \subsection{Liveness Analysis}
\end{lstlisting}

\subsection{Stack Analysis}
The following examples shows how to use stack analysis.
The following example shows how to use stack analysis to print out all defined stack heights at the first instruction in a block.

\lstset{language=[GNU]C++,basicstyle=\fontfamily{fvm}\selectfont\small}
\lstset{numbers=left, numberstyle=\tiny, stepnumber=5, numbersep=5pt}
Expand All @@ -192,6 +192,7 @@ \subsection{Stack Analysis}
#include "stackanalysis.h"

void StackHeight(Function *f, Block *b) {
// Get the address of the first instruction of the block
Address addr = block->start();

// Get the stack heights at that address
Expand Down
10 changes: 5 additions & 5 deletions dataflowAPI/doc/Graph.tex
Expand Up @@ -2,8 +2,8 @@ \subsection{Class Graph}
\definedin{Graph.h}
\label{sec:graph}

We provide a generic graph interface, which allows users adding, deleting,
iterating nodes and edges in a graph. Our slicing algorithms are implemented
We provide a generic graph interface, which allows users to add, delete, and
iterate nodes and edges in a graph. Our slicing algorithms are implemented
upon this graph interface, so users can inherit the defined classes for
customization.

Expand Down Expand Up @@ -40,7 +40,7 @@ \subsection{Class Graph}
\begin{apient}
void insertPair(NodePtr source, NodePtr target, EdgePtr edge = EdgePtr());
\end{apient}
\apidesc{Insert an pair of node into the graph and create a new edge \code{edge} from
\apidesc{Insert a pair of nodes into the graph and create a new edge \code{edge} from
\code{source} to \code{target}.}

\begin{apient}
Expand Down Expand Up @@ -86,7 +86,7 @@ \subsection{Class Node}
\begin{apient}
typedef boost::shared_ptr<Node> Ptr;
\end{apient}
\apidesc{shared pointer for Node}
\apidesc{Shared pointer for Node}

\begin{apient}
void ins(EdgeIterator &begin, EdgeIterator &end);
Expand All @@ -99,7 +99,7 @@ \subsection{Class Node}
void outs(NodeIterator &begin, NodeIterator &end);
\end{apient}
\apidesc{Iterate over adjacent nodes connected with incoming/outgoing edges of
this node}.
this node.}

\begin{apient}
bool hasInEdges();
Expand Down
3 changes: 1 addition & 2 deletions dataflowAPI/doc/Intro.tex
Expand Up @@ -17,8 +17,7 @@ \section{Introduction}
}

{\item {\scshape Stack Analysis}
determines whether a register points to the stack and
which stack location the register points to, when it does point to the stack.
determines whether or not a register or memory location points to the stack. If it does point to the stack, Stack Analysis may be able to determine the exact stack location that is pointed to.
}

{\item {\scshape Symbolic Expansion and Evaluation}
Expand Down
19 changes: 9 additions & 10 deletions dataflowAPI/doc/Slicing.tex
Expand Up @@ -11,10 +11,10 @@ \subsection{Class Slicer}
are directed and represent either data flow dependencies or control flow
dependencies.

We provide callback functions
and allow users controlling when to stop slicing.
We provide call back functions
and allow users to control when to stop slicing.
In particular, class \code{Slicer::Predicates} contains a collection of call back functions that can
control the specific behaviors of the slicer. Users can inherit Predicates class
control the specific behaviors of the slicer. Users can inherit from the Predicates class
to provide customized stopping criteria for the slicer.

\begin{apient}
Expand Down Expand Up @@ -98,9 +98,8 @@ \subsection{Class Slicer::Predicates}
\definedin{slicing.h}

Class Predicates abstracts the stopping criteria of slicing. Users can inherit
this class to control slicing in various situations, including whether or not
performing inter-procedural slicing, whether or not searching for control flow
dependencies, and stopping slicing after discovering certain assignments. We
this class to control slicing in various situations, including whether or not to perform inter-procedural slicing, whether or not to search for control flow
dependencies, and whether or not to stop slicing after discovering certain assignments. We
provide a set of call back functions that allow users to dynamically control the
behavior of the Slicer.

Expand Down Expand Up @@ -150,7 +149,7 @@ \subsection{Class Slicer::Predicates}
This function also takes input \code{cs}, which represents the call stack of the
followed callee functions from the starting point of the slicing to this call
site, and \code{argument}, which represents the variable to slice with in the
callee function. This function is default to always return \code{false}.
callee function. This function defaults to always returning \code{false}.
Note that as Dyninst currently does not try to resolve indirect
calls, the slicer will NOT call this function at an indirect call site. }
%virtual bool followCallee(ParseAPI::Function * callee,
Expand All @@ -172,12 +171,12 @@ \subsection{Class Slicer::Predicates}
\apidesc{This predicate function is called when the slicer reaches the entry of
a function in the case of backward slicing or reaches a return instruction in
the case of forward slicing. It returns a vector of caller functions that the
user want the slicer to continue to follow. This function takes input
user wants the slicer to continue to follow. This function takes input
\code{caller}, which represents the call block of the caller, \code{cs}, which
represents the caller functions that have been followed to this place, and
\code{argument}, which represents the variable to slice with in the caller
function. This function is default to always
return an empty vector.}
function. This function defaults to always
returning an empty vector.}

% followCaller(ParseAPI::Block * caller,

Expand Down
12 changes: 6 additions & 6 deletions dataflowAPI/doc/SymEval.tex
Expand Up @@ -52,7 +52,7 @@ \subsection{Class SymEval}
\begin{apient}
static Retval_t expand(Dyninst::Graph::Ptr slice, DataflowAPI::Result_t &res);
\end{apient}
\apidesc{This interface expands a slice and return an AST for each assignment in
\apidesc{This interface expands a slice and returns an AST for each assignment in
the slice. This function will perform substitution of ASTs.}

We use an AST to represent the symbolic expressions of an assignment. A symbolic
Expand Down Expand Up @@ -115,9 +115,9 @@ \subsection{Class SymEval}
\begin{apient}
Constant::Constant();
Constant::Constant(uint64_t v);
Constnat::Constant(uint64_t v, size_t s);
Constant::Constant(uint64_t v, size_t s);
\end{apient}
\apidesc{Constructors a Constant objects.}
\apidesc{Construct Constant objects.}

\begin{apient}
bool Constant::operator==(const Constant &rhs) const;
Expand Down Expand Up @@ -171,7 +171,7 @@ \subsection{Class SymEval}
derefOp & Dereference memory operation \\
writeRepOp & Write rep operation\\
writeOp & Write operation\\
ifOp & if operation \\
ifOp & If operation \\
sMultOp & Signed multiplication operation \\
uMultOp & Unsigned multiplication operation \\
sDivOp & Signed division operation \\
Expand Down Expand Up @@ -208,7 +208,7 @@ \subsection{Class SymEval}
\subsection{Class ASTVisitor}

The ASTVisitor class defines callback functions to apply during visiting an AST for
each AST node type. Users can inherit this class to write customized analyses
each AST node type. Users can inherit from this class to write customized analyses
for ASTs.

\begin{apient}
Expand All @@ -221,5 +221,5 @@ \subsection{Class ASTVisitor}
virtual ASTVisitor::ASTPtr ASTVisitor::visit(StackAST *);
\end{apient}
\apidesc{Callback functions for visiting each type of AST node. The default
behavior is returning the input parameter.}
behavior is to return the input parameter.}

Binary file modified dataflowAPI/doc/dataflowAPI.pdf
Binary file not shown.

0 comments on commit 4b099da

Please sign in to comment.