I built gdb 14.1 from source as it is not available on Ubuntu 22.04 (running on WSL2). I built it with the --with-python=/usr/bin/python3 flag.
I load it in a lazy-nvim config file.
local dapui = require("dapui")
dapui.setup()
local dap = require("dap")
-- dapui configuration...
-- ...
dap.adapters.gdb = {
type = "executable",
command = "gdb",
args = { "-i", "dap" },
}
dap.configurations.c = {
{
name = "Launch",
type = "gdb",
request = "launch",
linux = {
MIMode = "gdb",
miDebuggerPath = "/usr/local/bin/gdb"
},
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
cwd = "${workspaceFolder}",
},
}
Debug adapter version
14.1
Steps to Reproduce
I run :DapContinue on a c file.
The debugger starts and runs fine.
Once the program ends, it throws a python error.
Expected Result
I would expect it to shutdown the same way gdb would in the terminal.
[Inferior 1 (process 207571) exited normally]
Actual Result
This immediately follows the output of the program.
Exception in thread DAP:
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/share/gdb/python/gdb/dap/startup.py", line 51, in really_start_dap
target()
File "/usr/local/share/gdb/python/gdb/dap/startup.py", line 73, in ensure_dap_thread
return func(*args, **kwargs)
File "/usr/local/share/gdb/python/gdb/dap/server.py", line 117, in main_loop
cmd = read_json(self.in_stream)
File "/usr/local/share/gdb/python/gdb/dap/io.py", line 37, in read_json
while len(data) < content_length:
TypeError: '<' not supported between instances of 'int' and 'NoneType'
Debug adapter definition and debug configuration
I built gdb 14.1 from source as it is not available on Ubuntu 22.04 (running on WSL2). I built it with the
--with-python=/usr/bin/python3
flag.I load it in a lazy-nvim config file.
Debug adapter version
14.1
Steps to Reproduce
:DapContinue
on a c file.Expected Result
I would expect it to shutdown the same way gdb would in the terminal.
[Inferior 1 (process 207571) exited normally]
Actual Result
This immediately follows the output of the program.
dap.log contents for the error