diff --git a/debugger.lua b/debugger.lua index 962472c..59c7335 100644 --- a/debugger.lua +++ b/debugger.lua @@ -59,3 +59,42 @@ dap.configurations.c = { request = 'attach', processId = require('dap.utils').pick_process, }, + { + name = "Debug J-Link", + type = "cdbg", + request = "launch", + cwd = "${workspaceFolder}", + program = function() + local path = vim.fn.input({ + prompt = 'Path to executable: ', + default = vim.fn.getcwd() .. '/', + completion = 'file', + }) + + return (path and path ~= '') and path or dap.ABORT + end, + stopAtEntry = false, + MIMode = "gdb", + miDebuggerServerAddress = function() + local address = vim.fn.input({ + prompt = 'Server address: ', + default = 'localhost:3333', + }) + + return address + end, + + miDebuggerPath = "gdb-multiarch", + serverLaunchTimeout = 5000, + postRemoteConnectCommands = { + { + text = "monitor reset", + ignoreFailures = false + }, + { + text = "load", + ignoreFailures = false + }, + }, + } +} diff --git a/rust.lua b/rust.lua index 14397f5..f7b3d74 100644 --- a/rust.lua +++ b/rust.lua @@ -10,7 +10,7 @@ vim.g.rustaceanvim = { test_executor = require('rustaceanvim.executors').neotest; - crate_test_executor = require('rustaceanvim.executors').background; + crate_test_executor = require('rustaceanvim.executors').neotest; -- callback to execute once rust-analyzer is done initializing the workspace -- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"