1 /* This test should test the source location attribution. 2 We print the line number of different parts of the program to make sure 3 that the source code attribution is correct. 4 To make this test pass, one need to have up-to-date addr2line installed 5 to parse the dwarf4 data format. 6 */ 7 public class sourcelocation { main(String args[])8 public static void main(String args[]) { 9 try { 10 System.out.println(new Exception().getStackTrace()[0].getLineNumber()); 11 throw new Exception(); 12 } catch (Exception e) { 13 System.out.println(new Exception().getStackTrace()[0].getLineNumber()); 14 } finally { 15 System.out.println(new Exception().getStackTrace()[0].getLineNumber()); 16 } 17 } 18 } 19