locked
Step Over (F10) and breakpoints not working properly in VS2011 RRS feed

  • Question

  • When debugging my HTML/JS Metro application I repeatedly run into situations where Debugging in VS2011 doesn't work properly.

    The first scenario is that Step Over (F10) doesn't work as expected. Instead of advancing to the next line it behaves like F5 and just keeps running to the next break point.

    The second scenario is that sometimes breakpoints don't work at all. Instead of stopping at a breakpoint Visual Studio just shows a file to say that no source code is available for that breakpoint. You can then click on a 'step' link to try to get to the next breakpoint with source code but that never happens. In the end you have to press F5 to continue (and the breakpoint does not work).

    Has anyone seen this? Any ideas what could cause this?

    Sunday, March 25, 2012 7:00 AM

Answers

  • Haven't seen this since using final VS2012. Seemed to have been an issue in the preview.
    • Marked as answer by PatrickKlug Saturday, August 18, 2012 9:54 AM
    Saturday, August 18, 2012 9:54 AM

All replies

  • I have seen the first happen if you are trying to trace into a promise, just put a BP inside the promise.

    For the second issue it sounds like your code has an error and that is why it cannot find the line to set the BP.  Turn on first chance exceptions in the Debugger and you should be able to fine where the problem is.

    -Jeff


    Jeff Sanders (MSFT)

    Monday, March 26, 2012 3:51 PM
    Moderator
  • I don't use any Promise features in this particular project so I can rule it out but I don't quite understand what you mean.

    When you say trace 'into' a promise what do you mean exactly?

    Monday, March 26, 2012 11:10 PM
  • Hi Patrick,

    For example if you put a bp on the first line here and hit F10 you would simply step over to the closing brace and not step to 'if (file)'.

    Do you undrstand why?


        openPicker.pickSingleFileAsync().then(function (file) {
            if (file) {
                // Application now has read/write access to the picked file
                sdkSample.displayStatus("Picked photo: " + file.name);
            } else {
                sdkSample.displayStatus("File was not returned");
            }
        });


    Jeff Sanders (MSFT)

    Tuesday, March 27, 2012 11:54 AM
    Moderator
  • Hi Jeff,

    I understand that in this case it wouldn't step into the function since (then) is a asynchronous call.

    My case is where the debugger genuinely jumps over what is otherwise a linear progression.

    I might have something very simple like:

    var bar = new Foo();
    bar.doSomething();

    and setting a breakpoint on the first line and then hitting F10 acts like pressing F5. The only way to get the debugger to the second line is to set another breakpoint on the exact line.

    I have tried to reproduce this issue in a small sample application but I am unable to :/

    I definitely see this problem repeatedly.

    Tuesday, March 27, 2012 10:53 PM
  • Haven't seen this since using final VS2012. Seemed to have been an issue in the preview.
    • Marked as answer by PatrickKlug Saturday, August 18, 2012 9:54 AM
    Saturday, August 18, 2012 9:54 AM