Working directory FileSpec should use remote path syntax to display correctly.
authorChaoren Lin <chaorenl@google.com>
Fri, 29 May 2015 19:52:37 +0000 (19:52 +0000)
committerChaoren Lin <chaorenl@google.com>
Fri, 29 May 2015 19:52:37 +0000 (19:52 +0000)
Summary: Depends on D9728.

Reviewers: ovyalov, zturner, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9806

llvm-svn: 238605

lldb/include/lldb/Host/FileSpec.h
lldb/source/Host/common/FileSpec.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp

index a9a8d79..7918dd9 100644 (file)
@@ -669,8 +669,14 @@ public:
     SetFile (const char *path, bool resolve_path, PathSyntax syntax = ePathSyntaxHostNative);
 
     void
+    SetFile(const char *path, bool resolve_path, ArchSpec arch);
+
+    void
     SetFile(const std::string &path, bool resolve_path, PathSyntax syntax = ePathSyntaxHostNative);
 
+    void
+    SetFile(const std::string &path, bool resolve_path, ArchSpec arch);
+
     bool
     IsResolved () const
     {
index 65d6543..0e8f71a 100644 (file)
@@ -345,11 +345,26 @@ FileSpec::SetFile (const char *pathname, bool resolve, PathSyntax syntax)
 }
 
 void
+FileSpec::SetFile(const char *pathname, bool resolve, ArchSpec arch)
+{
+    return SetFile(pathname, resolve,
+            arch.GetTriple().isOSWindows()
+            ? ePathSyntaxWindows
+            : ePathSyntaxPosix);
+}
+
+void
 FileSpec::SetFile(const std::string &pathname, bool resolve, PathSyntax syntax)
 {
     return SetFile(pathname.c_str(), resolve, syntax);
 }
 
+void
+FileSpec::SetFile(const std::string &pathname, bool resolve, ArchSpec arch)
+{
+    return SetFile(pathname.c_str(), resolve, arch);
+}
+
 //----------------------------------------------------------------------
 // Convert to pointer operator. This allows code to check any FileSpec
 // objects to see if they contain anything valid using code such as:
index 0a1ec3f..2c21a25 100644 (file)
@@ -2301,7 +2301,7 @@ GDBRemoteCommunicationClient::GetWorkingDir(FileSpec &working_dir)
             return false;
         std::string cwd;
         response.GetHexByteString(cwd);
-        working_dir.SetFile(cwd, false);
+        working_dir.SetFile(cwd, false, GetHostArchitecture());
         return !cwd.empty();
     }
     return false;