From dcc9122da99afb653fc92129756222f3bd0c58e7 Mon Sep 17 00:00:00 2001 From: Andy Teijelo Date: Thu, 20 Oct 2022 01:57:40 -0400 Subject: [PATCH] debug rust with codelldb; manual call required --- init.lua | 4 ++-- lua/user/dap.lua | 48 +++++++++++++++++++++++--------------------- lua/user/keymaps.lua | 38 +++++++++++++++++------------------ lua/user/plugins.lua | 10 ++++----- 4 files changed, 51 insertions(+), 49 deletions(-) diff --git a/init.lua b/init.lua index ed0afa1..7d751f6 100644 --- a/init.lua +++ b/init.lua @@ -21,8 +21,8 @@ require "user.impatient" require "user.illuminate" require "user.indentline" require "user.lsp" ---require "user.dap" +require "user.dap" require "user.exrc" -require "user.vimspector" +--require "user.vimspector" require "user.fidget" diff --git a/lua/user/dap.lua b/lua/user/dap.lua index ff17663..d68c956 100644 --- a/lua/user/dap.lua +++ b/lua/user/dap.lua @@ -16,24 +16,26 @@ end dap_install.setup {} dap_install.config("python", {}) +dap_install.config("codelldb", {}) -- add other configs here -dapui.setup { - sidebar = { - elements = { - { - id = "scopes", - size = 0.25, -- Can be float or integer > 1 - }, - { id = "breakpoints", size = 0.25 }, - }, - size = 40, - position = "right", -- Can be "left", "right", "top", "bottom" - }, - tray = { - elements = {}, - }, -} +dapui.setup() +--dapui.setup { +-- sidebar = { +-- elements = { +-- { +-- id = "scopes", +-- size = 0.25, -- Can be float or integer > 1 +-- }, +-- { id = "breakpoints", size = 0.25 }, +-- }, +-- size = 40, +-- position = "right", -- Can be "left", "right", "top", "bottom" +-- }, +-- tray = { +-- elements = {}, +-- }, +--} vim.fn.sign_define("DapBreakpoint", { text = "●", texthl = "DiagnosticSignError", linehl = "", numhl = "" }) @@ -53,11 +55,11 @@ local codelldb_path = "/usr/lib/codelldb/adapter/codelldb" local liblldb_path = "/usr/lib/codelldb/adapter/libcodelldb.so" dap.adapters.codelldb = { - type = 'server', - host = '127.0.0.1', - port = "13000", - executable = { - command = codelldb_path, - args = {"--liblldb", liblldb_path, "--port", "13000"}, - } + type = 'server', + host = '127.0.0.1', + port = "13000", + executable = { + command = codelldb_path, + args = {"--liblldb", liblldb_path, "--port", "13000", "--params", "{\"showDisassembly\": \"never\"}"}, + } } diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index 28b4ff5..6b3da55 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -77,23 +77,23 @@ keymap("n", "fb", ":Telescope buffers", opts) keymap("n", "/", "lua require('Comment.api').toggle_current_linewise()", opts) keymap("x", "/", 'lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())') ----- DAP ---keymap("n", "", "lua require'dap'.toggle_breakpoint()", opts) ---keymap("n", "", "lua require'dap'.continue()", opts) ---keymap("n", "", "lua require'dap'.step_over()", opts) ---keymap("n", "", "lua require'dap'.step_into()", opts) ---keymap("n", "", "lua require'dap'.step_out()", opts) ---keymap("n", "dr", "lua require'dap'.repl.toggle()", opts) ---keymap("n", "dl", "lua require'dap'.run_last()", opts) ---keymap("n", "du", "lua require'dapui'.toggle()", opts) ---keymap("n", "", "lua require'dap'.terminate()", opts) +-- DAP +keymap("n", "", "lua require'dap'.toggle_breakpoint()", opts) +keymap("n", "", "lua require'dap'.continue()", opts) +keymap("n", "", "lua require'dap'.step_over()", opts) +keymap("n", "", "lua require'dap'.step_into()", opts) +keymap("n", "", "lua require'dap'.step_out()", opts) +keymap("n", "dr", "lua require'dap'.repl.toggle()", opts) +keymap("n", "dl", "lua require'dap'.run_last()", opts) +keymap("n", "du", "lua require'dapui'.toggle()", opts) +keymap("n", "", "lua require'dap'.terminate()", opts) -- Shift+F5 --- Vimspector -keymap("n", "", "VimspectorToggleBreakpoint", opts) -keymap("n", "", "VimspectorContinue", opts) -keymap("n", "", "VimspectorStepOver", opts) -keymap("n", "", "VimspectorStepInto", opts) -keymap("n", "", "VimspectorStepOut", opts) -keymap("n", "", "VimspectorReset", opts) -- Shift+F5 -keymap("n", "", "VimspectorRestart", opts) -- Ctrl+Shift+F5 -keymap("n", "di", "VimspectorBalloonEval", opts) +---- Vimspector +--keymap("n", "", "VimspectorToggleBreakpoint", opts) +--keymap("n", "", "VimspectorContinue", opts) +--keymap("n", "", "VimspectorStepOver", opts) +--keymap("n", "", "VimspectorStepInto", opts) +--keymap("n", "", "VimspectorStepOut", opts) +--keymap("n", "", "VimspectorReset", opts) -- Shift+F5 +--keymap("n", "", "VimspectorRestart", opts) -- Ctrl+Shift+F5 +--keymap("n", "di", "VimspectorBalloonEval", opts) diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index 8a41818..7ca29f0 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -101,16 +101,16 @@ return packer.startup(function(use) -- Git use { "lewis6991/gitsigns.nvim", commit = "f98c85e7c3d65a51f45863a34feb4849c82f240f" } - ---- DAP - --use { "mfussenegger/nvim-dap", commit = "014ebd53612cfd42ac8c131e6cec7c194572f21d" } - --use { "rcarriga/nvim-dap-ui", commit = "d76d6594374fb54abf2d94d6a320f3fd6e9bb2f7" } - --use { "ravenxrz/DAPInstall.nvim", commit = "8798b4c36d33723e7bba6ed6e2c202f84bb300de" } + -- DAP + use { "mfussenegger/nvim-dap", commit = "014ebd53612cfd42ac8c131e6cec7c194572f21d" } + use { "rcarriga/nvim-dap-ui", commit = "d76d6594374fb54abf2d94d6a320f3fd6e9bb2f7" } + use { "ravenxrz/DAPInstall.nvim", commit = "8798b4c36d33723e7bba6ed6e2c202f84bb300de" } use { "MunifTanjim/exrc.nvim" } use { "simrat39/rust-tools.nvim" } -- VimSpector - use { "puremourning/vimspector" } + --use { "puremourning/vimspector" } use { "j-hui/fidget.nvim", commit = "1097a86db8ba38e390850dc4035a03ed234a4673" }