show method index for debugging

This commit is contained in:
honfika@gmail.com
2015-11-28 12:29:07 +01:00
parent 51bdb9e698
commit 568f41b45e
3 changed files with 12 additions and 8 deletions

View File

@@ -17,7 +17,6 @@
package com.jpexs.decompiler.flash.abc.avm2.model;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.types.ConvertData;
import com.jpexs.decompiler.flash.abc.types.MethodBody;
import com.jpexs.decompiler.flash.configuration.Configuration;
@@ -25,7 +24,8 @@ import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.flash.helpers.NulWriter;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.decompiler.graph.GraphTargetItem;import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.ScopeStack;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
@@ -49,7 +49,7 @@ public class NewFunctionAVM2Item extends AVM2Item {
public int methodIndex;
public NewFunctionAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, String functionName, String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, List<DottedChain> fullyQualifiedNames, int methodIndex) {
public NewFunctionAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, String functionName, String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, List<DottedChain> fullyQualifiedNames, int methodIndex) {
super(instruction, lineStartIns, PRECEDENCE_PRIMARY);
this.functionName = functionName;
this.path = path;
@@ -71,8 +71,10 @@ public class NewFunctionAVM2Item extends AVM2Item {
abc.method_info.get(methodIndex).getParamStr(writer, abc.constants, body, abc, fullyQualifiedNames);
writer.appendNoHilight("):");
if (Configuration.showMethodBodyId.get()) {
writer.appendNoHilight("// method body id: ");
writer.appendNoHilight("// method body index: ");
writer.appendNoHilight(abc.findBodyIndex(methodIndex));
writer.appendNoHilight(" method index: ");
writer.appendNoHilight(methodIndex);
writer.newLine();
}
abc.method_info.get(methodIndex).getReturnTypeStr(writer, abc.constants, fullyQualifiedNames);

View File

@@ -360,8 +360,10 @@ public final class MethodBody implements Cloneable {
HashMap<Integer, String> localRegNames = getLocalRegNames(abc);
//writer.startMethod(this.method_info);
if (Configuration.showMethodBodyId.get()) {
writer.appendNoHilight("// method body id: ");
writer.appendNoHilight("// method body index: ");
writer.appendNoHilight(abc.findBodyIndex(this.method_info));
writer.appendNoHilight(" method index: ");
writer.appendNoHilight(this.method_info);
writer.newLine();
}
Graph.graphToString(convertedItems, writer, LocalData.create(abc.constants, localRegNames, fullyQualifiedNames));

View File

@@ -19,7 +19,6 @@ package com.jpexs.decompiler.flash.abc.types.traits;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.model.NewFunctionAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.parser.script.FunctionAVM2Item;
import com.jpexs.decompiler.flash.abc.types.AssignedValue;
import com.jpexs.decompiler.flash.abc.types.ConvertData;
import com.jpexs.decompiler.flash.abc.types.Multiname;
@@ -106,8 +105,10 @@ public class TraitSlotConst extends Trait implements TraitWithSlot {
writer.startTrait(assignment.initializer);
writer.startMethod(assignment.method);
if (Configuration.showMethodBodyId.get()) {
writer.appendNoHilight("// method body id: ");
writer.appendNoHilight("// method body index: ");
writer.appendNoHilight(abc.findBodyIndex(assignment.method));
writer.appendNoHilight(" method index: ");
writer.appendNoHilight(assignment.method);
writer.newLine();
}
@@ -199,5 +200,4 @@ public class TraitSlotConst extends Trait implements TraitWithSlot {
super.getImportsUsages(customNs, abc, imports, uses, ignorePackage, fullyQualifiedNames);
parseImportsUsagesFromMultiname(customNs, abc, imports, uses, abc.constants.getMultiname(type_index), getPackage(abc), fullyQualifiedNames);
}
}