简体   繁体   中英

Issue setting breakpoint in Visual Studio (C++)

I have a Visual Studio 2012 project in release mode. I cannot convert it to debug mode for some reason.

When I'm debugging and I try to put a break point on function A, I cannot put it there - The breakpoint moves itself to function B which is exactly the same in content (ie function A and funciton B are exactly same just have different names).

I do understand that it must have optimized out the code, but I am using an option called as /od which means it should have suppressed code movement.

How can I put a breakpoints on function A?

You can try disabling the optimization options. - Right-click on the project->properties. - Configuration Properties - C/C++ - Optimization - Optimization-> Select Disabled(/Od) This should avoid that the compiler remove code. But, still, in release mode you are not sure if the displayed data is correct.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM