print line numbers

This commit is contained in:
GraxCode 2022-03-13 14:25:15 +01:00
parent e8bf1f5cd7
commit 21c6f1ef47
1 changed files with 7 additions and 7 deletions

View File

@ -117,7 +117,7 @@ public class InstructionPrinter {
info.add("}"); info.add("}");
return info; return info;
} }
public String printInstruction(AbstractInsnNode ain) public String printInstruction(AbstractInsnNode ain)
{ {
String line = ""; String line = "";
@ -136,15 +136,15 @@ public class InstructionPrinter {
} else if (ain instanceof JumpInsnNode) { } else if (ain instanceof JumpInsnNode) {
line = printJumpInsnNode((JumpInsnNode) ain); line = printJumpInsnNode((JumpInsnNode) ain);
} else if (ain instanceof LineNumberNode) { } else if (ain instanceof LineNumberNode) {
line = printLineNumberNode(); line = printLineNumberNode((LineNumberNode) ain);
} else if (ain instanceof LabelNode) { } else if (ain instanceof LabelNode) {
if (firstLabel if (firstLabel
&& BytecodeViewer.viewer.appendBracketsToLabels && BytecodeViewer.viewer.appendBracketsToLabels
.isSelected()) .isSelected())
info.add("}"); info.add("}");
line = printLabelnode((LabelNode) ain); line = printLabelnode((LabelNode) ain);
if (BytecodeViewer.viewer.appendBracketsToLabels.isSelected()) { if (BytecodeViewer.viewer.appendBracketsToLabels.isSelected()) {
if (!firstLabel) if (!firstLabel)
firstLabel = true; firstLabel = true;
@ -168,7 +168,7 @@ public class InstructionPrinter {
line += "UNADDED OPCODE: " + nameOpcode(ain.getOpcode()) + " " line += "UNADDED OPCODE: " + nameOpcode(ain.getOpcode()) + " "
+ ain; + ain;
} }
return line; return line;
} }
@ -245,8 +245,8 @@ public class InstructionPrinter {
+ resolveLabel(jin.label); + resolveLabel(jin.label);
} }
protected String printLineNumberNode() { protected String printLineNumberNode(LineNumberNode lnn) {
return ""; return "// line " + lnn.line;
} }
protected String printLabelnode(LabelNode label) { protected String printLabelnode(LabelNode label) {