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

Debugger does not support "Move to line" #25653

Closed
o-lim opened this issue Apr 28, 2017 · 15 comments
Closed

Debugger does not support "Move to line" #25653

o-lim opened this issue Apr 28, 2017 · 15 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality on-testplan release-notes Release notes issues
Milestone

Comments

@o-lim
Copy link

o-lim commented Apr 28, 2017

  • VSCode Version: 1.11.x
  • OS Version: Ubuntu 14.04
  • Language: C++
  • Debugger: gdb

The VSCode debugger interface does not allow the user to update the current PC (Program Counter) to a specific line in a function. This is very useful, especially when you want skip certain instructions or re-run a function you accidentally stepped over.

@alexdima
Copy link
Member

@o-lim Which extension do you use for debugging ?

@alexdima alexdima added the info-needed Issue requires more information from poster label Apr 29, 2017
@o-lim
Copy link
Author

o-lim commented Apr 29, 2017

I use the Microsoft C/C++ extension

@weinand weinand added debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality and removed info-needed Issue requires more information from poster labels Apr 30, 2017
@isidorn
Copy link
Contributor

isidorn commented May 2, 2017

@o-lim if I understand your feature request correctly we already support this, it is called Run To Cursor and can be found in the context menu or the command palette

screen shot 2017-05-02 at 16 48 52

@isidorn isidorn closed this as completed May 2, 2017
@isidorn isidorn added *question Issue represents a question, should be posted to StackOverflow (VS Code) and removed feature-request Request for new features or functionality labels May 2, 2017
@weinand
Copy link
Contributor

weinand commented May 2, 2017

@isidorn "Move to line" can be used to set the PC (Program Counter) to any location without executing the code between the current location and the destination. So you can even go backward with this. "Run To Cursor" can only go forward and executes everything in between.

The DAP has support for this with the "GotoRequest" but we do not yet have the UI.

@weinand weinand reopened this May 2, 2017
@isidorn isidorn added feature-request Request for new features or functionality and removed *question Issue represents a question, should be posted to StackOverflow (VS Code) labels May 2, 2017
@isidorn isidorn added this to the Backlog milestone May 2, 2017
@isidorn
Copy link
Contributor

isidorn commented May 2, 2017

@weinand got it, thanks for the explanation

@ermish
Copy link

ermish commented Apr 3, 2018

any update on this? I would love this feature instead of comment toggling my code.

@MbProg
Copy link

MbProg commented Nov 28, 2018

Any update about this? PyCharm does offer this functionality with its "Jump to Cursor" from 2017

@vrdmr
Copy link
Member

vrdmr commented Feb 13, 2019

Any update on this feature?

@WeidongShen
Copy link

Any update on when this feature would be added?

@weinand
Copy link
Contributor

weinand commented May 23, 2019

No, but I will propose to add this for the next planning round.

@weinand weinand modified the milestones: Backlog, June 2019 Jun 6, 2019
@weinand
Copy link
Contributor

weinand commented Jun 12, 2019

A modest 2-stage proposal:

Stage 1:
we add a new "Jump to Cursor" context menu action (which aligns nicely with "Run to Cursor").

  • if DA has "supportsGotoTargetsRequest" capability add action "Jump to Cursor"
  • if "Jump to Cursor" action is executed
    • use "gotoTargets" request to find the available "GotoTarget"s
    • if there are some, find the closest to the cursor location
    • use the 'goto' request with the found "GotoTarget" id
    • if there are no "GotoTarget"s show error
  • after successful execution of 'goto' request a "stoppedEvent" with reason 'goto' is received.

Stage 2:
Optional more fancy UI:

  • the yellow arrow (which indicates the current execution location) can be dragged directly to the possible locations returned from "GotoTarget"s. While dragging, possible locations can be shown temporarily.
  • if there are multiple goto targets let user pick one by name.

@weinand
Copy link
Contributor

weinand commented Jun 13, 2019

@isidorn
Copy link
Contributor

isidorn commented Jun 14, 2019

This is done now. We have a Jump to Cursor in the command palette and the context menu.
For the "more fancy UI" I have created a follow up item #75505

Since this is now generally supported in VSCode. The C# extension can remove their Set Next Statement command @gregg-miskelly
Also ping @WardenGnaw @pieandcakes since not sure if C++ might support this.
Also @rkeithhill and @DonJayamanne for powershell and python.

jumpToLine

@isidorn isidorn closed this as completed Jun 14, 2019
@gregg-miskelly
Copy link
Member

@isidorn excellent! I opened dotnet/vscode-csharp#3117 to track removing the C# extension's custom command. What version of VS Code has the new command? I couldn't find your PR.

@isidorn
Copy link
Contributor

isidorn commented Jun 14, 2019

@gregg-miskelly thanks a lot. The current 1.36.0 insiders has my changes.
The next stable (in 3 weeks) will also have it.

@isidorn isidorn added on-testplan release-notes Release notes issues labels Jun 24, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality on-testplan release-notes Release notes issues
Projects
None yet
Development

No branches or pull requests

9 participants