Replies: 4 comments 1 reply
-
https://zignar.net/2021/12/03/help-people-help-you-and-put-in-some-effort/ |
Beta Was this translation helpful? Give feedback.
-
i have tried all this config and no one work. local dap = require('dap')
dap.adapters.lldb = {
type = 'executable',
command = 'D:/ftarroux/scoop/apps/llvm/14.0.0/bin/lldb-vscode.exe', -- adjust as needed
name = "lldb"
}
dap.configurations.cpp = {
{
name = "Launch",
type = "lldb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = '${workspaceFolder}',
stopOnEntry = true,
args = {},
-- 💀
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
--
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
--
-- Otherwise you might get the following error:
--
-- Error on launch: Failed to attach to the target process
--
-- But you should be aware of the implications:
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
runInTerminal = false,
-- 💀
-- If you use `runInTerminal = true` and resize the terminal window,
-- lldb-vscode will receive a `SIGWINCH` signal which can cause problems
-- To avoid that uncomment the following option
-- See https://github.com/mfussenegger/nvim-dap/issues/236#issuecomment-1066306073
postRunCommands = {'process handle -p true -s false -n false SIGWINCH'}
},
}
-- If you want to use this for rust and c, add something like this:
-- local dap = require('dap')
-- dap.adapters.cppdbg = {
-- id = 'cppdbg',
-- type = 'executable',
-- command = 'D:/ftarroux/Downloads/cpptools-win64/extension/debugAdapters/bin/OpenDebugAD7.exe',
-- }
-- dap.configurations.cpp = {
-- {
-- name = "Launch file",
-- type = "cppdbg",
-- request = "launch",
-- -- program = function()
-- -- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
-- -- end,
-- program = "D:/ftarroux/Documents/FRED/BaseGit/matisse_fred/build/bin/Debug/main_se_atmosphere.exe",
-- cwd = '${workspaceFolder}',
-- stopOnEntry = true,
-- },
-- {
-- name = 'Attach to gdbserver :1234',
-- type = 'cppdbg',
-- request = 'launch',
-- MIMode = 'gdb',
-- miDebuggerServerAddress = 'localhost:1234',
-- miDebuggerPath = 'D:/ftarroux/Logiciel/mingw64_10_2/bin/gdb.exe',
-- cwd = '${workspaceFolder}',
-- program = function()
-- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
-- end,
-- },
-- }
-- local dap = require('dap')
-- dap.adapters.codelldb = function(on_adapter)
-- local stdout = vim.loop.new_pipe(false)
-- local stderr = vim.loop.new_pipe(false)
-- -- CHANGE THIS!
-- local cmd = 'D:/ftarroux/Downloads/codelldb-x86_64-windows/extension/adapter/codelldb.exe'
-- local handle, pid_or_err
-- local opts2 = {
-- stdio = {nil, stdout, stderr},
-- detached = true,
-- }
-- handle, pid_or_err = vim.loop.spawn(cmd, opts2, function(code)
-- stdout:close()
-- stderr:close()
-- handle:close()
-- if code ~= 0 then
-- print("codelldb exited with code", code)
-- end
-- end)
-- assert(handle, "Error running codelldb: " .. tostring(pid_or_err))
-- stdout:read_start(function(err, chunk)
-- assert(not err, err)
-- if chunk then
-- local port = chunk:match('Listening on port (%d+)')
-- if port then
-- vim.schedule(function()
-- on_adapter({
-- type = 'server',
-- host = '127.0.0.1',
-- port = port
-- })
-- end)
-- else
-- vim.schedule(function()
-- require("dap.repl").append(chunk)
-- end)
-- end
-- end
-- end)
-- stderr:read_start(function(err, chunk)
-- assert(not err, err)
-- if chunk then
-- vim.schedule(function()
-- require("dap.repl").append(chunk)
-- end)
-- end
-- end)
-- end
-- dap.configurations.cpp = {
-- {
-- name = "Launch file",
-- type = "codelldb",
-- request = "launch",
-- program = "D:/ftarroux/Documents/FRED/BaseGit/matisse_fred/build/bin/Debug/main_se_atmosphere.exe",
-- -- program = function()
-- -- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
-- -- end,
-- cwd = '${workspaceFolder}',
-- stopOnEntry = true,
-- },
-- }
dap.configurations.c = dap.configurations.cpp
dap.configurations.rust = dap.configurations.cpp
|
Beta Was this translation helpful? Give feedback.
-
& all dap.log with debug lvl 👍
|
Beta Was this translation helpful? Give feedback.
-
on vscode, everything seems to work normally with the same executables with this configs : |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem Statement
I have tried all the configuration proposed by the documentation to configure a cpp debugger on Windows (without WLS), but none of them seems to work. Could you give a configuration that works ?
i have tested :
1
Ideas or possible solutions
No response
Beta Was this translation helpful? Give feedback.
All reactions