mfussenegger / nvim-dap

Debug Adapter Protocol client implementation for Neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

adapter vscode cppdbg doesn't work on Windows

liuyangzys opened this issue · comments

Debug adapter definition and debug configuration

The cppdbg config is as shown bellow

dap.adapters.cppdbg = {
	id = "cppdbg",
	type = "executable",
	command = "C:/Users/liuya/.vscode/extensions/ms-vscode.cpptools-1.9.7/debugAdapters/bin/OpenDebugAD7",
}
dap.configurations.c = {}
dap.configurations.cpp = {}

-- load from json file
require("dap.ext.vscode").load_launchjs(nil, { cppdbg = { "c", "cpp" }, python = { "python" } })

The "./vscode/launch.json" file is as shown bellow

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) 启动",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/a.exe",
            "args": [],
            "stopAtEntry": true,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "setupCommands": [
                {
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

Debug adapter version

vscode-cpptools 1.9.7

Steps to Reproduce

  1. write a a.c and build it by "gcc -g -o a.exe"
  2. debug a.exe with "nvim-dap", "vscode", "vimspector"
  3. both "vscode" and "vimspector" can work correctly, but "nvim-dap" failed
    image

Expected Result

The debug can work correctly.

Actual Result

[ ERROR ] 2022-04-12T15:47:42Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:827 ] "stderr"       {  command = "C:/Users/liuya/.vscode/extensions/ms-vscode.cpptools-1.9.7/debugAdapters/bin/OpenDebugAD7",
  id = "cppdbg",
  type = "executable"
}       "waiting for v8 protocol on stdin/stdout\r\n"
[ INFO ] 2022-04-12T15:47:42Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:795 ]  "Closed all handles"
[ INFO ] 2022-04-12T15:47:42Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:798 ]  "Process closed40852    false
[ INFO ] 2022-04-12T15:47:43Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:1058 ] "Session closed due to disconnect"

Can you show the log output with the log level set to TRACE ?

Thanks for your help!

Here is my log of TRACE level.

[ INFO ] 2022-04-14T18:04:57Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:1058 ]	"Session closed due to disconnect"
[ DEBUG ] 2022-04-14T18:05:43Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:776 ]	"Spawning debug adapter"	{
  command = "C:/Users/liuya/.vscode/extensions/ms-vscode.cpptools-1.9.7/debugAdapters/bin/OpenDebugAD7",
  id = "cppdbg",
  type = "executable"
}
[ DEBUG ] 2022-04-14T18:05:43Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:965 ]	"request"	{
  arguments = {
    adapterID = "cppdbg",
    clientId = "neovim",
    clientname = "neovim",
    columnsStartAt1 = true,
    linesStartAt1 = true,
    locale = "en_US",
    pathFormat = "path",
    supportsRunInTerminalRequest = true,
    supportsVariableType = true
  },
  command = "initialize",
  seq = 0,
  type = "request"
}
[ ERROR ] 2022-04-14T18:05:43Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:827 ]	"stderr"	{
  command = "C:/Users/liuya/.vscode/extensions/ms-vscode.cpptools-1.9.7/debugAdapters/bin/OpenDebugAD7",
  id = "cppdbg",
  type = "executable"
}	"waiting for v8 protocol on stdin/stdout\r\n"
[ INFO ] 2022-04-14T18:05:43Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:795 ]	"Closed all handles"
[ INFO ] 2022-04-14T18:05:43Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:798 ]	"Process closed"	37748	false

I know it seems like a problem of vscode-cpp, but vimspector does work. And the config file of vimspector is almost the same with nvim-dap. The .vimspector.json file is as follows

{
    "configurations": {
        "cpp:launch": {
            "adapter": "vscode-cpptools",
            "configuration": {
                "name": "cpp:launch",
                "stopAtEntry": true,
                "type": "cppdbg",
                "request": "launch",
                "program": "${workspaceRoot}/a.exe",
                "args": [],
                "cwd": "${workspaceRoot}",
                "environment": [],
                "externalConsole": true,
                "breakpointers": {
                    "exception": {
                        "cpp_throw": "Y",
                        "cpp_catch": "N"
                    }
                }
            }
        }
    }
}

Does vimspector provide logs of the message flow? would be interesting to see the difference.

Hers is some debug info of vimspector

Vimspector Debug Info
--------------------------------------------------------------------------------
ConnectionType: neojob
Adapter: 
--------------------------------------------------------------------------------
{
  "attach": {
    "pidProperty": "processId",
    "pidSelect": "ask"
  },
  "command": [
    "C:\\Users\\liuya\\AppData\\Local\\nvim-data\\site\\pack\\packer\\opt\\vimspector\\gadgets\\windows/vscode-cpptools/debugAdapters/bin/OpenDebugAD7.exe"
  ],
  "configuration": {
    "MIDebuggerPath": "gdb.exe",
    "MIMode": "gdb",
    "args": [],
    "cwd": "C:\\Users\\liuya\\Desktop\\test",
    "environment": [],
    "type": "cppdbg"
  },
  "name": "cppdbg",
  "env": {},
  "cwd": "C:\\Users\\liuya\\Desktop\\test"
}
--------------------------------------------------------------------------------
Configuration: 
--------------------------------------------------------------------------------
{
  "adapter": "vscode-cpptools",
  "configuration": {
    "name": "cpp:launch",
    "stopAtEntry": true,
    "type": "cppdbg",
    "request": "launch",
    "program": "C:\\Users\\liuya\\Desktop\\test/a.exe",
    "args": [],
    "cwd": "C:\\Users\\liuya\\Desktop\\test",
    "environment": [],
    "externalConsole": true,
    "breakpointers": {
      "exception": {
        "cpp_throw": "Y",
        "cpp_catch": "N"
      }
    }
  }
}
--------------------------------------------------------------------------------
API Prefix: neo
Launch/Init: True / True
Workspace Root: C:\Users\liuya\Desktop\test
Launch Config: 
--------------------------------------------------------------------------------
{
  "MIDebuggerPath": "gdb.exe",
  "MIMode": "gdb",
  "args": [],
  "cwd": "C:\\Users\\liuya\\Desktop\\test",
  "environment": [],
  "type": "cppdbg",
  "name": "cpp:launch",
  "stopAtEntry": true,
  "request": "launch",
  "program": "C:\\Users\\liuya\\Desktop\\test/a.exe",
  "externalConsole": true,
  "breakpointers": {
    "exception": {
      "cpp_throw": "Y",
      "cpp_catch": "N"
    }
  }
}
--------------------------------------------------------------------------------
Server Capabilities: 
--------------------------------------------------------------------------------
{
  "supportsConfigurationDoneRequest": true,
  "supportsFunctionBreakpoints": true,
  "supportsConditionalBreakpoints": true,
  "supportsEvaluateForHovers": true,
  "exceptionBreakpointFilters": [],
  "supportsSetVariable": true,
  "supportsGotoTargetsRequest": true,
  "completionTriggerCharacters": [],
  "supportsModulesRequest": true,
  "supportedChecksumAlgorithms": [],
  "supportsValueFormattingOptions": true,
  "supportsLogPoints": true,
  "supportsReadMemoryRequest": true,
  "supportsDisassembleRequest": true,
  "supportsClipboardContext": true,
  "supportsSteppingGranularity": true,
  "supportsInstructionBreakpoints": true
}
--------------------------------------------------------------------------------
Line Breakpoints: 
--------------------------------------------------------------------------------
{
  "c:\\Users\\liuya\\Desktop\\test\\a.c": []
}
--------------------------------------------------------------------------------
Func Breakpoints: 
--------------------------------------------------------------------------------
[]
--------------------------------------------------------------------------------
Ex Breakpoints: 
None

Could you try changing the adapters command to use the same executable that vimspector uses? (The OpenDebugAD7.exe)

Based on the logs, nvim-dap is doing the right thing. The client must send an initialize request and wait for a response before doing anything else. If the debug adapter sends no response there is either something wrong with the command used in the adapter definition or something with the initialise request could be wrong, but it looks alright.

I have tried to use the same OpenDebugAD7.exe that vimspector uses. Here is the log.

[ DEBUG ] 2022-04-14T19:14:53Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:776 ]	"Spawning debug adapter"	{
  command = "C:/Users/liuya/AppData/Local/nvim-data/site/pack/packer/opt/vimspector/gadgets/windows/vscode-cpptools/debugAdapters/bin/OpenDebugAD7.exe",
  id = "cppdbg",
  type = "executable"
}
[ DEBUG ] 2022-04-14T19:14:53Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:965 ]	"request"	{
  arguments = {
    adapterID = "cppdbg",
    clientId = "neovim",
    clientname = "neovim",
    columnsStartAt1 = true,
    linesStartAt1 = true,
    locale = "en_US",
    pathFormat = "path",
    supportsRunInTerminalRequest = true,
    supportsVariableType = true
  },
  command = "initialize",
  seq = 0,
  type = "request"
}
[ ERROR ] 2022-04-14T19:14:53Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:827 ]	"stderr"	{
  command = "C:/Users/liuya/AppData/Local/nvim-data/site/pack/packer/opt/vimspector/gadgets/windows/vscode-cpptools/debugAdapters/bin/OpenDebugAD7.exe",
  id = "cppdbg",
  type = "executable"
}	"waiting for v8 protocol on stdin/stdout\r\n"
[ INFO ] 2022-04-14T19:14:53Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:795 ]	"Closed all handles"
[ INFO ] 2022-04-14T19:14:53Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:798 ]	"Process closed"	40716	false

Can you checkout #514 and adjust your adapter configuration to the following and then try again?

dap.adapters.cppdbg = {
	id = "cppdbg",
	type = "executable",
	command = "C:/Users/liuya/.vscode/extensions/ms-vscode.cpptools-1.9.7/debugAdapters/bin/OpenDebugAD7",
        options = { detached = false },
}

(Or OpenDebugAD7.exe ?)

It looks like nothing has changed, also OpenDebugAD7.exe

[ DEBUG ] 2022-04-15T10:38:56Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:965 ]	"request"	{
  arguments = {
    restart = false,
    terminateDebuggee = true
  },
  command = "disconnect",
  seq = 1,
  type = "request"
}
[ DEBUG ] 2022-04-15T10:38:59Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:965 ]	"request"	{
  arguments = {
    restart = false,
    terminateDebuggee = true
  },
  command = "disconnect",
  seq = 2,
  type = "request"
}
[ INFO ] 2022-04-15T10:38:59Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:1058 ]	"Session closed due to disconnect"
[ DEBUG ] 2022-04-15T10:39:00Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:776 ]	"Spawning debug adapter"	{
  command = "C:/Users/liuya/.vscode/extensions/ms-vscode.cpptools-1.9.7/debugAdapters/bin/OpenDebugAD7",
  id = "cppdbg",
  options = {
    detached = false
  },
  type = "executable"
}
[ DEBUG ] 2022-04-15T10:39:00Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:965 ]	"request"	{
  arguments = {
    adapterID = "cppdbg",
    clientId = "neovim",
    clientname = "neovim",
    columnsStartAt1 = true,
    linesStartAt1 = true,
    locale = "en_US",
    pathFormat = "path",
    supportsRunInTerminalRequest = true,
    supportsVariableType = true
  },
  command = "initialize",
  seq = 0,
  type = "request"
}
[ ERROR ] 2022-04-15T10:39:00Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:827 ]	"stderr"	{
  command = "C:/Users/liuya/.vscode/extensions/ms-vscode.cpptools-1.9.7/debugAdapters/bin/OpenDebugAD7",
  id = "cppdbg",
  options = {
    detached = false
  },
  type = "executable"
}	"waiting for v8 protocol on stdin/stdout\r\n"
[ INFO ] 2022-04-15T10:39:00Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:795 ]	"Closed all handles"
[ INFO ] 2022-04-15T10:39:00Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:798 ]	"Process closed"	27184	false
[ INFO ] 2022-04-15T10:39:02Z+0800 ] ...m-data\site\pack\packer\opt\nvim-dap/lua/dap/session.lua:1058 ]	"Session closed due to disconnect"

This is odd, for me it worked with the change. Are you sure you had checked out the branch with the changes from the PR? I merged it now also to master.

Here's the config I used:

local dap = require('dap')
dap.adapters.cppdbg = {
  command = 'C:\\Users\\fmath\\Downloads\\ms-vscode.cpptools-1.9.7@win32-x64\\extension\\debugAdapters\\bin\\OpenDebugAD7.exe',
  id = 'cppdbg',
  type = 'executable',
  options = { detached = false },
}

dap.configurations.c = {
  {
    name = "Launch file",
    type = "cppdbg",
    request = "launch",
    program = function()
      return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
    end,
    cwd = '${workspaceFolder}',
    stopOnEntry = true,
  },
}
And the log shows the full interaction
[ DEBUG ] 2022-04-15T10:59:17Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:776 ]	"Spawning debug adapter"	{
  command = "C:\\Users\\fmath\\Downloads\\ms-vscode.cpptools-1.9.7@win32-x64\\extension\\debugAdapters\\bin\\OpenDebugAD7.exe",
  id = "cppdbg",
  options = {
    detached = false
  },
  type = "executable"
}
[ DEBUG ] 2022-04-15T10:59:17Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:965 ]	"request"	{
  arguments = {
    adapterID = "cppdbg",
    clientId = "neovim",
    clientname = "neovim",
    columnsStartAt1 = true,
    linesStartAt1 = true,
    locale = "en_US",
    pathFormat = "path",
    supportsRunInTerminalRequest = true,
    supportsVariableType = true
  },
  command = "initialize",
  seq = 0,
  type = "request"
}
[ ERROR ] 2022-04-15T10:59:17Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:827 ]	"stderr"	{
  command = "C:\\Users\\fmath\\Downloads\\ms-vscode.cpptools-1.9.7@win32-x64\\extension\\debugAdapters\\bin\\OpenDebugAD7.exe",
  id = "cppdbg",
  options = {
    detached = false
  },
  type = "executable"
}	"waiting for v8 protocol on stdin/stdout\r\n"
[ DEBUG ] 2022-04-15T10:59:17Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    completionTriggerCharacters = {},
    exceptionBreakpointFilters = { {
        conditionDescription = "std::out_of_range,std::invalid_argument",
        default = false,
        filter = "all",
        label = "All C++ Exceptions",
        supportsCondition = true
      } },
    supportedChecksumAlgorithms = {},
    supportsClipboardContext = true,
    supportsCompletionsRequest = true,
    supportsConditionalBreakpoints = true,
    supportsConfigurationDoneRequest = true,
    supportsDataBreakpoints = true,
    supportsDisassembleRequest = true,
    supportsEvaluateForHovers = true,
    supportsExceptionFilterOptions = true,
    supportsFunctionBreakpoints = true,
    supportsGotoTargetsRequest = true,
    supportsInstructionBreakpoints = true,
    supportsLogPoints = true,
    supportsModulesRequest = true,
    supportsReadMemoryRequest = true,
    supportsSetVariable = true,
    supportsSteppingGranularity = true,
    supportsValueFormattingOptions = true
  },
  command = "initialize",
  request_seq = 0,
  seq = 1,
  success = true,
  type = "response"
}
[ DEBUG ] 2022-04-15T10:59:17Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:965 ]	"request"	{
  arguments = {
    cwd = "C:\\Users\\fmath",
    name = "Launch file",
    program = "C:\\Users\\fmath/a.exe",
    request = "launch",
    stopOnEntry = true,
    type = "cppdbg"
  },
  command = "launch",
  seq = 1,
  type = "request"
}
[ DEBUG ] 2022-04-15T10:59:17Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  arguments = {
    args = { "C:\\Users\\fmath\\Downloads\\ms-vscode.cpptools-1.9.7@win32-x64\\extension\\debugAdapters\\bin\\WindowsDebugLauncher.exe", "--stdin=Microsoft-MIEngine-In-0zxny0n5.4s0", "--stdout=Microsoft-MIEngine-Out-f00w4gaj.yw2", "--stderr=Microsoft-MIEngine-Error-p2suju3x.4wn", "--pid=Microsoft-MIEngine-Pid-rwa1vnns.m15", "--dbgExe=C:\\ProgramData\\chocolatey\\bin\\gdb.exe", "--interpreter=mi" },
    cwd = "",
    env = vim.empty_dict(),
    kind = "integrated",
    title = "cppdbg: a.exe"
  },
  command = "runInTerminal",
  seq = 2,
  type = "request"
}
[ DEBUG ] 2022-04-15T10:59:17Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:103 ]	"run_in_terminal"	{
  args = { "C:\\Users\\fmath\\Downloads\\ms-vscode.cpptools-1.9.7@win32-x64\\extension\\debugAdapters\\bin\\WindowsDebugLauncher.exe", "--stdin=Microsoft-MIEngine-In-0zxny0n5.4s0", "--stdout=Microsoft-MIEngine-Out-f00w4gaj.yw2", "--stderr=Microsoft-MIEngine-Error-p2suju3x.4wn", "--pid=Microsoft-MIEngine-Pid-rwa1vnns.m15", "--dbgExe=C:\\ProgramData\\chocolatey\\bin\\gdb.exe", "--interpreter=mi" },
  cwd = "",
  env = vim.empty_dict(),
  kind = "integrated",
  title = "cppdbg: a.exe"
}
[ DEBUG ] 2022-04-15T10:59:17Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:982 ]	"response"	{
  body = {
    processId = 10704
  },
  command = "runInTerminal",
  request_seq = 2,
  seq = 2,
  success = true,
  type = "response"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    category = "telemetry",
    data = {
      ["VS.Diagnostics.Debugger.MIEngine.WindowsRuntime"] = "MinGW"
    },
    output = "VS/Diagnostics/Debugger/MIEngine/WindowsRuntime"
  },
  event = "output",
  seq = 3,
  type = "event"
}
[ INFO ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:448 ]	"Telemetry"	"VS/Diagnostics/Debugger/MIEngine/WindowsRuntime"
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    category = "telemetry",
    data = {
      ["VS.Diagnostics.Debugger.AdapterId"] = "cppdbg",
      ["VS.Diagnostics.Debugger.EngineVersion"] = "17.1.20308.3",
      ["VS.Diagnostics.Debugger.FrameworkVersion"] = "6.0.222.6406",
      ["VS.Diagnostics.Debugger.HostVersion"] = "17.1.20308.3",
      ["VS.Diagnostics.Debugger.ImplementationName"] = "Microsoft.MIDebugEngine",
      ["VS.Diagnostics.Debugger.Launch.Duration"] = 659
    },
    output = "VS/Diagnostics/Debugger/Launch"
  },
  event = "output",
  seq = 4,
  type = "event"
}
[ INFO ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:448 ]	"Telemetry"	"VS/Diagnostics/Debugger/Launch"
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = vim.empty_dict(),
  command = "launch",
  request_seq = 1,
  seq = 5,
  success = true,
  type = "response"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = vim.empty_dict(),
  event = "initialized",
  seq = 6,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:965 ]	"request"	{
  arguments = {
    breakpoints = { {
        line = 6,
        state = {
          BoundBreakpoints = {},
          id = 1,
          line = 6,
          verified = true
        }
      } },
    lines = { 6 },
    source = {
      name = "a.c",
      path = "C:\\Users\\fmath\\a.c"
    },
    sourceModified = false
  },
  command = "setBreakpoints",
  seq = 3,
  type = "request"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    breakpoints = { {
        BoundBreakpoints = {},
        id = 1,
        line = 6,
        verified = true
      } }
  },
  command = "setBreakpoints",
  request_seq = 3,
  seq = 7,
  success = true,
  type = "response"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:965 ]	"request"	{
  arguments = {
    filters = {}
  },
  command = "setExceptionBreakpoints",
  seq = 4,
  type = "request"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    breakpoint = {
      BoundBreakpoints = {},
      id = 1,
      line = 6,
      verified = true
    },
    reason = "changed"
  },
  event = "breakpoint",
  seq = 8,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = vim.empty_dict(),
  command = "setExceptionBreakpoints",
  request_seq = 4,
  seq = 9,
  success = true,
  type = "response"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:965 ]	"request"	{
  command = "configurationDone",
  seq = 5,
  type = "request"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    category = "stdout",
    output = '=thread-group-added,id="i1"\nGNU gdb (GDB for MinGW-W64 x86_64, built by Brecht Sanders) 10.2\nCopyright (C) 2021 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\nType "show copying" and "show warranty" for details.\nThis GDB was configured as "x86_64-w64-mingw32".\nType "show configuration" for configuration details.\nFor bug reporting instructions, please see:\n<https://www.gnu.org/software/gdb/bugs/>.\nFind the GDB manual and other documentation resources online at:\n    <http://www.gnu.org/software/gdb/documentation/>.\n\nFor help, type "help".\nType "apropos word" to search for commands related to "word".\nWarning: Debuggee TargetArchitecture not detected, assuming x86_64.\n=cmd-param-changed,param="pagination",value="off"\n'
  },
  event = "output",
  seq = 11,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = vim.empty_dict(),
  command = "configurationDone",
  request_seq = 5,
  seq = 10,
  success = true,
  type = "response"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    category = "stdout",
    output = "[New Thread 5260.0x44c]\n"
  },
  event = "output",
  seq = 12,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    category = "stdout",
    output = "\n"
  },
  event = "output",
  seq = 13,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    category = "stdout",
    output = "Thread 1 hit Breakpoint 1, main () at a.c:5\n"
  },
  event = "output",
  seq = 14,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    category = "stdout",
    output = '5\t\tprintf("Hello World");\n'
  },
  event = "output",
  seq = 15,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    name = "C:\\Users\\fmath/a.exe",
    pointerSize = 64,
    startMethod = "launch",
    systemProcessId = 5260
  },
  event = "process",
  seq = 16,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    reason = "started",
    threadId = 1
  },
  event = "thread",
  seq = 17,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    reason = "started",
    threadId = 2
  },
  event = "thread",
  seq = 18,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    breakpoint = {
      BoundBreakpoints = {},
      id = 1,
      line = 6,
      verified = true
    },
    reason = "changed"
  },
  event = "breakpoint",
  seq = 19,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    category = "console",
    output = "Loaded 'C:\\WINDOWS\\SYSTEM32\\ntdll.dll'. Symbols loaded.\r\n"
  },
  event = "output",
  seq = 20,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    module = {
      id = 1,
      name = "ntdll.dll",
      path = "C:\\WINDOWS\\SYSTEM32\\ntdll.dll",
      symbolFilePath = "C:\\WINDOWS\\SYSTEM32\\ntdll.dll",
      vsIs64Bit = true,
      vsLoadAddress = "140719603978240",
      vsLoadOrder = 0,
      vsModuleSize = 2127160,
      vsPreferredLoadAddress = "140719603978240",
      vsTimestampUTC = "1645033134"
    },
    reason = "new"
  },
  event = "module",
  seq = 21,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    category = "console",
    output = "Loaded 'C:\\WINDOWS\\System32\\kernel32.dll'. Symbols loaded.\r\n"
  },
  event = "output",
  seq = 22,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    module = {
      id = 2,
      name = "kernel32.dll",
      path = "C:\\WINDOWS\\System32\\kernel32.dll",
      symbolFilePath = "C:\\WINDOWS\\System32\\kernel32.dll",
      vsIs64Bit = true,
      vsLoadAddress = "140719577763840",
      vsLoadOrder = 1,
      vsModuleSize = 766772,
      vsPreferredLoadAddress = "140719577763840",
      vsTimestampUTC = "1649958915"
    },
    reason = "new"
  },
  event = "module",
  seq = 23,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    category = "console",
    output = "Loaded 'C:\\WINDOWS\\System32\\KernelBase.dll'. Symbols loaded.\r\n"
  },
  event = "output",
  seq = 24,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    module = {
      id = 3,
      name = "KernelBase.dll",
      path = "C:\\WINDOWS\\System32\\KernelBase.dll",
      symbolFilePath = "C:\\WINDOWS\\System32\\KernelBase.dll",
      vsIs64Bit = true,
      vsLoadAddress = "140719562166272",
      vsLoadOrder = 2,
      vsModuleSize = 3614876,
      vsPreferredLoadAddress = "140719562166272",
      vsTimestampUTC = "1649958902"
    },
    reason = "new"
  },
  event = "module",
  seq = 25,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    category = "console",
    output = "Loaded 'C:\\WINDOWS\\System32\\msvcrt.dll'. Symbols loaded.\r\n"
  },
  event = "output",
  seq = 26,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:18Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    module = {
      id = 4,
      name = "msvcrt.dll",
      path = "C:\\WINDOWS\\System32\\msvcrt.dll",
      symbolFilePath = "C:\\WINDOWS\\System32\\msvcrt.dll",
      vsIs64Bit = true,
      vsLoadAddress = "140719578550272",
      vsLoadOrder = 3,
      vsModuleSize = 660660,
      vsPreferredLoadAddress = "140719578550272",
      vsTimestampUTC = "1622894745"
    },
    reason = "new"
  },
  event = "module",
  seq = 27,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:19Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    category = "stdout",
    output = "\n"
  },
  event = "output",
  seq = 28,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:19Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    category = "stdout",
    output = "Thread 1 hit Breakpoint 2, main () at a.c:6\n"
  },
  event = "output",
  seq = 29,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:19Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    category = "stdout",
    output = "6\t\treturn 0;\n"
  },
  event = "output",
  seq = 30,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:19Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    category = "console",
    output = 'Execute debugger commands using "-exec <command>", for example "-exec info registers" will list registers in use (when GDB is the debugger)\r\n'
  },
  event = "output",
  seq = 31,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:19Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    allThreadsStopped = true,
    column = 1,
    line = 6,
    reason = "breakpoint",
    source = {
      checksums = {},
      name = "a.c",
      path = "c:\\Users\\fmath\\a.c",
      sources = {}
    },
    threadId = 1
  },
  event = "stopped",
  seq = 32,
  type = "event"
}
[ DEBUG ] 2022-04-15T10:59:19Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:965 ]	"request"	{
  command = "threads",
  seq = 6,
  type = "request"
}
[ DEBUG ] 2022-04-15T10:59:19Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    threads = { {
        id = 1,
        name = "Thread #1"
      }, {
        id = 2,
        name = "Thread #2"
      } }
  },
  command = "threads",
  request_seq = 6,
  seq = 33,
  success = true,
  type = "response"
}
[ DEBUG ] 2022-04-15T10:59:19Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:965 ]	"request"	{
  arguments = {
    threadId = 1
  },
  command = "stackTrace",
  seq = 7,
  type = "request"
}
[ DEBUG ] 2022-04-15T10:59:19Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    stackFrames = { {
        column = 1,
        id = 1000,
        instructionPointerReference = "0x00007ff7df24184d",
        line = 6,
        name = "main()",
        source = {
          checksums = {},
          name = "a.c",
          path = "c:\\Users\\fmath\\a.c",
          sources = {}
        }
      } },
    totalFrames = 1
  },
  command = "stackTrace",
  request_seq = 7,
  seq = 34,
  success = true,
  type = "response"
}
[ DEBUG ] 2022-04-15T10:59:19Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:965 ]	"request"	{
  arguments = {
    frameId = 1000
  },
  command = "scopes",
  seq = 8,
  type = "request"
}
[ DEBUG ] 2022-04-15T10:59:19Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    scopes = { {
        expensive = false,
        name = "Locals",
        presentationHint = "locals",
        variablesReference = 1000
      }, {
        expensive = true,
        name = "Registers",
        presentationHint = "registers",
        variablesReference = 1001
      } }
  },
  command = "scopes",
  request_seq = 8,
  seq = 35,
  success = true,
  type = "response"
}
[ DEBUG ] 2022-04-15T10:59:19Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:965 ]	"request"	{
  arguments = {
    variablesReference = 1000
  },
  command = "variables",
  seq = 9,
  type = "request"
}
[ DEBUG ] 2022-04-15T10:59:19Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:614 ]	{
  body = {
    variables = {}
  },
  command = "variables",
  request_seq = 9,
  seq = 36,
  success = true,
  type = "response"
}
[ INFO ] 2022-04-15T11:02:11Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:795 ]	"Closed all handles"
[ INFO ] 2022-04-15T11:02:11Z+0200 ] ...cal\nvim\pack\plugins\start\nvim-dap/lua/dap/session.lua:798 ]	"Process closed"	4608	false

Yeah it works properly now with the PR change. Sorry I didn't check out to the branch on the last test.

ezoic increase your site revenue