Package soot

Class AbstractTrap

    • Field Detail

      • exception

        protected transient SootClass exception
        The exception being caught.
      • beginUnitBox

        protected UnitBox beginUnitBox
        The first unit being trapped.
      • endUnitBox

        protected UnitBox endUnitBox
        The unit just before the last unit being trapped.
      • handlerUnitBox

        protected UnitBox handlerUnitBox
        The unit to which execution flows after the caught exception is triggered.
      • unitBoxes

        protected List<UnitBox> unitBoxes
        The list of UnitBoxes referred to in this Trap (begin, end, and handler).
    • Constructor Detail

      • AbstractTrap

        protected AbstractTrap​(SootClass exception,
                               UnitBox beginUnitBox,
                               UnitBox endUnitBox,
                               UnitBox handlerUnitBox)
        Creates an AbstractTrap with the given exception, handler, begin, and end units.
    • Method Detail

      • getBeginUnit

        public Unit getBeginUnit()
        Description copied from interface: Trap

        Returns the first trapped unit, unless this Trap does not trap any units at all.

        If this is a degenerate Trap which traps no units (which can occur if all the units originally trapped by the exception handler have been optimized away), returns an untrapped unit. The returned unit will likely be the first unit remaining after the point where the trapped units were once located, but the only guarantee provided is that for such an empty trap, getBeginUnit() will return the same value as Trap.getEndUnit().

        Specified by:
        getBeginUnit in interface Trap
      • getEndUnit

        public Unit getEndUnit()
        Description copied from interface: Trap

        Returns the unit following the last trapped unit (that is, the first succeeding untrapped unit in the underlying Chain), unless this Trap does not trap any units at all.

        In the case of a degenerate Trap which traps no units, returns the same untrapped unit as getBeginUnit()

        Note that a weakness of marking the end of the trapped region with the first untrapped unit is that Soot has no good mechanism for describing a Trap which traps the last unit in a method.

        Specified by:
        getEndUnit in interface Trap
      • getHandlerUnit

        public Unit getHandlerUnit()
        Description copied from interface: Trap
        Returns the unit handling the exception being trapped.
        Specified by:
        getHandlerUnit in interface Trap
      • getHandlerUnitBox

        public UnitBox getHandlerUnitBox()
        Description copied from interface: Trap
        Returns the box holding the exception handler unit.
        Specified by:
        getHandlerUnitBox in interface Trap
      • getException

        public SootClass getException()
        Description copied from interface: Trap
        Returns the exception being caught.
        Specified by:
        getException in interface Trap
      • setBeginUnit

        public void setBeginUnit​(Unit beginUnit)
        Description copied from interface: Trap
        Sets the value to be returned by Trap.getBeginUnit() to beginUnit.
        Specified by:
        setBeginUnit in interface Trap
      • setEndUnit

        public void setEndUnit​(Unit endUnit)
        Description copied from interface: Trap
        Sets the value to be returned by Trap.getEndUnit() to endUnit.
        Specified by:
        setEndUnit in interface Trap
      • setHandlerUnit

        public void setHandlerUnit​(Unit handlerUnit)
        Description copied from interface: Trap
        Sets the unit handling the exception to handlerUnit.
        Specified by:
        setHandlerUnit in interface Trap
      • setException

        public void setException​(SootClass exception)
        Description copied from interface: Trap
        Sets the exception being caught to exception.
        Specified by:
        setException in interface Trap
      • clone

        public Object clone()
        Description copied from interface: Trap
        Performs a shallow clone of this trap.
        Specified by:
        clone in interface Trap
        Overrides:
        clone in class Object