Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 debugger skipping

Occasionally during debugging the debugger skips forward randomly. Sometimes I Step into a function inside of another function and instead of going to the next line it skips through to a seemly random place in the future. sometimes to a line partway through another function. It always seems to respect breakpoints though, i.e. if a breakpoint is set in the future it never will skip past it.

I'm running 64 bit Win 7 and visual studio 2010 ultimate. I'm not using threads. This never happened for me in visual studio 2008. How can I fix this?

like image 336
Michael Avatar asked Jun 29 '10 21:06

Michael


Video Answer


2 Answers

Do you have optimizations turned on? If the program is highly optimized, the order of execution can be thrown off, and things can be expanded or rearranged in ways that are not always clear.

like image 187
Adam Shiemke Avatar answered Dec 24 '22 06:12

Adam Shiemke


I'm running into similar problems debugging a C# program with Visual Studio 2010 on an XP machine. The debugger just randomly skips to some other line or the next break point.

It seems that Microsoft has released a Fix for this in the SP1.

like image 43
user171197 Avatar answered Dec 24 '22 06:12

user171197