Search in sources :

Example 1 with DexDebugVisitor

use of com.googlecode.d2j.visitors.DexDebugVisitor in project dex2jar by pxb1988.

the class BaksmaliDumper method accept.

void accept(Out out, DexCodeNode code, DexCodeVisitor v) {
    if (code.tryStmts != null) {
        for (TryCatchNode n : code.tryStmts) {
            n.accept(v);
        }
    }
    if (code.debugNode != null) {
        DexDebugVisitor ddv = v.visitDebug();
        if (ddv != null) {
            code.debugNode.accept(ddv);
            ddv.visitEnd();
        }
    }
    if (code.totalRegister >= 0 && code.stmts.size() > 0) {
        v.visitRegister(code.totalRegister);
    }
    for (DexStmtNode n : code.stmts) {
        if (n instanceof DexLabelStmtNode) {
            n.accept(v);
        } else {
            out.push();
            n.accept(v);
            out.pop();
        }
    }
}
Also used : DexDebugVisitor(com.googlecode.d2j.visitors.DexDebugVisitor) DexStmtNode(com.googlecode.d2j.node.insn.DexStmtNode) DexLabelStmtNode(com.googlecode.d2j.node.insn.DexLabelStmtNode)

Example 2 with DexDebugVisitor

use of com.googlecode.d2j.visitors.DexDebugVisitor in project dex2jar by pxb1988.

the class Dex2IrAdapter method convert.

public IrMethod convert(DexCodeNode codeNode) {
    if (codeNode.tryStmts != null) {
        for (TryCatchNode n : codeNode.tryStmts) {
            n.accept(this);
        }
    }
    if (codeNode.debugNode != null) {
        DexDebugVisitor ddv = this.visitDebug();
        if (ddv != null) {
            codeNode.debugNode.accept(ddv);
            ddv.visitEnd();
        }
    }
    lastIsInvokeOrFilledNewArray = false;
    if (codeNode.totalRegister >= 0) {
        this.visitRegister(codeNode.totalRegister);
    }
    for (DexStmtNode n : codeNode.stmts) {
        n.accept(this);
        if (n instanceof FilledNewArrayStmtNode) {
            lastIsInvokeOrFilledNewArray = true;
        } else if (n instanceof MethodStmtNode) {
            lastIsInvokeOrFilledNewArray = !((MethodStmtNode) n).method.getReturnType().equals("V");
        } else if (!(n instanceof DexLabelStmtNode)) {
            lastIsInvokeOrFilledNewArray = false;
        }
    }
    visitEnd();
    return irMethod;
}
Also used : DexDebugVisitor(com.googlecode.d2j.visitors.DexDebugVisitor) MethodStmtNode(com.googlecode.d2j.node.insn.MethodStmtNode) TryCatchNode(com.googlecode.d2j.node.TryCatchNode) DexStmtNode(com.googlecode.d2j.node.insn.DexStmtNode) DexLabelStmtNode(com.googlecode.d2j.node.insn.DexLabelStmtNode) FilledNewArrayStmtNode(com.googlecode.d2j.node.insn.FilledNewArrayStmtNode)

Example 3 with DexDebugVisitor

use of com.googlecode.d2j.visitors.DexDebugVisitor in project dex2jar by pxb1988.

the class DexCodeNode method accept.

public void accept(DexCodeVisitor v) {
    if (tryStmts != null) {
        for (TryCatchNode n : tryStmts) {
            n.accept(v);
        }
    }
    if (debugNode != null) {
        DexDebugVisitor ddv = v.visitDebug();
        if (ddv != null) {
            debugNode.accept(ddv);
            ddv.visitEnd();
        }
    }
    if (totalRegister >= 0) {
        v.visitRegister(this.totalRegister);
    }
    for (DexStmtNode n : stmts) {
        n.accept(v);
    }
}
Also used : DexDebugVisitor(com.googlecode.d2j.visitors.DexDebugVisitor)

Aggregations

DexDebugVisitor (com.googlecode.d2j.visitors.DexDebugVisitor)3 DexLabelStmtNode (com.googlecode.d2j.node.insn.DexLabelStmtNode)2 DexStmtNode (com.googlecode.d2j.node.insn.DexStmtNode)2 TryCatchNode (com.googlecode.d2j.node.TryCatchNode)1 FilledNewArrayStmtNode (com.googlecode.d2j.node.insn.FilledNewArrayStmtNode)1 MethodStmtNode (com.googlecode.d2j.node.insn.MethodStmtNode)1