Skip to content

Commit

Permalink
Update parseAPI/h/InstructionAdapter.h
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Apr 3, 2024
1 parent 27811a8 commit b57352a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 7 additions & 0 deletions docs/parseAPI/public/InstructionAdapter.h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ InstructionAdapter.h
.. cpp:function:: void reset(Address start, ParseAPI::CodeObject *o, ParseAPI::CodeRegion *r,\
InstructionSource *isrc, ParseAPI::Block *)

Reset to just-constructed state

.. cpp:function:: virtual const InstructionAPI::Instruction& getInstruction() const = 0
.. cpp:function:: virtual bool hasCFT() const = 0
.. cpp:function:: virtual size_t getSize() const = 0
Expand All @@ -38,6 +40,8 @@ InstructionAdapter.h
.. cpp:function:: virtual bool isAbort() const = 0
.. cpp:function:: virtual bool isGarbageInsn() const = 0

True for insns indicative of bad parse, for defensive mode

.. cpp:function:: virtual void getNewEdges(std::vector<std::pair<Address,ParseAPI::EdgeTypeEnum>>& outEdges,\
ParseAPI::Function* context, ParseAPI::Block* currBlk,unsigned int num_insns,\
dyn_hash_map<Address, std::string> *pltFuncs, const std::set<Address> &) const = 0
Expand Down Expand Up @@ -70,6 +74,9 @@ InstructionAdapter.h
.. cpp:function:: virtual bool isInterruptOrSyscall() const = 0
.. cpp:function:: virtual bool isCall() const = 0
.. cpp:function:: virtual bool isReturnAddrSave(Address &ret_addr) const = 0

Ret_addr holds the return address pushed in the stack using mflr at function entry.

.. cpp:function:: virtual bool isTailCall(const ParseAPI::Function *, ParseAPI::EdgeTypeEnum type, unsigned int num_insns,\
const std::set<Address> &) const = 0

6 changes: 2 additions & 4 deletions parseAPI/h/InstructionAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,16 @@ class InstructionAdapter
virtual ~InstructionAdapter() = default;
InstructionAdapter(const InstructionAdapter&) = default;

// Reset to just-constructed state
void reset(Address start, ParseAPI::CodeObject *o,
ParseAPI::CodeRegion *r, InstructionSource *isrc, ParseAPI::Block *);

// Implemented
virtual const InstructionAPI::Instruction& getInstruction() const = 0;
virtual bool hasCFT() const = 0;
virtual size_t getSize() const = 0;
virtual bool isFrameSetupInsn() const = 0;
virtual bool isInvalidInsn() const = 0;
virtual bool isAbort() const = 0;
virtual bool isGarbageInsn() const = 0; //true for insns indicative of bad parse, for defensive mode
virtual bool isGarbageInsn() const = 0;
virtual void
getNewEdges(std::vector<std::pair<Address,ParseAPI::EdgeTypeEnum> >&
outEdges,
Expand Down Expand Up @@ -111,7 +109,7 @@ const;
virtual bool isBranch() const = 0;
virtual bool isInterruptOrSyscall() const = 0;
virtual bool isCall() const = 0;
virtual bool isReturnAddrSave(Address &ret_addr) const = 0; // ret_addr holds the return address pushed in the stack using mflr at function entry
virtual bool isReturnAddrSave(Address &ret_addr) const = 0;
virtual bool isTailCall(const ParseAPI::Function *, ParseAPI::EdgeTypeEnum type, unsigned int num_insns,
const std::set<Address> &) const = 0;
protected:
Expand Down

0 comments on commit b57352a

Please sign in to comment.