In some of the files, debugger is pointing at the wrong line, while stepping through the code. To be precise, it is off by exectly one line (always)
What I have already tried:
1) normlized line-endings in all of the files
2) wiped out all of the PDB files
3) wiped out the entire debug folder
4) rebuilt the entire project
5)ensured that optimisation for the entire solution and projects within it it is turned-off (/Od switch enabled)
6)ensured that libraries (*.LIB) to which source code I have access to, have had their optimisation disabled and use the same threading mode as the main executable.
7) rebooted PC / VS
project is set to x64 Debug,takes use of SQLite3 LIB and DLL, OpenCL.lib
example in the faulty file:
int a = 0;
a++;
=> a++; //debugger points at this line, though the value of 'a' is already equal to 2
a++;
One file has the issue, while another might not have it. I haven't found any corelation between affected files and their content.
You can also click on the line you want to skip to and hit Ctrl+F10 (Run to Cursor). It will jump directly to that line.
Hover over the breakpoint symbol, choose the Settings icon, and then select Remove breakpoint once hit in the Breakpoint Settings window.
When you are on a line of code that is a function or method call, you can press F10 (Debug > Step Over) instead of F11. F10 advances the debugger without stepping into functions or methods in your app code (the code still executes).
Turns out I've used the most upvoted method described in stack post to 'normalize' line endings in the entire project. Seems like it did not work. After normalising line endings with Visual Studio everything works fine.
So for anyone else with this problem, just re-enable automatic line-ending fix-up ,if disabled, by going to Tools=>Options=>Environment=>Documents and enable 'check for consistient line endings on load'. Then repen problematic file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With