Summary: | [compiler] Wrong line is showed during debug | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | David Audel <david_audel> | ||||||||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||||
Severity: | normal | ||||||||||||
Priority: | P3 | ||||||||||||
Version: | 3.3 | ||||||||||||
Target Milestone: | 3.3 M4 | ||||||||||||
Hardware: | PC | ||||||||||||
OS: | Windows XP | ||||||||||||
Whiteboard: | |||||||||||||
Attachments: |
|
Description
David Audel
2006-11-15 11:27:20 EST
Smaller test case: public class X { private static final int CONST_1 = 1; private static boolean foo() { return true; } public static void main(String[] args) { int token = 5; int previousToken = 7; if (foo()) { switch (token) { case 5 : switch (previousToken) { case CONST_1: if(token > -1) { bar(7); } break; } break; } } else { bar(8); } } private static void bar(int i) { if (i == 7) { System.out.println("FAILED"); //$NON-NLS-1$ } } } Stepping inside main goes to bar(7) even if this is never executed. Created attachment 54133 [details]
Proposed fix
David, could you please try this patch?
Created attachment 54134 [details]
Regression tests
I tried the patch and i still reproduce the problem. Are you sure you rebuilt the project ? I forgot to rebuild the project. I retry your patch. The behavior have change but there is still a bug. Now the step 17 of my test case is 17) do step over (F6) then you reach line 713: "break;" instead of 17) do step over (F6) then you reach line 709: "this.pushOnElementStack(K_SELECTOR, this.identifierPtr);" The correct line should be 724. I can reproduce the problem by replacing "int token = 5;" by "int token = 6;" in your test case. (In reply to comment #7) > The correct line should be 724. There is no way I can get line 724. I think line 714 would be acceptable. Created attachment 54196 [details]
New patch
Created attachment 54197 [details]
Updated regression tests
David, could you please confirm that this works better? I'll try it on my side as well. Looks much better to me. It works as you describe. The line 724 would be better but 714 is acceptable. Released for 3.3M4. Verified for 3.3M4 with I20061212-0010. |