rust-lang / vscode-rust

Rust extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust
Other
1.39k stars 167 forks source link

debugging support #5

Open nrc opened 8 years ago

nrc commented 8 years ago

Integration between LLDB and VSCode exists (https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb / https://github.com/vadimcn/vscode-lldb) and by the sounds of it, has been tested and works with Rust code (and the author is a Rust contributor).

Alternatively, https://marketplace.visualstudio.com/items?itemName=webfreak.debug / https://github.com/WebFreak001/code-debug supports both GDB and LLDB (GDB has or will have better Rust support due to some integration into the debugger itself).

It seems, therefore like it should be relatively simple to package (or script) one of those plugins with the Rust/lldb/gdb script and our plugin and offer a decent debugging experience out of the box and without too much effort.

doxxx commented 7 years ago

I should note that the debugging experience on Windows with those extensions/tools leaves rather a lot to be desired. For example, the values of function parameters are unavailable and visualization of types any more complex than scalars or strings are generally unhelpful -- i.e. a raw pointer value or only the first level of information in a more complex type like Option.

I don't know if there's much you can do about this since it requires improved support in those extensions and tools, but it's something to bear in mind.

sherry-ummen commented 7 years ago

Shout out if you want this to be done soon... 👍

RReverser commented 6 years ago

@doxxx On Windows official C/C++ extension debugs Rust really well. In works on Linux too but not as well, so I tend to just use different extensions depending on current OS.

doxxx commented 6 years ago

@RReverser I've had some success with the WinDbg extension. Although it's still too difficult to run tests in the debugger than it should be.

xmine64 commented 5 years ago

It would be great if I press button 'F5' on my keyboard to start my rust program with debugger (or even without, Just build and run the code).

PhilParisot commented 5 years ago

I am also looking for this. A debugger is the main thing I look forward to in VScode extensions. It's disappointing that this hasn't been done already.

slanterns commented 4 years ago

The extension CodeLLDB has already offered out-of-box debugging experience for rust (e.g. it can generate launch.json file for rust automatically), can it be included in rls-vscode? Also, what's the current state of https://github.com/rust-lang/rls-vscode/pull/582/ ?

Yuri6037 commented 3 years ago

This evening I've just tried debugging and I was very dissapointed! On my Linux machine with VSCode C++, CMake and MS C++ extensions debugging was quite simple, no files to generate everything managed by CMake and MS C/C++ extensions. With this extension absolutely no run/debug capability is integrated.

I then tried if by any chance the commercial JetBrains CLion IDE would do better and well it was FAR FAR better. Everything worked out of the box. Exception to most warnings like unused functions, unused variables which JetBrains cannot see but VSCode can.

This really needs to be fixed as on all other C/C++ setups including Windows and Visual Studio or even Xcode it works out of the box.

It's really annoying to have to switch to CLion just for debugging...

EDIT: I think I was wrong it appears after tweaking CLion settings that it is also able to run all the warnings. So let me reformulate: as long as Rust VSCode extension won't be able to achieve debugging like CLion can with gdb, I will use CLion.

RReverser commented 3 years ago

With this extension absolutely no run/debug capability is integrated.

Yes, that's what the issue is about.

Did you check suggestions in this thread, in particular CodeLLDB in both the description and the last comment https://github.com/rust-lang/vscode-rust/issues/5#issuecomment-576418467)? If not, try them out - they already provide debugging experience without switching to a different IDE.

This issue is merely about integrating functionality between two extensions.

RReverser commented 3 years ago

More generally though, sure, if you find JetBrains IDE better for your use-cases, use that. It's great that there is a choice of IDEs for Rust!

PhilParisot commented 2 years ago

Any updates for this?