emacs-lsp / dap-mode

Emacs :heart: Debug Adapter Protocol
https://emacs-lsp.github.io/dap-mode
GNU General Public License v3.0
1.3k stars 182 forks source link

Debug C++ on Windows with vscode-cpptools and msvsmon, having trouble with configuration #587

Open michaelbartnett opened 2 years ago

michaelbartnett commented 2 years ago

I've been trying to get dap-mode to debug C++ projects on Windows, but it's not clear to me what's supported and what I need to do in order to get going.

I started with the vscode-cpptools option listed here: https://emacs-lsp.github.io/dap-mode/page/configuration/#vscode-cpptools

That section quotes the lldb configuration section above it, but it the rest of that seems to imply this isn't necessary (just run the cpptools setup function, and it will install the vscode-cpptools debug adapter). I can debug C++ and Zig programs in VS Code without gdb or lldb, and I'm assuming the intent is to be able to use the same adapter.

When I compare dap-mode's debugAdapters and VS Code's debugAdapters:

they seem to be the same: both have a vsdbg folder containing vsdbg.exe and bin/RemoteDebugger/${x64,x86}/msvsmon.exe.

I've been copying over my vscode launch.json debug configurations to no avail. Normally I specify "type": "cppvsdbg" to select debugging with msvsmon, but specifying that in dap-register-debug-template just gives me Have you loaded the ‘cppvsdbg’ specific dap package? in the *Messages* buffer and fails. I also tried "vscode-cpptools", "cpptools", and "vsdbg" with the same result.

Does dap-mode support debugging with msvsmon? (Even if it took a little hacking it would be great, this is Emacs after all 😄 )

yyoncho commented 2 years ago

vsdbg is not supported ATM and I believe (unless something has changed recently) that its license does not allow using it outside of MS products.