Package soot

Class UnitPatchingChain

  • All Implemented Interfaces:
    Serializable, Iterable<Unit>, Collection<Unit>, Chain<Unit>
    Direct Known Subclasses:
    SPatchingChain

    public class UnitPatchingChain
    extends PatchingChain<Unit>
    Although the Patching Chain is meant to only work for units, it can also work with certain subclasses of units. However, for insertOnEdge and similar operations, new Jimple statements have to be generated. As such, it might be the case that a PatchingChain<X extends Unit> is not allowed to contain such new statements, since they are not a subclass of X. Therefore, we decided to create a chain specifically for units, where we can be certain that they are allowed to contain all kind of units. Feel free to go and grab a beer.
    See Also:
    Serialized Form
    • Constructor Detail

      • UnitPatchingChain

        public UnitPatchingChain​(Chain<Unit> aChain)
    • Method Detail

      • insertOnEdge

        public void insertOnEdge​(Collection<? extends Unit> toInsert,
                                 Unit point_src,
                                 Unit point_tgt)
        Inserts instrumentation in a manner such that the resulting control flow graph (CFG) of the program will contain toInsert on an edge that is defined by point_source and point_target.
        Parameters:
        toInsert - instrumentation to be added in the Chain
        point_src - the source point of an edge in CFG
        point_tgt - the target point of an edge
      • insertOnEdge

        public void insertOnEdge​(List<Unit> toInsert,
                                 Unit point_src,
                                 Unit point_tgt)
        Inserts instrumentation in a manner such that the resulting control flow graph (CFG) of the program will contain toInsert on an edge that is defined by point_source and point_target.
        Parameters:
        toInsert - instrumentation to be added in the Chain
        point_src - the source point of an edge in CFG
        point_tgt - the target point of an edge
      • insertOnEdge

        public void insertOnEdge​(Chain<Unit> toInsert,
                                 Unit point_src,
                                 Unit point_tgt)
        Inserts instrumentation in a manner such that the resulting control flow graph (CFG) of the program will contain toInsert on an edge that is defined by point_source and point_target.
        Parameters:
        toInsert - instrumentation to be added in the Chain
        point_src - the source point of an edge in CFG
        point_tgt - the target point of an edge
      • insertOnEdge

        public void insertOnEdge​(Unit toInsert,
                                 Unit point_src,
                                 Unit point_tgt)
        Inserts instrumentation in a manner such that the resulting control flow graph (CFG) of the program will contain toInsert on an edge that is defined by point_source and point_target.
        Parameters:
        toInsert - the instrumentation to be added in the Chain
        point_src - the source point of an edge in CFG
        point_tgt - the target point of an edge