Description
A DESCRIPTION OF THE REQUEST :
I know this debug information is contained in the .class file when compiling with:
javac -g Main.java
and can be observed manually from the `LineNumberTable:` section of:
javap -c -constants -private -verbose '$<' > '$@'
What I want is to make `javap` display the source in the middle of the bytecode.
Sample input:
public class New {
public static void main(String[] args) {
System.out.println(new Integer(1));
}
}
Actual `javap` output:
0: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream;
3: new #3 // class java/lang/Integer
6: dup
7: iconst_1
8: invokespecial #4 // Method java/lang/Integer."<init>":(I)V
11: invokevirtual #5 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
14: return
LineNumberTable:
line 3: 0
line 4: 14
Desired javap output:
System.out.println(new Integer(1));
0: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream;
3: new #3 // class java/lang/Integer
6: dup
7: iconst_1
8: invokespecial #4 // Method java/lang/Integer."<init>":(I)V
11: invokevirtual #5 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
}
14: return
LineNumberTable:
line 3: 0
line 4: 14
JUSTIFICATION :
That would make it much easier to interpret `javap` output.
I know this debug information is contained in the .class file when compiling with:
javac -g Main.java
and can be observed manually from the `LineNumberTable:` section of:
javap -c -constants -private -verbose '$<' > '$@'
What I want is to make `javap` display the source in the middle of the bytecode.
Sample input:
public class New {
public static void main(String[] args) {
System.out.println(new Integer(1));
}
}
Actual `javap` output:
0: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream;
3: new #3 // class java/lang/Integer
6: dup
7: iconst_1
8: invokespecial #4 // Method java/lang/Integer."<init>":(I)V
11: invokevirtual #5 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
14: return
LineNumberTable:
line 3: 0
line 4: 14
Desired javap output:
System.out.println(new Integer(1));
0: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream;
3: new #3 // class java/lang/Integer
6: dup
7: iconst_1
8: invokespecial #4 // Method java/lang/Integer."<init>":(I)V
11: invokevirtual #5 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
}
14: return
LineNumberTable:
line 3: 0
line 4: 14
JUSTIFICATION :
That would make it much easier to interpret `javap` output.