diff --git a/SDK_VERSION b/SDK_VERSION index 46b28261ca7b21304efd9aabd844eb36a54f24ed..b63ba696b7a7e4d89fa1517b02bfdccb2f1a10e1 100644 --- a/SDK_VERSION +++ b/SDK_VERSION @@ -1 +1 @@ -0.09j +0.9 diff --git a/include/private-include/constants.h b/include/private-include/constants.h deleted file mode 100644 index 4e09199d82a303049d06efc0edced929fe2bfb46..0000000000000000000000000000000000000000 --- a/include/private-include/constants.h +++ /dev/null @@ -1,9 +0,0 @@ - -namespace Zipr_SDK -{ - enum - { - DEFAULT_TRAMPOLINE_SIZE=5 - }; -}; - diff --git a/include/private-include/dollop.h b/include/private-include/dollop.h index 7f6ee5ef99712620b4d614cff1fc07174512cfa7..ea336d0f2433d76f30455cf7914f4668e92f997a 100644 --- a/include/private-include/dollop.h +++ b/include/private-include/dollop.h @@ -12,7 +12,6 @@ namespace Zipr_SDK using DollopEntryList_t = list<DollopEntry_t*>; - class Placeable_t { protected: @@ -27,21 +26,6 @@ namespace Zipr_SDK friend ostream &operator<<(ostream &, const Placeable_t &); }; - - class DollopPatch_t : virtual public Placeable_t - { - protected: - DollopPatch_t() { } - DollopPatch_t(const DollopPatch_t& copy) = delete; - public: - virtual ~DollopPatch_t() { } - - virtual Dollop_t* getTarget() const = 0 ; - virtual void setTarget(Dollop_t *target) = 0 ; - - friend ostream &operator<<(ostream &, const DollopPatch_t &); - }; - class DollopEntry_t : virtual public Placeable_t { protected: @@ -50,8 +34,8 @@ namespace Zipr_SDK public: virtual ~DollopEntry_t() { } - virtual void setTargetDollop(Dollop_t *target) = 0 ; - virtual void MemberOfDollop(Dollop_t *member_of) = 0 ; + virtual void setTargetDollop(Dollop_t *target) = 0 ; + virtual void MemberOfDollop(Dollop_t *member_of) = 0 ; virtual Instruction_t* getInstruction() const = 0 ; virtual Dollop_t* getTargetDollop() const = 0 ; diff --git a/include/private-include/dollop_man.h b/include/private-include/dollop_man.h index 6d2ecf96de0cd5e892e201e4a1e52686507bbb6f..17d0d4190af063ff47da301504e6f0f441de383e 100644 --- a/include/private-include/dollop_man.h +++ b/include/private-include/dollop_man.h @@ -11,8 +11,6 @@ namespace Zipr_SDK using DollopList_t = set<Dollop_t*>; using InsnToDollopMap_t = map<Instruction_t*,Dollop_t*>; - using DollopPatchList_t = list<DollopPatch_t*>; - using DollopToDollopPatchListMap_t = map<Dollop_t*, DollopPatchList_t >; class DollopManager_t @@ -29,6 +27,7 @@ namespace Zipr_SDK * to the dollop manager. */ virtual void addDollops(Dollop_t *dollop_head)=0; + /* * Create new dollops from a particular start instruction. */ @@ -44,16 +43,6 @@ namespace Zipr_SDK */ virtual Dollop_t *getContainingDollop( Instruction_t *insn)=0; - /* - * Add a dollop patch to the dollop manager. - */ - virtual void addDollopPatch(DollopPatch_t *new_patch) = 0; - /* - * Return all the patches that point to a particular - * dollop. - */ - virtual DollopPatchList_t getPatchesToDollop( Dollop_t *target)=0; - /* * Update the dollops under management based on the * targetted dollops in a particular dollop. @@ -74,26 +63,7 @@ namespace Zipr_SDK virtual DollopList_t::iterator dollops_begin() = 0; virtual DollopList_t::iterator dollops_end() = 0; - /* - * Print (for debugging) all the dollop patches - * under management. - */ - virtual void printDollopPatches(const ostream &) = 0; - - /* - * Print (useful output for end user) information about - * statistics of the dollop manager and the job it is - * doing. - */ - virtual void printStats(ostream &out) = 0; - - /* - * Generate a placement map file for all the dollops under management. - */ - virtual void printPlacementMap(const MemorySpace_t &memory_space, - const string &map_filename) = 0; - - /* helper */ + /* Figure out how much space an instruction will take */ virtual size_t determineDollopEntrySize(DollopEntry_t *entry)=0; /* diff --git a/include/private-include/options.h b/include/private-include/options.h index 4ccbf3aebb0aa0c4faee197ea6ac90971fafe981..2d702e8194559ca3a7a839a93907c6845fc212a0 100644 --- a/include/private-include/options.h +++ b/include/private-include/options.h @@ -36,12 +36,12 @@ namespace Zipr_SDK public: virtual ~ZiprTypedOption_t() { } + // Cast the option to it's type (e.g., string or bool) virtual T getValue() const = 0; virtual operator T() const = 0; }; - class ZiprStringOption_t : virtual public ZiprTypedOption_t<string> { protected: @@ -75,7 +75,6 @@ namespace Zipr_SDK }; - class ZiprDoubleOption_t : public ZiprTypedOption_t<double> { protected: @@ -115,5 +114,4 @@ namespace Zipr_SDK }; - } diff --git a/include/private-include/range.h b/include/private-include/range.h index 6c0e6a7bff3a0f83e9af8e699b4d993fdf45c9d9..87d63815bf17858f3b591165e95536290195994a 100644 --- a/include/private-include/range.h +++ b/include/private-include/range.h @@ -1,47 +1,38 @@ namespace Zipr_SDK { - using namespace std; + using RangeAddress_t = uintptr_t ; + // Note: Unlike other Zipr SDK classes, this is copyable, assignable, etc. + // i.e., this is not a pure virtual class. class Range_t { public: - Range_t(RangeAddress_t p_s, RangeAddress_t p_e) : m_start(p_s), m_end(p_e) { } - Range_t() : m_start(0), m_end(0) { } - virtual ~Range_t() {} - - virtual RangeAddress_t getStart() const { return m_start; } - virtual RangeAddress_t getEnd() const { return m_end; } - virtual void setStart(RangeAddress_t s) { m_start=s; } - virtual void setEnd(RangeAddress_t e) { m_end=e; } - - virtual bool is2ByteRange() - { - return (m_end - m_start) == 2; - }; - virtual bool is5ByteRange() - { - return (m_end - m_start) == 5; - }; - - virtual bool isInfiniteRange() - { - return m_end==(RangeAddress_t)-1; - }; + Range_t(RangeAddress_t p_s, RangeAddress_t p_e); + Range_t(); // zero init - protected: + virtual ~Range_t(); + virtual RangeAddress_t getStart() const; + virtual RangeAddress_t getEnd() const; + virtual bool is2ByteRange() const; + virtual bool is5ByteRange() const; + virtual bool isInfiniteRange() const; + + virtual void setStart(RangeAddress_t s); + virtual void setEnd(RangeAddress_t e); + + protected: RangeAddress_t m_start, m_end; }; + // useful for putting Range_t's in containers (sets, etc). struct Range_tCompare { - bool operator() (const Range_t first, const Range_t second) const - { - return first.getEnd() < second.getStart(); - } + // Caution! Only works for NON-OVERLAPPING ranges. + bool operator() (const Range_t first, const Range_t second) const; }; } diff --git a/include/private-include/zipr.h b/include/private-include/zipr.h index 38608e83db5dd283e382186bf403be106bc959ea..a91cd7d76a4977ec079825dbcbbf2b6992fa0cd5 100644 --- a/include/private-include/zipr.h +++ b/include/private-include/zipr.h @@ -26,19 +26,6 @@ namespace Zipr_SDK DollopEntry_t*, bool account_for_fallthrough) = 0; - virtual RangeAddress_t plopDollopEntry( - DollopEntry_t *, - RangeAddress_t = 0, - RangeAddress_t = 0) = 0; - - virtual RangeAddress_t plopDollopEntryWithTarget( - DollopEntry_t *, - RangeAddress_t = 0, - RangeAddress_t = 0) = 0; - - virtual RangeAddress_t plopDollopEntryWithCallback( - DollopEntry_t *, - RangeAddress_t = 0) = 0; virtual void applyPatch( RangeAddress_t from_addr, RangeAddress_t to_addr) = 0;