views:

74

answers:

4

Just wondering if someone could shed some light on a problem I'm having. The think() method is called every 100ms, and i have a few breakpoints set however the first one that gets stopped at isn't the first that should.. It seems to miss stopping on the others. Has anyone seen anything like this before? See screenshot below, the one it is stopped at is the first one it stopped at.

Image Link

A: 

It doesn't look like it, but do those previous breakpoints have conditions on them? You can right-click on the dot and select "Conditions..." to see - it allows you to set a breakpoint that only breaks when certain things are true - perhaps that's what happening here.

Aside from that, I'm not sure what would cause the debugger to skip those breakpoints, as it looks like the code they're set on is hit every time.

rwmnau
A: 

Try rebuilding your solution and re-set the breakpoint. I have had the VS Debugger miss breakpoints too, the above procedure has always helped.

Johannes Rudolph
+4  A: 

Depending on how Think() is getting called, you may be breaking on different threads, thus giving the impression that you are not hitting every breakpoint. For example, if you hit the first breakpoint, then the second, then see the first one again, you may be viewing the breaks on different threads. You can check by looking at the Threads debug window (Debug->Windows->Threads or Ctrl+Alt+H).

HTH.

Paul Kearney - pk
this is the most likely cause as the Think function is called every 100ms and when you are debugging you are obviously taking more time than 100ms.
24x7Programmer
+1. If you are using a timer to call this function then if the first call hasn't completed by the time 100ms elapses the second call will be on a different thread. You can see the threads running and which one you're viewing in one of the debug windows.
Paolo
Yes, this seemed to be the issue. I also had a breakpoint in another timered fuction.Cheers for the help. J
teishu
A: 

Maybe the following?

KB957912 - Update for Visual Studio 2008 SP1 Debugging and Breakpoints

http://code.msdn.microsoft.com/KB957912

Cole Anstey