Skip to content

Debug protocol extension: set next statement #28

Closed

Description

To be able to use the debug protocol in other IDEs (Visual Studio, Xamarin Studio) or VS Code in the future we should think about how the debug protocol should support set next statement.

To make this work well with VS without an impedance mismatch, we need this to be two different requests - one to find the code locations associated with a source line and another to set next statement to one of those. Something like:

"findCodeLocations"
    Request:
        source: Source;
        line: number;
        column?: number;
    Response:
       Array of code locations (ex: addresses)

"setNextStatement"
    Request:         
      threadId: number;
      codeLocation: CodeLocation;

We also likely want a new capability.

Activity

  1. weinand commented on Jun 8, 2016

    @weinand
    Contributor

    Gregg Miskelly (@gregg-miskelly) What kind of UI would use these requests?

  2. added
    feature-request
    and removed
    feature-request
    on Jun 8, 2016
  3. gregg-miskelly commented on Jun 8, 2016

    @gregg-miskelly
    MemberAuthor

    Andre Weinand (@weinand) in VS, set next statement can be preformed either by dragging the instruction pointer, by right clicking on the line you want to move to and invoking 'Set Next Statement' from the context menu, or from the keyboard with Ctrl+Sift+F10.

  4. weinand commented on Jun 8, 2016

    @weinand
    Contributor

    Gregg Miskelly (@gregg-miskelly) this sounds similar to VS Code's "Run to cursor"?

  5. gregg-miskelly commented on Jun 8, 2016

    @gregg-miskelly
    MemberAuthor

    Andre Weinand (@weinand) you mean in terms of UI, or in terms of use? In terms of UI - sure. In terms of use - not at all. This is changing where the instruction pointer is, without running any more code in the app. So for example, you step over a function, see that it returned the wrong value, then you can set next statement back to that call and try debugging through it to try and understand what happened.

  6. weinand commented on Jun 8, 2016

    @weinand
    Contributor

    Gregg Miskelly (@gregg-miskelly) so this is 'reverse debugging' or 'back-in-time' debugging?

  7. gregg-miskelly commented on Jun 8, 2016

    @gregg-miskelly
    MemberAuthor

    Andre Weinand (@weinand) no, its just moving the instruction pointer. Its like if you could add a 'goto line 12' in your program, but without modifying it.

  8. gregg-miskelly commented on Jun 8, 2016

    @gregg-miskelly
    MemberAuthor

    You can grab a VM with VS on it and give it a try (say with C#). Add a bunch of Console.WriteLine calls and then drag and drop the current IP arrow.

  9. mjbvz commented on Jun 8, 2016

    @mjbvz

    I find this feature very helpful when working with C# code in VS, and would love to see it supported.

    I agree that this would have to be gated as a Capability since not all debuggers will support this. Specifically, Chrome's V8 inspector protocol and other the JavaScript debug protocols I am familiar with do not support this type of operation natively.

  10. weinand commented on Jun 8, 2016

    @weinand
    Contributor

    Ok, I think I get it now: this is really like a 'goto' which means you can run through a program in a way that is impossible in normal execution. This seems only available in VS and only for C# and C++. Coming from an Eclipse background the closest thing I've seen there is 'drop to frame'. So this seems to be very specific to VS.

  11. gregg-miskelly commented on Jun 8, 2016

    @gregg-miskelly
    MemberAuthor

    I believe there are other IDEs with it, and certainly other runtimes, but yup, it is missing from Eclipse, Java and Chrome, and yup, 'drop to frame' is the closet that they provide.

  12. weinand commented on Jul 18, 2016

    @weinand
    Contributor

    Gregg Miskelly (@gregg-miskelly) Jackson Davis (@jacdavis) David Karlaš (@DavidKarlas)

    I've created a proposal for this protocol addition as PR 45.

    Please review and comment.

  13. verysimplenick commented on Aug 7, 2017

    @verysimplenick

    Any news about feature?

  14. weinand commented on Aug 7, 2017

    @weinand
    Contributor

    This protocol feature was finished in July 2016.

  15. verysimplenick commented on Aug 7, 2017

    @verysimplenick

    Andre Weinand (@weinand) maybe you know about implementing this protocol feature in vs code?
    Because OmniSharp just links to this work item.

  16. weinand commented on Aug 7, 2017

    @weinand
    Contributor

    bot (@verysimplenick) please file an issue against VS Code. This item here is just about the protocol (which is independent from VS Code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions