Skip to content

Commit

Permalink
Add dyninstAPI/BPatch_edge.h
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Apr 3, 2024
1 parent 382a0b4 commit 9bc9412
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 27 deletions.
41 changes: 26 additions & 15 deletions docs/dyninstAPI/public/BPatch_edge.h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,29 @@ BPatch_edge.h

.. cpp:class:: BPatch_edge
The **BPatch_edge** class represents a control flow edge in a
BPatch_flowGraph.
**A an edge in a control flow graph**

.. cpp:function:: BPatch_point *getPoint()
.. cpp:function:: BPatch_edge(edge_instance *e, BPatch_flowGraph *fg)

.. cpp:function:: ~BPatch_edge()

.. cpp:function:: void dump()

Print internal data

.. cpp:function:: BPatch_basicBlock * getSource()

Return the source BPatch_basicBlock that this edge flows from.

.. cpp:function:: BPatch_basicBlock * getTarget()

Return the target BPatch_basicBlock that this edge flows to.

.. cpp:function:: BPatch_point * getPoint()

Return an instrumentation point for this edge. This point can be passed
to BPatch_process::insertSnippet to instrument the edge.

.. cpp:enum:: BPatch_edgeType
.. cpp:enumerator:: BPatch_edgeType::CondJumpTaken
.. cpp:enumerator:: BPatch_edgeType::CondJumpNottaken
.. cpp:enumerator:: BPatch_edgeType::UncondJump
.. cpp:enumerator:: BPatch_edgeType::NonJump

.. cpp:function:: BPatch_edgeType getType()

Return a type describing this edge. A CondJumpTaken edge is found after
Expand All @@ -29,14 +38,16 @@ BPatch_edge.h
out of a basic block that does not end in a jump, but falls through into
the next basic block.

.. cpp:function:: BPatch_basicBlock *getSource()
.. cpp:function:: BPatch_flowGraph * getFlowGraph()

Return the source BPatch_basicBlock that this edge flows from.
Returns the CFG that contains the edge.

.. cpp:function:: BPatch_basicBlock *getTarget()

Return the target BPatch_basicBlock that this edge flows to.
.. cpp:enum:: BPatch_edgeType

.. cpp:function:: BPatch_flowGraph *getFlowGraph()
.. cpp:enumerator:: CondJumpTaken
.. cpp:enumerator:: CondJumpNottaken
.. cpp:enumerator:: UncondJump
.. cpp:enumerator:: NonJump

Returns the CFG that contains the edge.
.. note:: This ignores indirect jumps
12 changes: 0 additions & 12 deletions dyninstAPI/h/BPatch_edge.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class BPatch_point;
class edge_instance;
class BPatch_edge;

// XXX ignores indirect jumps
typedef enum {
CondJumpTaken, CondJumpNottaken, UncondJump, NonJump
} BPatch_edgeType;
Expand All @@ -57,27 +56,16 @@ namespace Dyninst {



/** An edge between two blocks
*/
class BPATCH_DLL_EXPORT BPatch_edge {
friend Dyninst::ParseAPI::Edge *Dyninst::ParseAPI::convert(const BPatch_edge *);
friend Dyninst::PatchAPI::PatchEdge *Dyninst::PatchAPI::convert(const BPatch_edge *);

public:

// BPatch_edge::BPatch_edge
//
// constructor
BPatch_edge(edge_instance *e, BPatch_flowGraph *fg);

// BPatch_edge::~BPatch_edge
//
// destructor
~BPatch_edge();

// BPatch_edge::dump
//
// print internal data
void dump();

BPatch_basicBlock * getSource();
Expand Down

0 comments on commit 9bc9412

Please sign in to comment.