Skip to content

Commit

Permalink
Add patchAPI/PatchCommon.h
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Apr 3, 2024
1 parent 5e5e0d8 commit bb2cdef
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 30 deletions.
3 changes: 2 additions & 1 deletion docs/patchAPI/developer/API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ PatchAPI

AddrSpace.h
ParseCallback.h
PatchCFG.h
PatchCFG.h
PatchCommon.h
41 changes: 41 additions & 0 deletions docs/patchAPI/developer/PatchCommon.h.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.. _`sec:PatchCommon.h`:

PatchCommon.h
#############

.. cpp:namespace:: Dyninst::PatchAPI

.. cpp:type:: std::set<Point*> PointSet
.. cpp:type:: PointSet::iterator PointIter
.. cpp:type:: boost::shared_ptr<Instance> InstancePtr
.. cpp:type:: std::set<InstancePtr> InstanceSet
.. cpp:type:: std::list<InstancePtr> InstanceList
.. cpp:type:: boost::shared_ptr<PatchMgr> PatchMgrPtr
.. cpp:type:: boost::shared_ptr<Snippet> SnippetPtr
.. cpp:type:: std::map<PatchFunction*, PatchFunction*> FuncModMap

Maps a PatchFunction to another PatchFunction.

.. cpp:type:: std::map<PatchFunction*, std::pair<PatchFunction*, std::string> > FuncWrapMap

.. cpp:type:: std::map<PatchBlock*, std::map<PatchFunction*, PatchFunction*> > CallModMap

| This is a little complex, so let me explain my logic.
|
| Map from B -> F_c -> F
|
| B identifies a call site
|
| F_c identifies an (optional) function context for the replacement
| If F_c is not specified, we use NULL
|
| F specifies the replacement callee
| If we want to remove the call entirely, also use NULL
.. cpp:type:: std::set<ParseAPI::CodeObject*> CodeObjectSet

.. cpp:type:: std::set<ParseAPI::CodeSource*> CodeSourceSet

.. c:macro:: patchapi_debug
Set ``DYNINST_DEBUG_PATCHAPI`` in your environment to enable.
3 changes: 1 addition & 2 deletions docs/patchAPI/public/API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ PatchAPI
Instrumenter.h
PatchCallback.h
PatchCFG.h
PatchCommon.h
PatchMgr.h
PatchModifier.h
PatchObject.h
Point.h
Snippet.h
Snippet.h
19 changes: 0 additions & 19 deletions docs/patchAPI/public/PatchCommon.h.rst

This file was deleted.

8 changes: 0 additions & 8 deletions patchAPI/h/PatchCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#ifndef PATCHAPI_H_COMMON_H_
#define PATCHAPI_H_COMMON_H_

// C++
#include <string>
#include <string.h>
#include <utility>
Expand Down Expand Up @@ -87,13 +86,6 @@ typedef boost::shared_ptr<Snippet> SnippetPtr;
typedef std::map<PatchFunction*, PatchFunction*> FuncModMap;
typedef std::map<PatchFunction*, std::pair<PatchFunction*, std::string> > FuncWrapMap;

// This is a little complex, so let me explain my logic
// Map from B -> F_c -> F
// B identifies a call site
// F_c identifies an (optional) function context for the replacement
// ... if F_c is not specified, we use NULL
// F specifies the replacement callee; if we want to remove the call entirely,
// also use NULL
typedef std::map<PatchBlock*, std::map<PatchFunction*, PatchFunction*> > CallModMap;

typedef std::set<ParseAPI::CodeObject*> CodeObjectSet;
Expand Down

0 comments on commit bb2cdef

Please sign in to comment.