-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support "set-next-statement" with cppdbg #1025
Comments
@akbyrd AFAIK gdb/lldb does not support anything like this today. |
@pieandcakes I've not used them personally, but after a few searches it appears this capability exists in GDB and LLDB. In GDB it's enabled by the jump command:
Thread where support for this was implemented in another IDE (also contains a link to a patch for another IDE with implementation) The LLDB manual explicitly gives an equivalent to the GDB jump command:
And the repo actually has a script extension to make it look more like GDB jump: Provided I haven't misunderstood the purpose of the above command it would appear "set next statement" type behavior is well supported and fairly well used considering the amount of search hits. |
@akbyrd Thank you for the information. We need to use gdb's MI mode to drive the debugger and I was able to find this:
|
i understand it cold be kinda off-topic but any idea about similar feature in c# debugger? should i reference some other group? the feature by itself is one of they key tools while developing complex apis what require setting up a complex context for each call. As result ability to "re-walk" over and over again same code instance while modifying internal variables from the console becomes a huge time saver. |
@kostyamy I would assume creating an issue in the C# repo and referencing this issue and the protocol implementation issue would be the best course of action. |
@akbyrd it makes total sense but i bit confused what C# repo is? |
It looks like the OmniSharp repo is the official one |
@akbyrd i just made a post there and referenced this issue. so thank you. hopefully they move fast enough |
Any update on this? This is the one feature missing from moving exclusively to VScode. |
I'd love to see this implemented. I need to use this occasionally and then always return to regular Visual Studio in frustration. |
I agree with others here. This is one of the most powerful debuging features that I use in VS, and it really needs to be added to VSCode if at all possible.. |
I wonder if this feature has been added or is in development. |
@BeBopping @TanWei @stephanreiter Install the vsc extension of the link below. https://marketplace.visualstudio.com/items?itemName=ntoskrnl7.cxx-set-next-statement-extension It works well in cppvsdbg (vscode-cpptools -OpenDebugAD7). enjoy :) |
Lol, gdb and lldb already support it gdb
10 is a code line Plz, add support for native gcc and lldb. Also add ability to write commandline commands together with UI |
this is completely false, both gdb and lldb support this |
Hello, |
@pieandcakes, from your previous reply, can you please confirm if the command |
Hi team, |
FYI, this feature works on Windows with cppvsdbg mode, but not cppdbg mode (any OS). |
The
Note that Set Next Statement is a combination of temporary breakpoint (
The new location is not updated in the UI. In fact, it throws an exception: If you step over after that, it does show the proper next line in the UI. I'm really looking forward to having this feature fully supported! |
Where I can see the full list of VSCode dbg commands ? |
@effolkronium add this to your
The commands will be shown in the VSCode Debug Console. |
I know this is not directly related to vscode native state and therefore a bit out of topic, but that's my only track for a workaround for now, and besides ntoskrnl7's repositories lack an Issue section so I cannot post an issue there instead. In addition, nobody commented on this plugin yet, so people reading this thread may be interested to know if the workaround can work.
I installed the .vsix for both Native-Debug and CodeLLDB, then ntoskrnl7.cxx-set-next-statement-extension, and I see the new item Set Next Statement (C/C++), but it still pops an error:
Maybe it's because I'm using MI? My launch config uses this:
so I guess I must install MIEngine, but there is no .vsix for it provided in https://github.com/ntoskrnl7/cxx-set-next-statement-extension/tree/master/extensions. I guess I could build it from the repo, but I'm not familiar with the extension build process. Alternatively I could use something else than MI, but I don't know how to use something else. Removing the line with MIMode doesn't change anything, it seems like VS Code is just using MI by default. So in the current state, I don't have a native solution nor a workaround. |
Hello, |
This functionality is taught in lesson 3.7 of the popular LearnCPP.com tutorial for C++. That means that these features are regarded as basic tools for elementary C++ debugging, not an advanced or esoteric features. So I really hope that a kind contributor will be able to finish this work. |
As a workaround, one can do this instead:
|
Is this still not supported? "Set next statement" doesn't work for me when using g++ and gdb in VScode with WSL linux remote debugging. It would be extremely helpful to be backstep and iterate through same code. I can go to Debug Console in Vscode while stopped at breakpoint and type gdb command: And it works. So it seems the gdb command just needs to be linked somehow to right click line -> Jump to Cursor in the UI. |
The ability to modify the instruction pointer to point a different location without running any code is an extremely useful debugging feature in C/C++. I'd like to request this feature in the toolset.
Visual Studio has an implementation of this, referred to as "Set Next Statement" in the UI. It is normally done by either dragging the yellow arrow indicating the currently executing line of code, or by right clicking a line and choosing "Set Next Statement".
https://msdn.microsoft.com/en-us/library/y740d9d3.aspx#Anchor_4
It appears the protocol for this is already implemented in VS Code.
microsoft/vscode-debugadapter-node#28
microsoft/vscode-debugadapter-node#45
Related: microsoft/vscode#12514
The text was updated successfully, but these errors were encountered: