VS2017 C++ debugger skipping lines of code

0

I did a quick search and found nothing similar to this question. Maybe I don't know how to search for this one, sorry.

I recently moved to VS2017 (community version) from VS2015. I'm involved in a project where I develop in C++. Sometimes I need to debug, as usual.

I noticed the debugger on VS2017 doesn't work as it did on 2015 version. I don't know if it's a configuration problem.

The problem is that Step over, Step Into, Step Out don't work the expected way (execute a code line and move to the next one/etc). I uploaded here a screenshot of the debugger behaviour: https://imgur.com/a/FZSMFSJ

Just pressing F10 (Step Over), the debugger moves that way (line 222->239->242->244->248->244->248->254), skipping code lines in between, even moving forwards and backwards.

As it is seen in the other images, the breakpoint works alright, and there are 2 types of "debug line indicators", with different message.

How can I set the VS options to get the wanted debug?

user0123

Posted 2019-04-17T23:40:47.227

Reputation: 1

1That depends on the code. – Biswapriyo – 2019-04-18T03:25:56.273

You are probably debugging an optimized version, and those 'skipped' lines were optimized away. Try to run the debugger in non-optimized code. – Aganju – 2019-05-27T12:39:37.910

No answers