simrat39 / rust-tools.nvim

Tools for better development in rust using neovim's builtin lsp
MIT License
2.17k stars 160 forks source link

DAP not working on macOS #437

Closed s1syph0s closed 8 months ago

s1syph0s commented 8 months ago

Hi,

I was trying do :RustDebuggable. After selecting a number, rust-tools tries to build my project, and run the debugger, but somehow the dapui closes immediately, although i have setted a breakpoint in my code. My current configuration works on Linux desktop, but on MacOS it's not working.. I installed the DAP using Mason, and the codelldb path is evaluated in code.

-- Rust tools setup with lazy
return {
    'simrat39/rust-tools.nvim',
    dependencies = { 'neovim/nvim-lspconfig', 'mfussenegger/nvim-dap', 'williamboman/mason.nvim' },
    config = function()
        local rt = require("rust-tools")
        local util = require("util")

        local on_attach = function(_, bufnr)
            util.on_attach(_, bufnr)
        end

        local mason_registry = require("mason-registry")
        local codelldb = mason_registry.get_package("codelldb") -- note that this will error if you provide a non-existent package name
        codelldb:get_install_path()                           -- returns a string like "/home/user/.local/share/nvim/mason/packages/codelldb"

        local extension_path = codelldb:get_install_path() .. "/extension/"
        local codelldb_path = extension_path .. "adapter/codelldb"
        local liblldb_path = extension_path .. "lldb/lib/liblldb.so"

        if vim.loop.os_uname().sysname == 'Darwin' then
            liblldb_path = extension_path .. "lldb/lib/liblldb.dylib"
        end

        local opts = {
            tools = { -- rust-tools options

                -- how to execute terminal commands
                -- options right now: termopen / quickfix / toggleterm / vimux
                --executor = require("rust-tools.executors").termopen,

                -- 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"
                on_initialized = nil,

                -- automatically call RustReloadWorkspace when writing to a Cargo.toml file.
                reload_workspace_from_cargo_toml = true,

                -- These apply to the default RustSetInlayHints command
                inlay_hints = {
                    -- automatically set inlay hints (type hints)
                    -- default: true
                    auto = true,

                    -- Only show inlay hints for the current line
                    only_current_line = false,

                    -- whether to show parameter hints with the inlay hints or not
                    -- default: true
                    show_parameter_hints = true,

                    -- prefix for parameter hints
                    -- default: "<-"
                    parameter_hints_prefix = "<- ",

                    -- prefix for all the other hints (type, chaining)
                    -- default: "=>"
                    other_hints_prefix = "=> ",

                    -- whether to align to the length of the longest line in the file
                    max_len_align = false,

                    -- padding from the left if max_len_align is true
                    max_len_align_padding = 1,

                    -- whether to align to the extreme right or not
                    right_align = false,

                    -- padding from the right if right_align is true
                    right_align_padding = 7,

                    -- The color of the hints
                    highlight = "Comment",
                },

                -- options same as lsp hover / vim.lsp.util.open_floating_preview()
                hover_actions = {

                    -- the border that is used for the hover window
                    -- see vim.api.nvim_open_win()
                    border = {
                        { "╭", "FloatBorder" },
                        { "─", "FloatBorder" },
                        { "╮", "FloatBorder" },
                        { "│", "FloatBorder" },
                        { "╯", "FloatBorder" },
                        { "─", "FloatBorder" },
                        { "╰", "FloatBorder" },
                        { "│", "FloatBorder" },
                    },

                    -- Maximal width of the hover window. Nil means no max.
                    max_width = nil,

                    -- Maximal height of the hover window. Nil means no max.
                    max_height = nil,

                    -- whether the hover action window gets automatically focused
                    -- default: false
                    auto_focus = false,
                },

                -- settings for showing the crate graph based on graphviz and the dot
                -- command
                crate_graph = {
                    -- Backend used for displaying the graph
                    -- see: https://graphviz.org/docs/outputs/
                    -- default: x11
                    backend = "x11",
                    -- where to store the output, nil for no output stored (relative
                    -- path from pwd)
                    -- default: nil
                    output = nil,
                    -- true for all crates.io and external crates, false only the local
                    -- crates
                    -- default: true
                    full = true,

                    -- List of backends found on: https://graphviz.org/docs/outputs/
                    -- Is used for input validation and autocompletion
                    -- Last updated: 2021-08-26
                    enabled_graphviz_backends = {
                        "bmp",
                        "cgimage",
                        "canon",
                        "dot",
                        "gv",
                        "xdot",
                        "xdot1.2",
                        "xdot1.4",
                        "eps",
                        "exr",
                        "fig",
                        "gd",
                        "gd2",
                        "gif",
                        "gtk",
                        "ico",
                        "cmap",
                        "ismap",
                        "imap",
                        "cmapx",
                        "imap_np",
                        "cmapx_np",
                        "jpg",
                        "jpeg",
                        "jpe",
                        "jp2",
                        "json",
                        "json0",
                        "dot_json",
                        "xdot_json",
                        "pdf",
                        "pic",
                        "pct",
                        "pict",
                        "plain",
                        "plain-ext",
                        "png",
                        "pov",
                        "ps",
                        "ps2",
                        "psd",
                        "sgi",
                        "svg",
                        "svgz",
                        "tga",
                        "tiff",
                        "tif",
                        "tk",
                        "vml",
                        "vmlz",
                        "wbmp",
                        "webp",
                        "xlib",
                        "x11",
                    },
                },
            },

            -- all the opts to send to nvim-lspconfig
            -- these override the defaults set by rust-tools.nvim
            -- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer
            server = {
                -- standalone file support
                -- setting it to false may improve startup time
                standalone = true,
                on_attach = on_attach,
            }, -- rust-analyzer options

            -- debugging stuff
            dap = {
                adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path)
            },
        }

        rt.setup(opts)
        -- enable inlay hints
        rt.inlay_hints.enable()
    end
}

I also tried to read the log of the DAP. In the end of the log I got an exit code -1, but I'm not really sure where it is coming from.

[ DEBUG ] 2023-12-06T15:00:35Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1165 ]    "Starting debug adapter server executable"  {
  args = { "--liblldb", "/Users/username/.local/share/nvim/mason/packages/codelldb/extension/lldb/lib/liblldb.dylib", "--port", "52378" },
  command = "/Users/username/.local/share/nvim/mason/packages/codelldb/extension/adapter/codelldb"
}
[ DEBUG ] 2023-12-06T15:00:35Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1295 ]    "Debug adapter server executable started, listening on 52378"
[ DEBUG ] 2023-12-06T15:00:35Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1299 ]    "Connecting to debug adapter"   {
  command = "lldb-vscode",
  executable = {
    args = { "--liblldb", "/Users/username/.local/share/nvim/mason/packages/codelldb/extension/lldb/lib/liblldb.dylib", "--port", "52378" },
    command = "/Users/username/.local/share/nvim/mason/packages/codelldb/extension/adapter/codelldb"
  },
  host = "127.0.0.1",
  name = "rt_lldb",
  port = 52378,
  type = "server"
}
[ DEBUG ] 2023-12-06T15:00:35Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1676 ]    "request"   {
  arguments = {
    adapterID = "nvim-dap",
    clientID = "neovim",
    clientName = "neovim",
    columnsStartAt1 = true,
    linesStartAt1 = true,
    locale = "de_DE.UTF-8",
    pathFormat = "path",
    supportsProgressReporting = true,
    supportsRunInTerminalRequest = true,
    supportsStartDebuggingRequest = true,
    supportsVariableType = true
  },
  command = "initialize",
  seq = 1,
  type = "request"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    exceptionBreakpointFilters = { {
        default = true,
        filter = "cpp_throw",
        label = "C++: on throw",
        supportsCondition = true
      }, {
        default = false,
        filter = "cpp_catch",
        label = "C++: on catch",
        supportsCondition = true
      } },
    supportTerminateDebuggee = true,
    supportsCancelRequest = true,
    supportsCompletionsRequest = true,
    supportsConditionalBreakpoints = true,
    supportsConfigurationDoneRequest = true,
    supportsDataBreakpoints = true,
    supportsDelayedStackTraceLoading = true,
    supportsDisassembleRequest = true,
    supportsEvaluateForHovers = true,
    supportsExceptionFilterOptions = true,
    supportsExceptionInfoRequest = true,
    supportsFunctionBreakpoints = true,
    supportsGotoTargetsRequest = true,
    supportsHitConditionalBreakpoints = true,
    supportsInstructionBreakpoints = true,
    supportsLogPoints = true,
    supportsReadMemoryRequest = true,
    supportsSetVariable = true,
    supportsSteppingGranularity = true,
    supportsWriteMemoryRequest = true
  },
  command = "initialize",
  request_seq = 1,
  seq = 1,
  success = true,
  type = "response"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1676 ]    "request"   {
  arguments = {
    args = {},
    cwd = "/Users/username/src/self/aoc-2023",
    name = "Rust tools debug",
    program = "/Users/username/src/self/aoc-2023/target/debug/day2",
    request = "launch",
    runInTerminal = false,
    stopOnEntry = false,
    type = "rt_lldb"
  },
  command = "launch",
  seq = 2,
  type = "request"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    category = "console",
    output = "Console is in 'commands' mode, prefix expressions with '?'.\n"
  },
  event = "output",
  seq = 2,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  event = "initialized",
  seq = 3,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    module = {
      addressRange = "FFFFFFFFFFFFFFFF",
      id = "FFFFFFFFFFFFFFFF",
      name = "day2",
      path = "/Users/username/src/self/aoc-2023/target/debug/day2",
      symbolFilePath = "/Users/username/src/self/aoc-2023/target/debug/day2",
      symbolStatus = "Symbols loaded."
    },
    reason = "new"
  },
  event = "module",
  seq = 4,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1676 ]    "request"   {
  arguments = {
    breakpoints = { {
        line = 11
      } },
    lines = { 11 },
    source = {
      name = "day2.rs",
      path = "/Users/username/src/self/aoc-2023/src/bin/day2.rs"
    },
    sourceModified = false
  },
  command = "setBreakpoints",
  seq = 3,
  type = "request"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  arguments = {
    args = { "/Users/username/.local/share/nvim/mason/packages/codelldb/extension/adapter/codelldb", "terminal-agent", "--connect=52381" },
    cwd = "",
    kind = "integrated",
    title = "Rust tools debug"
  },
  command = "runInTerminal",
  seq = 5,
  type = "request"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:208 ] "run_in_terminal"   {
  args = { "/Users/username/.local/share/nvim/mason/packages/codelldb/extension/adapter/codelldb", "terminal-agent", "--connect=52381" },
  cwd = "",
  kind = "integrated",
  title = "Rust tools debug"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1706 ]    "response"  {
  body = {
    processId = 15051
  },
  command = "runInTerminal",
  request_seq = 5,
  seq = 4,
  success = true,
  type = "response"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    breakpoints = { {
        id = 1,
        line = 11,
        message = "Resolved locations: 0",
        verified = true
      } }
  },
  command = "setBreakpoints",
  request_seq = 3,
  seq = 6,
  success = true,
  type = "response"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1676 ]    "request"   {
  arguments = {
    filters = { "cpp_throw" }
  },
  command = "setExceptionBreakpoints",
  seq = 5,
  type = "request"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  command = "setExceptionBreakpoints",
  request_seq = 5,
  seq = 7,
  success = true,
  type = "response"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1676 ]    "request"   {
  command = "configurationDone",
  seq = 6,
  type = "request"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    category = "console",
    output = "Launching: /Users/username/src/self/aoc-2023/target/debug/day2\n"
  },
  event = "output",
  seq = 8,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    category = "console",
    output = "Launched process 15052\n"
  },
  event = "output",
  seq = 9,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  command = "launch",
  request_seq = 2,
  seq = 10,
  success = true,
  type = "response"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  command = "configurationDone",
  request_seq = 6,
  seq = 11,
  success = true,
  type = "response"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    module = {
      id = "100000000",
      name = ""
    },
    reason = "removed"
  },
  event = "module",
  seq = 12,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    breakpoint = {
      id = 1,
      line = 11,
      message = "Resolved locations: 2",
      verified = true
    },
    reason = "changed"
  },
  event = "breakpoint",
  seq = 13,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    breakpoint = {
      id = 1,
      line = 11,
      message = "Resolved locations: 2",
      verified = true
    },
    reason = "changed"
  },
  event = "breakpoint",
  seq = 14,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    module = {
      addressRange = "1000A4000",
      id = "1000A4000",
      name = "dyld",
      path = "/usr/lib/dyld",
      symbolFilePath = "/usr/lib/dyld",
      symbolStatus = "Symbols loaded."
    },
    reason = "new"
  },
  event = "module",
  seq = 15,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    module = {
      addressRange = "100000000",
      id = "100000000",
      name = "day2",
      path = "/Users/username/src/self/aoc-2023/target/debug/day2",
      symbolFilePath = "/Users/username/src/self/aoc-2023/target/debug/day2",
      symbolStatus = "Symbols loaded."
    },
    reason = "new"
  },
  event = "module",
  seq = 16,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    allThreadsContinued = true,
    threadId = 146271
  },
  event = "continued",
  seq = 17,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    module = {
      id = "FFFFFFFFFFFFFFFF",
      name = ""
    },
    reason = "removed"
  },
  event = "module",
  seq = 18,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    breakpoint = {
      id = 1,
      line = 11,
      message = "Resolved locations: 1",
      verified = true
    },
    reason = "changed"
  },
  event = "breakpoint",
  seq = 19,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    breakpoint = {
      id = 1,
      line = 11,
      message = "Resolved locations: 2",
      verified = true
    },
    reason = "changed"
  },
  event = "breakpoint",
  seq = 20,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    module = {
      addressRange = "7FF81331F000",
      id = "7FF81331F000",
      name = "dyld",
      path = "/usr/lib/dyld",
      symbolFilePath = "/usr/lib/dyld",
      symbolStatus = "Symbols loaded."
    },
    reason = "new"
  },
  event = "module",
  seq = 21,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    module = {
      addressRange = "100000000",
      id = "100000000",
      name = "day2",
      path = "/Users/username/src/self/aoc-2023/target/debug/day2",
      symbolFilePath = "/Users/username/src/self/aoc-2023/target/debug/day2",
      symbolStatus = "Symbols loaded."
    },
    reason = "new"
  },
  event = "module",
  seq = 22,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    category = "console",
    output = "Process exited with code -1.\n"
  },
  event = "output",
  seq = 23,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = {
    exitCode = -1
  },
  event = "exited",
  seq = 24,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:00:36Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 2   {
  body = vim.empty_dict(),
  event = "terminated",
  seq = 25,
  type = "event"
}

[ DEBUG ] 2023-12-06T15:09:02Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1165 ]    "Starting debug adapter server executable"  {
  args = { "--liblldb", "/Users/username/.local/share/nvim/mason/packages/codelldb/extension/lldb/lib/liblldb.dylib", "--port", "52508" },
  command = "/Users/username/.local/share/nvim/mason/packages/codelldb/extension/adapter/codelldb"
}
[ DEBUG ] 2023-12-06T15:09:02Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1295 ]    "Debug adapter server executable started, listening on 52508"
[ DEBUG ] 2023-12-06T15:09:02Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1299 ]    "Connecting to debug adapter"   {
  command = "lldb-vscode",
  executable = {
    args = { "--liblldb", "/Users/username/.local/share/nvim/mason/packages/codelldb/extension/lldb/lib/liblldb.dylib", "--port", "52508" },
    command = "/Users/username/.local/share/nvim/mason/packages/codelldb/extension/adapter/codelldb"
  },
  host = "127.0.0.1",
  name = "rt_lldb",
  port = 52508,
  type = "server"
}
[ DEBUG ] 2023-12-06T15:09:02Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1676 ]    "request"   {
  arguments = {
    adapterID = "nvim-dap",
    clientID = "neovim",
    clientName = "neovim",
    columnsStartAt1 = true,
    linesStartAt1 = true,
    locale = "de_DE.UTF-8",
    pathFormat = "path",
    supportsProgressReporting = true,
    supportsRunInTerminalRequest = true,
    supportsStartDebuggingRequest = true,
    supportsVariableType = true
  },
  command = "initialize",
  seq = 1,
  type = "request"
}
[ DEBUG ] 2023-12-06T15:09:02Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  body = {
    exceptionBreakpointFilters = { {
        default = true,
        filter = "cpp_throw",
        label = "C++: on throw",
        supportsCondition = true
      }, {
        default = false,
        filter = "cpp_catch",
        label = "C++: on catch",
        supportsCondition = true
      } },
    supportTerminateDebuggee = true,
    supportsCancelRequest = true,
    supportsCompletionsRequest = true,
    supportsConditionalBreakpoints = true,
    supportsConfigurationDoneRequest = true,
    supportsDataBreakpoints = true,
    supportsDelayedStackTraceLoading = true,
    supportsDisassembleRequest = true,
    supportsEvaluateForHovers = true,
    supportsExceptionFilterOptions = true,
    supportsExceptionInfoRequest = true,
    supportsFunctionBreakpoints = true,
    supportsGotoTargetsRequest = true,
    supportsHitConditionalBreakpoints = true,
    supportsInstructionBreakpoints = true,
    supportsLogPoints = true,
    supportsReadMemoryRequest = true,
    supportsSetVariable = true,
    supportsSteppingGranularity = true,
    supportsWriteMemoryRequest = true
  },
  command = "initialize",
  request_seq = 1,
  seq = 1,
  success = true,
  type = "response"
}
[ DEBUG ] 2023-12-06T15:09:02Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1676 ]    "request"   {
  arguments = {
    args = {},
    cwd = "/Users/username/src/self/aoc-2023",
    name = "Rust tools debug",
    program = "/Users/username/src/self/aoc-2023/target/debug/day2",
    request = "launch",
    runInTerminal = false,
    stopOnEntry = false,
    type = "rt_lldb"
  },
  command = "launch",
  seq = 2,
  type = "request"
}
[ DEBUG ] 2023-12-06T15:09:02Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  body = {
    category = "console",
    output = "Console is in 'commands' mode, prefix expressions with '?'.\n"
  },
  event = "output",
  seq = 2,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:09:02Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  event = "initialized",
  seq = 3,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:09:02Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  body = {
    module = {
      addressRange = "FFFFFFFFFFFFFFFF",
      id = "FFFFFFFFFFFFFFFF",
      name = "day2",
      path = "/Users/username/src/self/aoc-2023/target/debug/day2",
      symbolFilePath = "/Users/username/src/self/aoc-2023/target/debug/day2",
      symbolStatus = "Symbols loaded."
    },
    reason = "new"
  },
  event = "module",
  seq = 4,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:09:02Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1676 ]    "request"   {
  arguments = {
    filters = { "cpp_throw" }
  },
  command = "setExceptionBreakpoints",
  seq = 3,
  type = "request"
}
[ DEBUG ] 2023-12-06T15:09:02Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  arguments = {
    args = { "/Users/username/.local/share/nvim/mason/packages/codelldb/extension/adapter/codelldb", "terminal-agent", "--connect=52511" },
    cwd = "",
    kind = "integrated",
    title = "Rust tools debug"
  },
  command = "runInTerminal",
  seq = 5,
  type = "request"
}
[ DEBUG ] 2023-12-06T15:09:02Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:208 ] "run_in_terminal"   {
  args = { "/Users/username/.local/share/nvim/mason/packages/codelldb/extension/adapter/codelldb", "terminal-agent", "--connect=52511" },
  cwd = "",
  kind = "integrated",
  title = "Rust tools debug"
}
[ DEBUG ] 2023-12-06T15:09:02Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1706 ]    "response"  {
  body = {
    processId = 16147
  },
  command = "runInTerminal",
  request_seq = 5,
  seq = 4,
  success = true,
  type = "response"
}
[ DEBUG ] 2023-12-06T15:09:02Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  command = "setExceptionBreakpoints",
  request_seq = 3,
  seq = 6,
  success = true,
  type = "response"
}
[ DEBUG ] 2023-12-06T15:09:02Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1676 ]    "request"   {
  command = "configurationDone",
  seq = 5,
  type = "request"
}
[ DEBUG ] 2023-12-06T15:09:02Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  body = {
    category = "console",
    output = "Launching: /Users/username/src/self/aoc-2023/target/debug/day2\n"
  },
  event = "output",
  seq = 7,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:09:03Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  body = {
    category = "console",
    output = "Launched process 16148\n"
  },
  event = "output",
  seq = 8,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:09:03Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  command = "launch",
  request_seq = 2,
  seq = 9,
  success = true,
  type = "response"
}
[ DEBUG ] 2023-12-06T15:09:03Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  command = "configurationDone",
  request_seq = 5,
  seq = 10,
  success = true,
  type = "response"
}
[ DEBUG ] 2023-12-06T15:09:03Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  body = {
    module = {
      id = "100000000",
      name = ""
    },
    reason = "removed"
  },
  event = "module",
  seq = 11,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:09:03Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  body = {
    module = {
      addressRange = "1000A4000",
      id = "1000A4000",
      name = "dyld",
      path = "/usr/lib/dyld",
      symbolFilePath = "/usr/lib/dyld",
      symbolStatus = "Symbols loaded."
    },
    reason = "new"
  },
  event = "module",
  seq = 12,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:09:03Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  body = {
    module = {
      addressRange = "100000000",
      id = "100000000",
      name = "day2",
      path = "/Users/username/src/self/aoc-2023/target/debug/day2",
      symbolFilePath = "/Users/username/src/self/aoc-2023/target/debug/day2",
      symbolStatus = "Symbols loaded."
    },
    reason = "new"
  },
  event = "module",
  seq = 13,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:09:03Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  body = {
    allThreadsContinued = true,
    threadId = 154295
  },
  event = "continued",
  seq = 14,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:09:03Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  body = {
    module = {
      id = "FFFFFFFFFFFFFFFF",
      name = ""
    },
    reason = "removed"
  },
  event = "module",
  seq = 15,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:09:03Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  body = {
    module = {
      addressRange = "7FF81331F000",
      id = "7FF81331F000",
      name = "dyld",
      path = "/usr/lib/dyld",
      symbolFilePath = "/usr/lib/dyld",
      symbolStatus = "Symbols loaded."
    },
    reason = "new"
  },
  event = "module",
  seq = 16,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:09:03Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  body = {
    module = {
      addressRange = "100000000",
      id = "100000000",
      name = "day2",
      path = "/Users/username/src/self/aoc-2023/target/debug/day2",
      symbolFilePath = "/Users/username/src/self/aoc-2023/target/debug/day2",
      symbolStatus = "Symbols loaded."
    },
    reason = "new"
  },
  event = "module",
  seq = 17,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:09:03Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  body = {
    category = "console",
    output = "Process exited with code -1.\n"
  },
  event = "output",
  seq = 18,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:09:03Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  body = {
    exitCode = -1
  },
  event = "exited",
  seq = 19,
  type = "event"
}
[ DEBUG ] 2023-12-06T15:09:03Z+0100 ] ...name/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:950 ] 1   {
  body = vim.empty_dict(),
  event = "terminated",
  seq = 20,
  type = "event"
}
s1syph0s commented 8 months ago

Solved.

This is related to codelldb problem for MacOS Sonoma. From codelldb discussion: https://github.com/vadimcn/codelldb/discussions/456#discussioncomment-874122