vadimcn / codelldb

A native debugger extension for VSCode based on LLDB
https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
MIT License
2.42k stars 237 forks source link

Cargo rebuild isn't triggered when restarting a test with modified code #988

Closed vlovich closed 9 months ago

vlovich commented 9 months ago

OS: Arch Linux VSCode version: 1.82.1 CodeLLDB version: 1.9.2 Compiler: rust 1.72 Debuggee: Rust w/ Dwarf

Hitting "restart" in the debugger pane doesn't rebuild the binary if I make changes to the source. This applies to both when launched through IntelliSense or through a launch config.

x86_64-pc-linux-gnu

Steps to Reproduce:

Set a breakpoint at some line of code. Use Intellisense to launch a normal rust test by hitting the "Debug" inlay hint. Modify some code and save Hit "restart" in the debug panel Expected: The new modified code is being tested

Actual: Code is not rebuilt and instead the previously run library is used.

The same issue exists when using a formal lldb cargo profile in launch.json & hitting restart then.

This is a bit of departure of my expectation from what normally happens when you initially start the debugging session where it will trigger a rebuild as I find myself frequently trying to "debug -> edit (e.g. adding a printf, fixing what I think is the bug)-> restart the test running the new code to verify change".

If this is a controversial suggestion, it would be nice to at least have this be a toggleable preference (or even use file watching to determine if any files changed since last run for peak optimal behavior).

vadimcn commented 9 months ago

Rebuilding (or not) code on debug is a VSCode behavior, so you should raise this issue with them. (The "Debug" inlay hint is not even a Codelldb feature, but rather that of the Rust Analyzer).

vlovich commented 9 months ago

I did before I filed it here because that's what I figured: https://github.com/microsoft/vscode/issues/193039 The VSCode team closed it out and said it's an LLDB issue.