Search in sources :

Example 1 with TracedRegionVisitor

use of jadx.core.dex.visitors.regions.TracedRegionVisitor in project jadx by skylot.

the class DebugUtils method printRegionsWithBlock.

public static void printRegionsWithBlock(MethodNode mth, final BlockNode block) {
    final Set<IRegion> regions = new LinkedHashSet<IRegion>();
    DepthRegionTraversal.traverse(mth, new TracedRegionVisitor() {

        @Override
        public void processBlockTraced(MethodNode mth, IBlock container, IRegion currentRegion) {
            if (block.equals(container)) {
                regions.add(currentRegion);
            }
        }
    });
    LOG.debug(" Found block: {} in regions: {}", block, regions);
}
Also used : LinkedHashSet(java.util.LinkedHashSet) IBlock(jadx.core.dex.nodes.IBlock) MethodNode(jadx.core.dex.nodes.MethodNode) TracedRegionVisitor(jadx.core.dex.visitors.regions.TracedRegionVisitor) IRegion(jadx.core.dex.nodes.IRegion)

Aggregations

IBlock (jadx.core.dex.nodes.IBlock)1 IRegion (jadx.core.dex.nodes.IRegion)1 MethodNode (jadx.core.dex.nodes.MethodNode)1 TracedRegionVisitor (jadx.core.dex.visitors.regions.TracedRegionVisitor)1 LinkedHashSet (java.util.LinkedHashSet)1