From 92e00269541545cc8b2a1b91d3d9d18ffe1ae76e Mon Sep 17 00:00:00 2001 From: repelliuss Date: Mon, 30 Dec 2024 12:36:52 +0300 Subject: [PATCH] handle unix file paths on Windows for setting breakpoints with dap --- src/protocols/vscodeprotocol.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/protocols/vscodeprotocol.cpp b/src/protocols/vscodeprotocol.cpp index aa0cb70..d211179 100644 --- a/src/protocols/vscodeprotocol.cpp +++ b/src/protocols/vscodeprotocol.cpp @@ -575,8 +575,13 @@ static HRESULT HandleCommand(std::shared_ptr &sharedDebugger, std::st for (auto &b : arguments.at("breakpoints")) lineBreakpoints.emplace_back(std::string(), b.at("line"), b.value("condition", std::string())); + std::string source = arguments.at("source").at("path"); +#ifdef WIN32 + std::replace(source.begin(), source.end(), '/', '\\'); +#endif + std::vector breakpoints; - IfFailRet(sharedDebugger->SetLineBreakpoints(arguments.at("source").at("path"), lineBreakpoints, breakpoints)); + IfFailRet(sharedDebugger->SetLineBreakpoints(source, lineBreakpoints, breakpoints)); body["breakpoints"] = breakpoints;