mirror of
https://github.com/revanced/smali.git
synced 2025-05-04 16:44:25 +02:00
Print verbose errors in the tree walker
This commit is contained in:
parent
a59fe7e523
commit
d317a0679d
@ -52,6 +52,11 @@ import org.jf.dexlib.Code.Format.*;
|
|||||||
@members {
|
@members {
|
||||||
public DexFile dexFile;
|
public DexFile dexFile;
|
||||||
public TypeIdItem classType;
|
public TypeIdItem classType;
|
||||||
|
private boolean verboseErrors = false;
|
||||||
|
|
||||||
|
public void setVerboseErrors(boolean verboseErrors) {
|
||||||
|
this.verboseErrors = verboseErrors;
|
||||||
|
}
|
||||||
|
|
||||||
private byte parseRegister_nibble(String register, int totalMethodRegisters, int methodParameterRegisters)
|
private byte parseRegister_nibble(String register, int totalMethodRegisters, int methodParameterRegisters)
|
||||||
throws SemanticException {
|
throws SemanticException {
|
||||||
@ -141,11 +146,13 @@ smali_file
|
|||||||
classDataItem, $fields.staticFieldInitialValues);
|
classDataItem, $fields.staticFieldInitialValues);
|
||||||
};
|
};
|
||||||
catch [Exception ex] {
|
catch [Exception ex] {
|
||||||
|
if (verboseErrors) {
|
||||||
|
ex.printStackTrace(System.err);
|
||||||
|
}
|
||||||
reportError(new SemanticException(input, ex));
|
reportError(new SemanticException(input, ex));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
header returns[TypeIdItem classType, int accessFlags, TypeIdItem superType, TypeListItem implementsList, StringIdItem sourceSpec]
|
header returns[TypeIdItem classType, int accessFlags, TypeIdItem superType, TypeListItem implementsList, StringIdItem sourceSpec]
|
||||||
: class_spec super_spec? implements_list source_spec
|
: class_spec super_spec? implements_list source_spec
|
||||||
{
|
{
|
||||||
|
@ -318,7 +318,7 @@ public class main {
|
|||||||
treeStream.setTokenStream(tokens);
|
treeStream.setTokenStream(tokens);
|
||||||
|
|
||||||
smaliTreeWalker dexGen = new smaliTreeWalker(treeStream);
|
smaliTreeWalker dexGen = new smaliTreeWalker(treeStream);
|
||||||
|
dexGen.setVerboseErrors(verboseErrors);
|
||||||
dexGen.dexFile = dexFile;
|
dexGen.dexFile = dexFile;
|
||||||
dexGen.smali_file();
|
dexGen.smali_file();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user