Skip to content

Commit 0717890

Browse files
markkeinzMark Keinz
andauthored
Win32: Change incoming path slashes to backslashes in ResolvePath (#68)
* Win32: Change incoming path slashes to backslashes in ResolvePath * Formatting fix --------- Co-authored-by: Mark Keinz <[email protected]>
1 parent 80ce234 commit 0717890

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/MICmnLLDBDebugSessionInfo.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <cassert>
1212
#include <inttypes.h>
1313
#ifdef _WIN32
14+
#include <algorithm>
1415
#include <io.h>
1516
#else
1617
#include <unistd.h>
@@ -321,6 +322,13 @@ bool CMICmnLLDBDebugSessionInfo::ResolvePath(const CMIUtilString &vstrUnknown,
321322

322323
bool bOk = MIstatus::success;
323324

325+
#ifdef _WIN32
326+
// When remote debugging other platforms, incoming paths may have slashes
327+
// instead of backslashes. The logic below assumes all paths to have
328+
// backslashes on Windows, so do a replace.
329+
std::replace(vwrResolvedPath.begin(), vwrResolvedPath.end(), '/', '\\');
330+
#endif
331+
324332
CMIUtilString::VecString_t vecPathFolders;
325333
const MIuint nSplits = vwrResolvedPath.Split(PATH_SEPARATOR, vecPathFolders);
326334
MIunused(nSplits);

0 commit comments

Comments
 (0)