Add codeAddress field to AnalysisException

This commit is contained in:
Ben Gruver 2013-04-07 20:26:33 -07:00
parent e3478f4fd4
commit 77ebf6842f
2 changed files with 3 additions and 0 deletions

View File

@ -34,6 +34,8 @@ package org.jf.dexlib2.analysis;
import org.jf.util.ExceptionWithContext;
public class AnalysisException extends ExceptionWithContext {
public int codeAddress;
public AnalysisException(Throwable cause) {
super(cause);
}

View File

@ -202,6 +202,7 @@ public class MethodAnalyzer {
} catch (AnalysisException ex) {
this.analysisException = ex;
int codeAddress = getInstructionAddress(instructionToAnalyze);
ex.codeAddress = codeAddress;
ex.addContext(String.format("opcode: %s", instructionToAnalyze.instruction.getOpcode().name));
ex.addContext(String.format("code address: %d", codeAddress));
ex.addContext(String.format("method: %s", ReferenceUtil.getReferenceString(method)));