c++ - Why does Visual Studio Release build break on non-executing code line -


When I created my C ++ program with the default release configuration in Visual Studio 10, I put a breakpoint on one line Who should never be reached. What confunded me was that when the program is running then it stopped at the breaking point.

Adding a volatile statement and transferring this line to the break point does not break the execution of the code where the brake appears (though does not produce the same behavior as creating a minimum project with this function).

Why is the "Release Debugger" (?) Step on this line and when executing breakpoints are executed? If I keep going after the break then false statement continues to return code execution.

  bool bounding box :: Cutting (int32_t xpos, int32_t ypos, int32_t dx, int32_t dy) const {int32_t intersectionX; Int32_t intersections; If ((dx> 0 & amp; amp; and & amp; xpos> rights) || (dx <0 & amp; amp; and & amp; expose & lt; left) || (dy & Gt; 0 & amp; amp; amp; amp; ypos> gt; Top) || (D & LT; 0 & amp; AOPO & Lt; BOT)) Return; If (DX! = 0) {intersection Y = ypos + (left - expose) * dy / dx; If (intersection Y & gt; BOT & amp; amp; amp; amp; pseudo y & lt; head) is correct; Intersection Y = ypos + (right - expo) * dy / dx; If (intersection Y & gt; BOT & amp; amp; amp; amp; pseudo y & lt; top) is correct; } If (D !! = 0) {intersection X = Exopos + (Boat - iOS) * DX / DI; If (intersection X> left & amp; edge X & lt; right) is returned back; // can return the wrong copy here x = xpos + (top-ypos) * dx / dy; If (intersection X & gt; left & amp; amp; edge; & lt; right)} {// volatile int e = 9; Back true; // !! Code execution will break here}} return false; Step 1 with F10 will move here}  

In the release of such behavior It's not surprising to build. Now with the custom code, there is no exact correspondence between a line of source code and a special address. Breakpoints and single stepping will be uncertain.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -