Vscode: Debugger does not support "Move to line"

Created on 29 Apr 2017  路  15Comments  路  Source: microsoft/vscode

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

debug feature-request on-testplan release-notes

Most helpful comment

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 https://github.com/microsoft/vscode/issues/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

All 15 comments

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

@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 "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 got it, thanks for the explanation

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

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

Any update on this feature?

Any update on when this feature would be added?

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

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.

@isidorn you might want to look into C#'s implementation of their "Set Next Statement" action: https://github.com/OmniSharp/omnisharp-vscode/blob/52794d3b5b188f5585f02bad68758092bcc66a1a/src/coreclr-debug/setNextStatement.ts#L10

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 https://github.com/microsoft/vscode/issues/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 excellent! I opened https://github.com/OmniSharp/omnisharp-vscode/issues/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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

filfat picture filfat  路  246Comments

Tyriar picture Tyriar  路  314Comments

hsdk123 picture hsdk123  路  263Comments

niagr picture niagr  路  246Comments

ghost picture ghost  路  234Comments