Eclipse (Helios) debugger - getting different Results in Debug mode and Run mode
I am debugging RCP( multi-threaded GUI application) using Eclipse Helios.
When I am executing the same method, I get a null pointer exception in run mode, but in
debug mode, I don't get any exception. I think it works fine in Debug mode.
Null pointer exception doesn't come in debug mode , but in run mode only..
Please help me out. Could it be a multi-threading issue.
You can add a breakpoint to the line that NPE happened in run mode. And you need set the property of breakpoint to pause the entire vm.
Then debugging your program, the entire vm will be suspended when a thread tries to execute that line. You can let other threads which don't try to execute that line to resume, the second thread will be suspended on that line as well. You can analysis the flaw of your code.
Different behavior in run and debug mode is not unusual. Once I spent a day to find that a toString() had side effects. The debugger calls this method when displaying variables. Another reason for differences is concurrency. The execution order in the debugger may be different from run mode.