• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java JIdentityStmt类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中soot.jimple.internal.JIdentityStmt的典型用法代码示例。如果您正苦于以下问题:Java JIdentityStmt类的具体用法?Java JIdentityStmt怎么用?Java JIdentityStmt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

JIdentityStmt类属于soot.jimple.internal包,在下文中一共展示了JIdentityStmt类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: toFIString

点赞 2

import soot.jimple.internal.JIdentityStmt; //导入依赖的package包/类
@Override
public String toFIString(Unit u) {		 
    StringBuilder sb = new StringBuilder();
    boolean printId = Utils.buildBoolProperty("petablox.printrel.printID", false);
    if (printId) sb.append("(" + indexOf(u) + ")");
    String type;
    if(u instanceof JAssignStmt)
        type = "Assign";
    else if(u instanceof JBreakpointStmt)
        type = "Breakpoint";
    else if(u instanceof JGotoStmt)
        type = "Goto";
    else if(u instanceof JIfStmt) 
        type = "If";
    else if(u instanceof JIdentityStmt) 
        type = "Identity";
    else if(u instanceof JInvokeStmt) 
        type = "Invoke";
    else if(u instanceof JLookupSwitchStmt) 
        type = "LookupSwitch";
    else if(u instanceof JNopStmt)
        type = "Nop";
    else if(u instanceof JRetStmt) 
        type = "Return";
    else if(u instanceof JTableSwitchStmt) 
        type = "TablelSwitch";
    else if(u instanceof JThrowStmt) 
        type = "Throw";
    else
        type = "Other";
    sb.append(type);
    sb.append(": " + SootUtilities.getMethod(u).getName() + "@" + SootUtilities.getMethod(u).getDeclaringClass().getName());
    return sb.toString();
}
 

开发者ID:petablox-project,
项目名称:petablox,
代码行数:35,
代码来源:DomP.java

示例2: instrument

点赞 2

import soot.jimple.internal.JIdentityStmt; //导入依赖的package包/类
public static void instrument() {
        Util.LOGGER.info("Start instrumenting...");

        Scene.v().loadNecessaryClasses();
        final SootClass helperClass = Scene.v().getSootClass("xyz.ylimit.androcov.CoverageHelper");
        final SootMethod helperMethod = helperClass.getMethodByName("reach");

        PackManager.v().getPack("jtp").add(new Transform("jtp.androcov", new BodyTransformer() {
            @Override
            protected void internalTransform(final Body b, String phaseName, @SuppressWarnings("rawtypes") Map options) {
                final PatchingChain units = b.getUnits();
                // important to use snapshotIterator here
                if (b.getMethod().getDeclaringClass() == helperClass) return;
                String methodSig = b.getMethod().getSignature();
                allMethods.add(methodSig);

                // perform instrumentation here
                for(Iterator iter = units.snapshotIterator(); iter.hasNext();) {
                    final Unit u = (Unit) iter.next();
//                    // insert before return statements
//                    if (u instanceof ReturnStmt || u instanceof RetStmt || u instanceof ReturnVoidStmt) {
//                        InvokeStmt logStatement = Jimple.v().newInvokeStmt(
//                                Jimple.v().newStaticInvokeExpr(helperMethod.makeRef(), StringConstant.v(methodSig)));
//                        units.insertBefore(logStatement, u);
//                    }
                    // insert before the first non-identity statement
                    if (!(u instanceof JIdentityStmt)) {
                        InvokeStmt logStatement = Jimple.v().newInvokeStmt(
                                Jimple.v().newStaticInvokeExpr(helperMethod.makeRef(), StringConstant.v(methodSig)));
                        units.insertBefore(logStatement, u);
                        break;
                    }
                }
                b.validate();
            }
        }));
        PackManager.v().runPacks();
        PackManager.v().writeOutput();
        if (new File(Config.outputAPKPath).exists()) {
            Util.LOGGER.info("finish instrumenting");
            Util.signAPK(Config.outputAPKPath);
            Util.LOGGER.info("finish signing");
            Util.LOGGER.info("instrumented apk: " + Config.outputAPKPath);
        }
        else {
            Util.LOGGER.warning("error instrumenting");
        }
    }
 

开发者ID:ylimit,
项目名称:androcov,
代码行数:49,
代码来源:Instrumenter.java

示例3: visitIdendityInsts

点赞 2

import soot.jimple.internal.JIdentityStmt; //导入依赖的package包/类
private void visitIdendityInsts(JIdentityStmt s) {
    if (identityVisitors != null) {
        for (IIdentityInstVisitor v : identityVisitors)
            v.visit(s);
    }
}
 

开发者ID:petablox-project,
项目名称:petablox,
代码行数:7,
代码来源:VisitorHandler.java

示例4: visit

点赞 2

import soot.jimple.internal.JIdentityStmt; //导入依赖的package包/类
public void visit(JIdentityStmt s) {
    add(s, s.getLeftOp(), s.getRightOp());
}
 

开发者ID:petablox-project,
项目名称:petablox,
代码行数:4,
代码来源:RelIdentityInst.java

示例5: visit

点赞 1

import soot.jimple.internal.JIdentityStmt; //导入依赖的package包/类
public void visit(JIdentityStmt s); 

开发者ID:petablox-project,
项目名称:petablox,
代码行数:2,
代码来源:IIdentityInstVisitor.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)