This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Debugger steps on invalid lines after source code changes | ||
---|---|---|---|
Product: | debugger | Reporter: | bht <bht> |
Component: | Java | Assignee: | Martin Entlicher <mentlicher> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 7.1 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
project in zip file
screen shot 1 screen shot 2 screen shot 3 screen shot 4 |
Description
bht
2012-01-01 20:22:23 UTC
Created attachment 114537 [details]
screen shot 1
Created attachment 114538 [details]
screen shot 2
Created attachment 114539 [details]
screen shot 3
Created attachment 114559 [details]
screen shot 4
Reproduced first time with an empty userdir as follows:
- Open NetBeans with a new userdir - do not import settings
- Close the start page
- Maximise window
- Menu|Tools|Options|Miscellaneous|Files|Uncheck "Enable auto-scanning of sources"
- Open the project
- Set breakpoints on all lines of Test.java between lines 21 and 52
- Start GlassFish in debug mode
- Projects Window|right click project node|Debug
- Step through all lines, then Continue
- Duplicate or remove the line marked for duplication, setting breakpoint on it again, or removing duplicate breakpoints so there is only one
- Save the file
- Projects Window|right click project node|Debug
- repeat once until error shown
Thanks for the detailed description, I've reproduced it. It looks like the debugger thinks that the changed code was deployed to the server, but it was not, because Deploy on Save is set to false. Thanks and a Happy New Year! How in the meantime can I get the debugger to re-calculate all breakpoints? I remember that even undeploying, re-starting the server, cleaning, building and re-deploying did not help in some scenarios. It's fixed by changeset: 209750:44347bb5c87d http://hg.netbeans.org/main/rev/44347bb5c87d Happy New Year to you as well. :-) I'm not sure of what re-calculation of all breakpoints do you mean, but if you finish the debugger session and start a new one, then the new debugger session will submit breakpoints to the lines that you see in the editor. All shifts that are added during the editing are forgotten. But it's expected that at the time you start the debugger session, the application code that is executed corresponds to the source code. If not, re-deploy should fix that. IMHO this problem with shifted lines would be fixed by allowing to deploy the application on save. That should keep the source code changes and the execution code in sync. Interesting. I am still using RC2 containing the bug, and I am interested in working around it cleanly. The bug does not go away if the debugger is confused, where it says with our testcase there is no executable code on line 51 throw new RuntimeException(); In that scenario, I do this: - stop the debugging session (from the main menu) - deploy - start a new debugging session (from the main menu) If I understand you correctly, then the debugger should recover this way but it does not. I think it would help if the debugger could reset itself more easily. I was getting into a stage, where even undeploying a big app and re-starting the server did not wok around a line number mismatch problem. At that stage, I started to dismantle the large app to isolate the problem, but in the end, the testcase is not as severe as what I saw initially. Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/44347bb5c87d User: mentlicher@netbeans.org Log: #206829 Notify the JPDA debugger only when the modified code is successfully deployed. |