类 JsonPrinter
- java.lang.Object
-
- proguard.evaluation.util.jsonprinter.JsonPrinter
-
- 所有已实现的接口:
PartialEvaluatorStateTracker
public class JsonPrinter extends java.lang.Object implements PartialEvaluatorStateTracker
Tracks the state of the partial evaluator able to provide debug information in JSON format.
-
-
构造器概要
构造器 构造器 说明 JsonPrinter()JsonPrinter(Clazz clazzFilter)JsonPrinter(Clazz clazzFilter, Method methodFilter)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidendSubroutine(Clazz clazz, Method method, TracedVariables variablesAfter, TracedStack stackAfter, int subroutineStart, int subroutineEnd)The evaluation and generalization of the subroutine is done, the partial evaluator moves on.voidevaluationResults(Clazz clazz, Method method, CodeAttribute codeAttribute, PartialEvaluator evaluator)Partial evaluator is done evaluating the code attribute.voidgeneralizeInstructionBlock(Clazz clazz, Method method, int instructionOffset, Instruction instruction, TracedVariables variablesBefore, TracedStack stackBefore, int evaluationCount)The instruction has been seen a certain number of times and the evaluator deems it time to start generalizing the instruction.java.lang.StringgetJson()voidprintState()voidregisterAlternativeBranch(Clazz clazz, Method method, int fromInstructionOffset, Instruction fromInstruction, TracedVariables variablesAfter, TracedStack stackAfter, int branchIndex, int branchTargetCount, int offset)The evaluator detects multiple branches need to be evaluated.voidregisterException(Clazz clazz, Method method, CodeAttribute codeAttribute, PartialEvaluator evaluator, java.lang.Throwable cause)An exception has been thrown while evaluating the current code attribute.voidregisterExceptionHandler(Clazz clazz, Method method, int startPC, int endPC, ExceptionInfo info)Partial evaluator starts evaluating a specific exception handler.voidregisterSubroutineReturn(Clazz clazz, Method method, int returnOffset, TracedVariables returnVariables, TracedStack returnStack)The current instruction was RET and the partial evaluator pushes the return address to the branch stack of the calling partial evaluator.voidskipInstructionBlock(Clazz clazz, Method method, int instructionOffset, Instruction instruction, TracedVariables variablesBefore, TracedStack stackBefore, int evaluationCount)The instruction within this instruction block has been seen with the those variables and this stack, and thus it is not needed to evaluate this block any further.voidstartCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, Variables parameters)The partial evaluator starts with the evaluation of a code block.voidstartInstructionBlock(Clazz clazz, Method method, CodeAttribute codeAttribute, TracedVariables startVariables, TracedStack startStack, int startOffset)Partial evaluator starts evaluating an instruction block, specified by an instruction range within the code attribute and the variables and stack it would start with.voidstartInstructionEvaluation(Clazz clazz, Method method, int instructionOffset, Instruction instruction, TracedVariables variablesBefore, TracedStack stackBefore, int evaluationCount)The partial evaluator will forward the evaluation of the instruction.voidstartSubroutine(Clazz clazz, Method method, TracedVariables startVariables, TracedStack startStack, int subroutineStart, int subroutineEnd)The current instruction was JSR or JSR_W and the partial evaluator starts with the evaluation of the subroutine.voidwriteState(java.lang.String fileName)
-
-
-
方法详细资料
-
getJson
public java.lang.String getJson()
-
printState
public void printState()
-
writeState
public void writeState(java.lang.String fileName)
-
startCodeAttribute
public void startCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, Variables parameters)
从接口复制的说明:PartialEvaluatorStateTrackerThe partial evaluator starts with the evaluation of a code block.
-
registerException
public void registerException(Clazz clazz, Method method, CodeAttribute codeAttribute, PartialEvaluator evaluator, java.lang.Throwable cause)
从接口复制的说明:PartialEvaluatorStateTrackerAn exception has been thrown while evaluating the current code attribute.
-
registerExceptionHandler
public void registerExceptionHandler(Clazz clazz, Method method, int startPC, int endPC, ExceptionInfo info)
从接口复制的说明:PartialEvaluatorStateTrackerPartial evaluator starts evaluating a specific exception handler.
-
evaluationResults
public void evaluationResults(Clazz clazz, Method method, CodeAttribute codeAttribute, PartialEvaluator evaluator)
从接口复制的说明:PartialEvaluatorStateTrackerPartial evaluator is done evaluating the code attribute. You can extract the results straight from the evaluator.
-
startInstructionBlock
public void startInstructionBlock(Clazz clazz, Method method, CodeAttribute codeAttribute, TracedVariables startVariables, TracedStack startStack, int startOffset)
从接口复制的说明:PartialEvaluatorStateTrackerPartial evaluator starts evaluating an instruction block, specified by an instruction range within the code attribute and the variables and stack it would start with.
-
skipInstructionBlock
public void skipInstructionBlock(Clazz clazz, Method method, int instructionOffset, Instruction instruction, TracedVariables variablesBefore, TracedStack stackBefore, int evaluationCount)
从接口复制的说明:PartialEvaluatorStateTrackerThe instruction within this instruction block has been seen with the those variables and this stack, and thus it is not needed to evaluate this block any further.
-
generalizeInstructionBlock
public void generalizeInstructionBlock(Clazz clazz, Method method, int instructionOffset, Instruction instruction, TracedVariables variablesBefore, TracedStack stackBefore, int evaluationCount)
从接口复制的说明:PartialEvaluatorStateTrackerThe instruction has been seen a certain number of times and the evaluator deems it time to start generalizing the instruction.
-
startInstructionEvaluation
public void startInstructionEvaluation(Clazz clazz, Method method, int instructionOffset, Instruction instruction, TracedVariables variablesBefore, TracedStack stackBefore, int evaluationCount)
从接口复制的说明:PartialEvaluatorStateTrackerThe partial evaluator will forward the evaluation of the instruction. An exception right after this state is likely.
-
registerAlternativeBranch
public void registerAlternativeBranch(Clazz clazz, Method method, int fromInstructionOffset, Instruction fromInstruction, TracedVariables variablesAfter, TracedStack stackAfter, int branchIndex, int branchTargetCount, int offset)
从接口复制的说明:PartialEvaluatorStateTrackerThe evaluator detects multiple branches need to be evaluated. It adds these block evaluations to a stack of blocks that still need to be evaluated. After all branches have been registered, the evaluator exits the evaluation of the current instruction block.
-
startSubroutine
public void startSubroutine(Clazz clazz, Method method, TracedVariables startVariables, TracedStack startStack, int subroutineStart, int subroutineEnd)
从接口复制的说明:PartialEvaluatorStateTrackerThe current instruction was JSR or JSR_W and the partial evaluator starts with the evaluation of the subroutine.- 指定者:
startSubroutine在接口中PartialEvaluatorStateTracker
-
registerSubroutineReturn
public void registerSubroutineReturn(Clazz clazz, Method method, int returnOffset, TracedVariables returnVariables, TracedStack returnStack)
从接口复制的说明:PartialEvaluatorStateTrackerThe current instruction was RET and the partial evaluator pushes the return address to the branch stack of the calling partial evaluator.
-
endSubroutine
public void endSubroutine(Clazz clazz, Method method, TracedVariables variablesAfter, TracedStack stackAfter, int subroutineStart, int subroutineEnd)
从接口复制的说明:PartialEvaluatorStateTrackerThe evaluation and generalization of the subroutine is done, the partial evaluator moves on.- 指定者:
endSubroutine在接口中PartialEvaluatorStateTracker
-
-