Click here to Skip to main content
15,898,371 members
Please Sign up or sign in to vote.
1.20/5 (3 votes)
See more:
When i am running my project in local machine with breakpoints it works well .but when i remove break point i am not getting out perfectly why
Posted
Comments
Eduard Keilholz 27-Oct-14 5:16am    
I guess you have some threading or async stuff going on which need some sort of synchronization somewhere? Please post a piece of code we can dig in to in order to help you. Basicly your question now is, "my car engine doesn't run, what's wrong", million answers...
Sergey Alexandrovich Kryukov 27-Oct-14 6:38am    
I agree; this is the most likely reason. That's why I put my answer, please see.
Of course, solving the problem needs comprehensive information on the case...
—SA
Robert Welliever 27-Oct-14 5:56am    
Yah, please specify. Nothing should happen when you remove a breakpoint except the breakpoint will disappear and then the code won't break there again. Removing a breakpoint won't step you out of the code if you're actively debugging.
Sergey Alexandrovich Kryukov 27-Oct-14 6:37am    
"Nothing should happen" is correct not in 100% of cases. There is such factor as timing. Moreover, in my experience, this (race condition) explains most of such cases. Please see my answer. It does not solve the problem, of course, but this is the first thing to analyze.
—SA
Robert Welliever 27-Oct-14 6:50am    
Race conditions? WTF? What do you think happens when you click a breakpoint to turn it off? What cases are you talking about when turning off a breakpoint does something except turn off the breakpoint?

1 solution

It's pretty much pointless to try to "fix" anything without seeing the code, but I can give you one idea.

There are cases when you really can expect different behavior when you execute code step-by-step or use break points, under the debugger. Why? For example, because such factor as timing can be important. But if you don't expect such effect, the mere fact that you have different results under the debugger is a clear indication of incorrectness of your code. One probably explanation is the same very timing, incorrect dependency on the time of execution, which can be revealed in case of any kind of parallelism. Such phenomena are known under the name "race condition": http://en.wikipedia.org/wiki/Race_condition[^].

This is the fist thing to think about.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900