|
1 | 1 | local dap = require("dap")
|
2 |
| - |
3 |
| -dap.adapters.codelldb = { |
4 |
| - type = "server", |
5 |
| - port = "${port}", |
6 |
| - executable = { |
7 |
| - -- CHANGE THIS to your path! |
8 |
| - command = "/absolute/path/to/codelldb/extension/adapter/codelldb", |
9 |
| - args = { "--port", "${port}" }, |
10 |
| - |
11 |
| - -- On windows you may have to uncomment this: |
12 |
| - -- detached = false, |
13 |
| - }, |
14 |
| -} |
15 |
| - |
16 | 2 | dap.configurations.cpp = {
|
17 | 3 | {
|
18 | 4 | name = "Launch file",
|
19 |
| - type = "codelldb", |
| 5 | + type = "cppdbg", |
20 | 6 | request = "launch",
|
21 | 7 | program = function()
|
22 | 8 | return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
23 | 9 | end,
|
24 | 10 | cwd = "${workspaceFolder}",
|
25 |
| - stopOnEntry = false, |
| 11 | + stopAtEntry = true, |
| 12 | + setupCommands = { |
| 13 | + { |
| 14 | + text = "-enable-pretty-printing", |
| 15 | + description = "enable pretty printing", |
| 16 | + ignoreFailures = false, |
| 17 | + }, |
| 18 | + }, |
| 19 | + }, |
| 20 | + { |
| 21 | + name = "Attach to gdbserver :3000", |
| 22 | + type = "cppdbg", |
| 23 | + request = "launch", |
| 24 | + MIMode = "gdb", |
| 25 | + miDebuggerServerAddress = "localhost:3000", |
| 26 | + miDebuggerPath = "/usr/bin/gdb", |
| 27 | + cwd = "${workspaceFolder}", |
| 28 | + program = function() |
| 29 | + return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") |
| 30 | + end, |
| 31 | + setupCommands = { |
| 32 | + { |
| 33 | + text = "-enable-pretty-printing", |
| 34 | + description = "enable pretty printing", |
| 35 | + ignoreFailures = false, |
| 36 | + }, |
| 37 | + }, |
26 | 38 | },
|
27 | 39 | }
|
0 commit comments