Summary: | Eclipse compiler produces incomplete debug info for variables | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Dmitri Maximovich <maxim> |
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | major | ||
Priority: | P3 | CC: | ekuleshov, philippe_mulet |
Version: | 3.2 | ||
Target Milestone: | 3.2 M5 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Dmitri Maximovich
2006-01-17 17:09:41 EST
This is fixed in HEAD. I get: // Method descriptor #15 ([Ljava/lang/String;)V // Stack: 2, Locals: 2 public static void main(java.lang.String[] args); 0 aload_0 [args] 1 arraylength 2 ifne 11 5 ldc <String "a"> [16] 7 astore_1 [s] 8 goto 12 11 return 12 getstatic java.lang.System.err : java.io.PrintStream [18] 15 aload_1 [s] 16 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24] 19 return Line numbers: [pc: 0, line: 4] [pc: 5, line: 5] [pc: 11, line: 7] [pc: 12, line: 9] [pc: 19, line: 10] Local variable table: [pc: 0, pc: 20] local: args index: 0 type: java.lang.String[] [pc: 8, pc: 11] local: s index: 1 type: java.lang.String [pc: 12, pc: 20] local: s index: 1 type: java.lang.String Where the source is: 1:public class X { 2: public static void main(String[] args) { 3: String s; 4: if(args.length == 0) { 5: s = "a"; 6: } else { 7: return; 8: } 9: System.err.println(s); 10: } 11:} I will add a regression test for it. Thanks Oliver, that was quick. Is there a chance to backport this to 3.1x stream? Of course if there will be maintenance builds... Maybe. Adding Philippe in CC. Philippe, candidate for 3.1.3 or 3.1.2? I believe this has been fixed in the same time I added the support for stack map table attribute. I tried with 3.2M4 and I could reproduce the failure. v_632 is still failing, but v_633 that contains the changes for the stack map table attribute doesn't have the problem anymore. Added regression test org.eclipse.jdt.core.tests.compiler.regression.DebugAttributeTest.test001 Closing as FIXED. Philippe, let me know if you want it to be backported. What would it involve for 3.1.x ? The stackmaptable attribute is not intended to be part of the 3.1.x. (In reply to comment #7) > What would it involve for 3.1.x ? The stackmaptable attribute is not intended > to be part of the 3.1.x. This bug is about incorrectly generated debug info for local variables I could simply extract the part of the changes for the stack map table that involved the if statement. No need to backport all the changes. Verified for 3.2 M5 using build I20060215-0010 |