Skip to content

Commit

Permalink
Add dyninstAPI/BPatch_instruction.h
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Apr 3, 2024
1 parent 95d33f4 commit aace4cb
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 7 deletions.
1 change: 1 addition & 0 deletions docs/dyninstAPI/developer/API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ DyninstAPI
BPatch_frame.h
BPatch_function.h
BPatch_image.h
BPatch_instruction.h
BPatch_libInfo.h
BPatch_memoryAccessAdapter.h
BPatch_private.h
Expand Down
38 changes: 38 additions & 0 deletions docs/dyninstAPI/developer/BPatch_instruction.h.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.. _`sec-dev:BPatch_instruction.h`:

BPatch_instruction.h
####################

.. cpp:namespace:: dev

.. cpp:class:: BPatch_instruction

.. cpp:member:: protected unsigned int nacc
.. cpp:member:: protected internal_instruction *insn_
.. cpp:member:: protected bool *isLoad
.. cpp:member:: protected bool *isStore
.. cpp:member:: protected int *preFcn

prefetch function(-1 = none)

.. cpp:member:: protected int *condition

-1 means no condition, all other values are machine specific conditions, currently(8/13/02) the tttn field on x86

.. cpp:member:: protected bool *nonTemporal

non-temporal(cache non-polluting) write on x86

.. cpp:member:: protected BPatch_basicBlock *parent
.. cpp:member:: protected long unsigned int addr

.. cpp:function:: internal_instruction *insn()
.. cpp:function:: char *getMnemonic() const


.. cpp:class:: BPatch_branchInstruction : public BPatch_instruction

.. cpp:function:: BPatch_branchInstruction(internal_instruction *insn, long unsigned int _addr, void *target)
.. cpp:function:: ~BPatch_branchInstruction()
.. cpp:function:: void *getTarget()
.. cpp:member:: protected void *target_
29 changes: 28 additions & 1 deletion docs/dyninstAPI/public/BPatch_instruction.h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,39 @@
BPatch_instruction.h
####################

.. cpp:class:: BPatch_instruction

.. cpp:member:: static const unsigned int nmaxacc_NP

maximum number of memory accesses per instruction platform dependent

.. cpp:function:: BPatch_instruction(internal_instruction *insn, Dyninst::Address _addr)
.. cpp:function:: virtual ~BPatch_instruction()
.. cpp:function:: void getInstruction(const unsigned char *&_buffer, unsigned char &_length)
.. cpp:function:: BPatch_point * getInstPoint()
.. cpp:function:: BPatch_basicBlock * getParent()
.. cpp:function:: void * getAddress()
.. cpp:function:: bool equals(const BPatch_instruction* mp) const
.. cpp:function:: bool equals(const BPatch_instruction& rp) const
.. cpp:function:: bool hasALoad() const
.. cpp:function:: bool hasAStore() const
.. cpp:function:: bool hasAPrefetch_NP() const
.. cpp:function:: unsigned int getNumberOfAccesses() const
.. cpp:function:: bool isALoad(int which = 0) const
.. cpp:function:: bool isAStore(int which = 0) const
.. cpp:function:: bool isAPrefetch_NP(int which = 0) const
.. cpp:function:: bool isConditional_NP(int which = 0) const
.. cpp:function:: bool isNonTemporal_NP(int which = 0) const
.. cpp:function:: int prefetchType_NP(int which = 0) const
.. cpp:function:: int conditionCode_NP(int which = 0) const


.. cpp:class:: BPatch_register
A **BPatch_register** represents a single register of the mutatee. The
list of BPatch_registers can be retrieved with the
BPatch_addressSpace::getRegisters method.

.. cpp:function:: std::string name()
.. cpp:function:: std::string name() const

This function returns the canonical name of the register.
9 changes: 3 additions & 6 deletions dyninstAPI/h/BPatch_instruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class BPATCH_DLL_EXPORT BPatch_instruction {
friend class BPatch_basicBlock;

public:
// maximum number of memory accesses per instruction; platform dependent
static const unsigned int nmaxacc_NP;

protected:
Expand All @@ -58,10 +57,9 @@ class BPATCH_DLL_EXPORT BPatch_instruction {
internal_instruction *insn_;
bool *isLoad;
bool *isStore;
int *preFcn; // prefetch function (-1 = none)
int *condition; // -1 means no condition, all other values are machine specific
// conditions, currently (8/13/02) the tttn field on x86
bool *nonTemporal; // non-temporal (cache non-polluting) write on x86
int *preFcn;
int *condition;
bool *nonTemporal;

BPatch_basicBlock *parent;
long unsigned int addr;
Expand All @@ -75,7 +73,6 @@ class BPATCH_DLL_EXPORT BPatch_instruction {

internal_instruction *insn();

// Not yet implemented
char *getMnemonic() const { return NULL; }

BPatch_point * getInstPoint();
Expand Down

0 comments on commit aace4cb

Please sign in to comment.