Skip to content

Commit

Permalink
Add dyninstAPI/BPatch_snippet.h
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Apr 3, 2024
1 parent 9967012 commit ed66cc1
Show file tree
Hide file tree
Showing 4 changed files with 439 additions and 370 deletions.
1 change: 1 addition & 0 deletions docs/dyninstAPI/developer/API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ DyninstAPI
BPatch_point.h
BPatch_private.h
BPatch_process.h
BPatch_snippet.h
codegen-aarch64.h
codegen.h
codegen-power.h
Expand Down
62 changes: 62 additions & 0 deletions docs/dyninstAPI/developer/BPatch_snippet.h.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.. _`sec-dev:BPatch_snippet.h`:

BPatch_snippet.h
################

.. cpp:namespace:: dev

.. cpp:class:: BPatch_snippet
.. cpp:function:: BPatch_type * getType()

Returns the type of the underlying AST.

DynC internal use only.

.. cpp:class:: BPatch_variableExpr : public BPatch_snippet
.. cpp:function:: private BPatch_variableExpr(const char* in_name, BPatch_addressSpace* in_addSpace,\
AddressSpace* as, AstNodePtr ast_wrapper_, BPatch_type *type,\
void* in_address)

Used to get expressions for the components of a structure Used to get function pointers

.. cpp:function:: private BPatch_variableExpr(BPatch_addressSpace *in_addSpace, AddressSpace *as,\
void *in_address, int in_register, BPatch_type *type,\
BPatch_storageClass storage = BPatch_storageAddr,\
BPatch_point *scp = NULL)

Used to get forked copies of variable expressions Used by malloc & malloc_by_type

.. cpp:function:: private BPatch_variableExpr(BPatch_addressSpace *in_addSpace, AddressSpace *as,\
BPatch_localVar *lv,BPatch_type *type, BPatch_point *scp)

Used for locals

.. cpp:function:: private BPatch_variableExpr(BPatch_addressSpace *in_addSpace, AddressSpace *ll_addSpace,\
int_variable *iv, BPatch_type *type)

.. cpp:function:: private BPatch_variableExpr(const char name, BPatch_addressSpace in_addSpace,\
AddressSpace ll_addSpace, void in_address, BPatch_type type)

Used by findOrCreateVariable

.. cpp:function:: static BPatch_variableExpr* makeVariableExpr(BPatch_addressSpace* in_addSpace,\
int_variable* v, BPatch_type* type)


.. cpp:class:: BPatch_ifMachineConditionExpr : public BPatch_snippet

It is possible to have a more general expression, say machineConditionExpr, then have this
reimplemented as ifExpr(machineConditionExpr, ...), and have an optimization (fast path) for
that case using the specialized AST that supports this class. Memory instrumentation has no
need for a standalone machineConditionExpr, so that remains TBD...


.. cpp:class:: BPatch_stopThreadExpr : public BPatch_snippet

.. cpp:function:: BPatch_stopThreadExpr(const BPatchStopThreadCallback &cb,\
const BPatch_snippet &calculation, const mapped_object &obj,\
bool useCache = false, BPatch_stInterpret interp = BPatch_noInterp)

For internal use in conjunction with memory emulation and defensive mode analysis

0 comments on commit ed66cc1

Please sign in to comment.