Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug protocol extension: set next statement #28

Closed
gregg-miskelly opened this issue Jun 7, 2016 · 15 comments
Closed

Debug protocol extension: set next statement #28

gregg-miskelly opened this issue Jun 7, 2016 · 15 comments
Assignees
Milestone

Comments

@gregg-miskelly
Copy link
Member

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.

@weinand
Copy link
Contributor

weinand commented Jun 8, 2016

@gregg-miskelly What kind of UI would use these requests?

@weinand weinand self-assigned this Jun 8, 2016
@weinand weinand added feature-request Request for new features or functionality protocol change and removed feature-request Request for new features or functionality labels Jun 8, 2016
@gregg-miskelly
Copy link
Member Author

@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.

@weinand
Copy link
Contributor

weinand commented Jun 8, 2016

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

@gregg-miskelly
Copy link
Member Author

@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.

@weinand
Copy link
Contributor

weinand commented Jun 8, 2016

@gregg-miskelly so this is 'reverse debugging' or 'back-in-time' debugging?

@gregg-miskelly
Copy link
Member Author

@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.

@gregg-miskelly
Copy link
Member Author

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.

@mjbvz
Copy link

mjbvz commented Jun 8, 2016

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.

@weinand
Copy link
Contributor

weinand commented Jun 8, 2016

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.

@gregg-miskelly
Copy link
Member Author

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.

@weinand
Copy link
Contributor

weinand commented Jul 18, 2016

@gregg-miskelly @jacdavis @DavidKarlas

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

Please review and comment.

@verysimplenick
Copy link

Any news about feature?

@weinand
Copy link
Contributor

weinand commented Aug 7, 2017

This protocol feature was finished in July 2016.

@verysimplenick
Copy link

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

@weinand
Copy link
Contributor

weinand commented Aug 7, 2017

@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
Projects
None yet
Development

No branches or pull requests

4 participants