jonboh / nvim-dap-rr

Dap configuration for the record and replay debugger. Supports Rust, C++ and C.
https://jonboh.dev/posts/rr/
MIT License
34 stars 0 forks source link

Fails with Rust config: error: '-exec' is not a valid command. #6

Open OctaveLarose opened 7 hours ago

OctaveLarose commented 7 hours ago

This is likely to just be me making a silly mistake, but in case others encounter it I thought I'd ask.

On my Rust project, when attempting to use nvim-dap-rr, I can launch the program through the generated rr DAP config, but after my program segfaults (the reason why I'm debugging it!), I can't use rr operations successfully.

If I call reverse-continue:

[debug-adapter stderr] [ERROR codelldb::debug_session] error: '-exec' is not a valid command.

My config:


dap.adapters.rust = vim.g.rustaceanvim.dap.adapter 

dap.configurations.rust = {
  // ...
}

local rr_dap = require("nvim-dap-rr")
rr_dap.setup({
  mappings = {
     // ...
}
})

-- not sure if needed
local get_rust_gdb_path = function()
  local toolchain_location = string.gsub(vim.fn.system("rustc --print sysroot"), "\n", "")
  local rustgdb = toolchain_location .. "/bin/rust-gdb"
  return rustgdb
end

table.insert(dap.configurations.rust, rr_dap.get_rust_config(
  {
    name = "rr",
    type = "rust",
    program = function()
      vim.fn.system("cargo build --features=som-gc/stress_test");
      return vim.fn.getcwd() .. "/target/debug/som-interpreter-bc"
    end,
    args = function()
      return benchmark_args_fn()
    end,
    miDebuggerPath = get_rust_gdb_path,
    stopOnEntry = true
  }
))

I think it might not be using the right debugger, and is attempting a normal debug session as opposed to letting me go through the replay?

I was thinking that perhaps the rustaceanvim adapter might also be the cause and get in the way, not sure. If it is, that's a bit of a hassle, since I like using it for my usual debugging.

jonboh commented 6 hours ago

Can you report your versions for codelldb, neovim, rustaceanvim etc? I can try to look into it, maybe there's been some change in codelldb that requires updating nvim-dap-rr.

Have you tried running it without overriding dap.adapters.rust with the rustaceanvim one? If it works at least it tells us that has something to do with settings on the adapter.