From 88151493b489ef8381ed001f2530ca40c26a4097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Thu, 14 Apr 2022 10:22:09 +0200 Subject: [PATCH] Add additional dap configurations for lldb --- symlinks/config/nvim/plugin/dap.lua | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/symlinks/config/nvim/plugin/dap.lua b/symlinks/config/nvim/plugin/dap.lua index f926a19..afa7798 100644 --- a/symlinks/config/nvim/plugin/dap.lua +++ b/symlinks/config/nvim/plugin/dap.lua @@ -86,6 +86,37 @@ dap.configurations.cpp = { -- 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"} + }, + { + name = "Launch with args", + type = "lldb", + request = "launch", + program = function() + return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") + end, + cwd = "${workspaceFolder}", + stopOnEntry = false, + args = function() + return vim.split(vim.fn.input("Args: "), " ") + end, + runInTerminal = false, + postRunCommands = {"process handle -p true -s false -n false SIGWINCH"} + }, + { + name = "Attach to process", + type = "lldb", + request = "attach", + pid = require("dap.utils").pick_process, + args = {} + }, + { + name = "Attach to PID", + type = "lldb", + request = "attach", + pid = function() + return tonumber(vim.fn.input("PID: ")) + end, + args = {} } }