Home » Language IDEs » Java Development Tools (JDT) » different results between debug mode and run mode of Eclipse JDT
different results between debug mode and run mode of Eclipse JDT [message #647771] |
Sat, 08 January 2011 19:58 |
jiangfan shi Messages: 4 Registered: January 2011 |
Junior Member |
|
|
Hi,
When I set up a break point, in the debug mode the execution was
successful after my program stopped and continued from the break point. When
I cleared the break point, in the debug mode the execution of my program
threw an exception. When I ran my program in the normal run mode, my program threw a same exception. There are other scenarios, but I just want to put a
long story short, and make my question clear here.
Does anyone encounter such strange phenomenon before? Are there some
solutions? For me, I have changed the Eclipse from 3.6 to 3.5 with 4
versions, and the phenomenon is same. My OS is Ubuntu 10.10, the
latest version.
I have changed my current Sun JDK versions from 1.6.0.23 to 1.6.0.16, and to openjdk 6, and nothing is changed.
Any idea?
Thanks a lot and appreciate your help in advance!
Jiangfan
|
|
| |
Re: different results between debug mode and run mode of Eclipse JDT [message #647788 is a reply to message #647784] |
Sun, 09 January 2011 02:12 |
|
Sat, 08 Jan 2011 15:48:27 -0800, /Walter Harley/:
> On 1/8/11 11:58 AM, jiangfan shi wrote:
>
>> When I set up a break point, in the debug mode the execution was
>> successful after my program stopped and continued from the break
>> point. When I cleared the break point, in the debug mode the
>> execution of my program threw an exception. When I ran my program
>> in the normal run mode, my program threw a same exception.
>
> Is your program multithreaded, or is it invoking something that
> has multithreaded behavior? What you describe is very common when
> there are race conditions. Stopping at the breakpoint changes the
> timing.
One could set the breakpoint to suspend the VM (all threads) instead
of only the thread which hit the break. Then stepping over the
thread while the others are still stopped, one may be able to
reproduce the problem, but not guaranteed if more than two threads
are involved in the problem itself.
Also, I've once read about "printpoints" which could help in
debugging multithreaded applications:
http://www.eclipse-tips.com/tips/29-types-of-breakpoints-in- eclipse#Printpoint
--
Stanimir
|
|
|
Re: different results between debug mode and run mode of Eclipse JDT [message #647838 is a reply to message #647784] |
Sun, 09 January 2011 19:16 |
jiangfan shi Messages: 4 Registered: January 2011 |
Junior Member |
|
|
Hi, Walter and Stanimir,
Thanks for your responses.
My program is not multi-thread program, and that is why I am very curious such phenomenon. Previously I have run my program for many times, and I never encountered such inconsistent program behaviour before. That is, the debug mode executes a different sequence of byte codes than the normal run mode, and from my observation, such sequence of debug mode is always shorter than the run mode.
I also found a link about a similar but different bug link of Eclipse, which is very old around 2004. https://bugs.eclipse.org/bugs/show_bug.cgi?id=53784
Stanimir, for your given link, I found field break points are very useful option for me. I have thought these will be techniques inside runtime monitoring, and did not expect it appears in the normal debug mode. But these options are indeed good techniques inside the debug. I will try these.
Any other hints ?
Best,
Jiangfan
|
|
| |
Goto Forum:
Current Time: Wed Sep 25 18:00:32 GMT 2024
Powered by FUDForum. Page generated in 0.02459 seconds
|