0

I'm trying to debug my Rust project in VSCode but the debugger doesn't step through the code. I have lldb configured as the debugger, but breakpoints aren't hit, and I can't step through my code. I’m using Windows 11 with the stable Rust toolchain.

VSCode Configuration (launch.json):

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "lldb",
      "request": "launch",
      "name": "Cargo launch",
      "cargo": {
        "args": ["build", "--lib"]
      },
      "args": []
    },
    {
      "type": "lldb",
      "request": "launch",
      "name": "Debug executable 'f_rust'",
      "cargo": {
        "args": ["build", "--bin=f_rust", "--package=f_rust"],
        "filter": {
          "name": "f_rust",
          "kind": "bin"
        }
      },
      "args": [],
      "cwd": "${workspaceFolder}"
    }
  ]
}

Steps Taken: Tried launching the debugger via the VSCode interface. The process runs, but I can't step through code or hit breakpoints. I’ve ensured there are no running instances of f_rust.exe before launching the debugger. I start debugger by clicking on debug button that appears above the a main method

debug console output:

Console is in 'commands' mode, prefix expressions with '?'.
Loading Rust formatters from C:\Users\...\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/etc
error: f_rust.exe :: Class 'enum2$<core::option::Option<alloc::sync::Arc<tokio_util::sync::cancellation_token::tree_node::TreeNode,alloc::alloc::Global> > >::Some' has a member '__0' of type 'alloc::sync::Arc<tokio_util::sync::cancellation_token::tree_node::TreeNode,alloc::alloc::Global>' which does not have a complete definition.
error:  f_rust.exe :: Class 'tokio::util::linked_list::PointersInner<tokio::sync::notify::Waiter>' has a member 'prev' of type 'enum2$<core::option::Option<core::ptr::non_null::NonNull<tokio::sync::notify::Waiter> > >' which does not have a complete definition.
error: f_rust.exe :: Class 'tokio::util::linked_list::PointersInner<tokio::sync::batch_semaphore::Waiter>' has a member 'prev' of type 'enum2$<core::option::Option<core::ptr::non_null::NonNull<tokio::sync::batch_semaphore::Waiter> > >' which does not have a complete definition.
error: f_rust.exe :: Class 'enum2$<core::option::Option<core::ptr::non_null::NonNull<tokio::runtime::task::core::Header> > >::Some' has a member '__0' of type 'core::ptr::non_null::NonNull<tokio::runtime::task::core::Header>' which does not have a complete definition.
error: f_rust.exe :: Class 'tokio::util::linked_list::PointersInner<tokio::runtime::io::scheduled_io::ScheduledIo>' has a member 'prev' of type 'enum2$<core::option::Option<core::ptr::non_null::NonNull<tokio::runtime::io::scheduled_io::ScheduledIo> > >' which does not have a complete definition.
error: f_rust.exe :: Class 'tokio::util::linked_list::PointersInner<tokio::runtime::io::scheduled_io::Waiter>' has a member 'prev' of type 'enum2$<core::option::Option<core::ptr::non_null::NonNull<tokio::runtime::io::scheduled_io::Waiter> > >' which does not have a complete definition.
error: f_rust.exe :: Class 'tokio::util::linked_list::PointersInner<tokio::runtime::time::entry::TimerShared>' has a member 'prev' of type 'enum2$<core::option::Option<core::ptr::non_null::NonNull<tokio::runtime::time::entry::TimerShared> > >' which does not have a complete definition.

Launched process 28584 from 'C:\Users\...\f_rust.exe'

What I've Tried: Restarted VSCode and the system. Launched VSCode as an administrator. Tried cargo clean to clear any build artifacts. No log files are generated, and there’s no relevant output to stdout when starting from a terminal.

2
  • Does the debug button work without a custom launch.json? Have you tried the instructions from the official docs? You should also let the extension generate the launch.json. Commented Aug 11 at 1:26
  • That’s it! As stated in the documentation, I should not use LLDB on Windows. Instead, I need to use the C++ extension for VSCode. Thanks for the link! Commented Aug 11 at 15:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.