Visual Studio Debugger skips over breakpoints

后端 未结 13 2139
耶瑟儿~
耶瑟儿~ 2020-11-30 09:20

My Visual Studio 2008 IDE is behaving in a very bizarre fashion while debugging a unit test: I have a breakpoint and when I hit it and then try to step with F10 the test con

13条回答
  •  北荒
    北荒 (楼主)
    2020-11-30 09:48

    I had similar issues on VS 2003. It turned out that I was using wrong symbols so they could not be bind to correct source.

    Make sure in a following:

    1. That you're using the Debug build (or that any kind of Optimization is turned off)
    2. That build output path is OK ( that "Project Properties\Linker\Output File" match to the exe you're debugging)
    3. That you don't place breakpoints on variable declarations: i.e. if you place a break point on "int some_variable;", you will never hit it but instead you'll hit the first place after it where you defining\initialize something or calling some methods
    4. You can't step-into with F10 (executes next statement) but with F11 (executes next statement and follows execution into method calls)
    5. Make sure you don't have any filters on breakpoints (i.e. Hit count or condition)

    p.s. try placing the DebugBreak(); function in both methods (unless this code is executed inside some loop so this might be frustrating). This should cause terminating your process when execution reach any of these functions (so you can continue with debugging from that particular place).

提交回复
热议问题