[Lldb-commits] [lldb] r238605 - Working directory FileSpec should use remote path syntax to display correctly.

Chaoren Lin chaorenl at google.com
Fri May 29 12:52:37 PDT 2015


Author: chaoren
Date: Fri May 29 14:52:37 2015
New Revision: 238605

URL: http://llvm.org/viewvc/llvm-project?rev=238605&view=rev
Log:
Working directory FileSpec should use remote path syntax to display correctly.

Summary: Depends on D9728.

Reviewers: ovyalov, zturner, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

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

Modified: lldb/trunk/include/lldb/Host/FileSpec.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/FileSpec.h?rev=238605&r1=238604&r2=238605&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/FileSpec.h (original)
+++ lldb/trunk/include/lldb/Host/FileSpec.h Fri May 29 14:52:37 2015
@@ -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
     {

Modified: lldb/trunk/source/Host/common/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSpec.cpp?rev=238605&r1=238604&r2=238605&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/FileSpec.cpp (original)
+++ lldb/trunk/source/Host/common/FileSpec.cpp Fri May 29 14:52:37 2015
@@ -345,11 +345,26 @@ FileSpec::SetFile (const char *pathname,
 }
 
 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:

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=238605&r1=238604&r2=238605&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Fri May 29 14:52:37 2015
@@ -2301,7 +2301,7 @@ GDBRemoteCommunicationClient::GetWorking
             return false;
         std::string cwd;
         response.GetHexByteString(cwd);
-        working_dir.SetFile(cwd, false);
+        working_dir.SetFile(cwd, false, GetHostArchitecture());
         return !cwd.empty();
     }
     return false;





More information about the lldb-commits mailing list