Skip to content

Commit

Permalink
Win32: Change incoming path slashes to backslashes in ResolvePath (#68)
Browse files Browse the repository at this point in the history
* Win32: Change incoming path slashes to backslashes in ResolvePath

* Formatting fix

---------

Co-authored-by: Mark Keinz <makei@microsoft.com>
  • Loading branch information
markkeinz and Mark Keinz committed Apr 21, 2023
1 parent 80ce234 commit 0717890
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/MICmnLLDBDebugSessionInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <cassert>
#include <inttypes.h>
#ifdef _WIN32
#include <algorithm>
#include <io.h>
#else
#include <unistd.h>
Expand Down Expand Up @@ -321,6 +322,13 @@ bool CMICmnLLDBDebugSessionInfo::ResolvePath(const CMIUtilString &vstrUnknown,

bool bOk = MIstatus::success;

#ifdef _WIN32
// When remote debugging other platforms, incoming paths may have slashes
// instead of backslashes. The logic below assumes all paths to have
// backslashes on Windows, so do a replace.
std::replace(vwrResolvedPath.begin(), vwrResolvedPath.end(), '/', '\\');
#endif

CMIUtilString::VecString_t vecPathFolders;
const MIuint nSplits = vwrResolvedPath.Split(PATH_SEPARATOR, vecPathFolders);
MIunused(nSplits);
Expand Down

0 comments on commit 0717890

Please sign in to comment.