From 21c6f1ef47418262b2f8311248173a7d0b77e34c Mon Sep 17 00:00:00 2001 From: GraxCode Date: Sun, 13 Mar 2022 14:25:15 +0100 Subject: [PATCH] print line numbers --- .../decompilers/bytecode/InstructionPrinter.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/InstructionPrinter.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/InstructionPrinter.java index 737fdd4b..7fbc44b8 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/InstructionPrinter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/InstructionPrinter.java @@ -117,7 +117,7 @@ public class InstructionPrinter { info.add("}"); return info; } - + public String printInstruction(AbstractInsnNode ain) { String line = ""; @@ -136,15 +136,15 @@ public class InstructionPrinter { } else if (ain instanceof JumpInsnNode) { line = printJumpInsnNode((JumpInsnNode) ain); } else if (ain instanceof LineNumberNode) { - line = printLineNumberNode(); + line = printLineNumberNode((LineNumberNode) ain); } else if (ain instanceof LabelNode) { if (firstLabel && BytecodeViewer.viewer.appendBracketsToLabels .isSelected()) info.add("}"); - + line = printLabelnode((LabelNode) ain); - + if (BytecodeViewer.viewer.appendBracketsToLabels.isSelected()) { if (!firstLabel) firstLabel = true; @@ -168,7 +168,7 @@ public class InstructionPrinter { line += "UNADDED OPCODE: " + nameOpcode(ain.getOpcode()) + " " + ain; } - + return line; } @@ -245,8 +245,8 @@ public class InstructionPrinter { + resolveLabel(jin.label); } - protected String printLineNumberNode() { - return ""; + protected String printLineNumberNode(LineNumberNode lnn) { + return "// line " + lnn.line; } protected String printLabelnode(LabelNode label) {