[Lldb-commits] [lldb] r195766 - Fix MSVC build

Colin Riley colin at codeplay.com
Tue Nov 26 07:10:47 PST 2013


Author: domipheus
Date: Tue Nov 26 09:10:46 2013
New Revision: 195766

URL: http://llvm.org/viewvc/llvm-project?rev=195766&view=rev
Log:
Fix MSVC build

Added _WIN32 guards to new platform features. Using correct SetErrorStringWithFormat within Host when LLDB_DISABLE_POSIX is defined. Also fixed an if defined block.

Modified:
    lldb/trunk/source/Host/common/File.cpp
    lldb/trunk/source/Host/common/Host.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
    lldb/trunk/source/Target/Platform.cpp

Modified: lldb/trunk/source/Host/common/File.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/File.cpp?rev=195766&r1=195765&r2=195766&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/File.cpp (original)
+++ lldb/trunk/source/Host/common/File.cpp Tue Nov 26 09:10:46 2013
@@ -237,8 +237,10 @@ File::Open (const char *path, uint32_t o
     {
         oflag |= O_RDONLY;
 
+#ifndef _WIN32
         if (options & eOpenoptionDontFollowSymlinks)
             oflag |= O_NOFOLLOW;
+#endif
     }
     
 #ifndef _WIN32

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=195766&r1=195765&r2=195766&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Tue Nov 26 09:10:46 2013
@@ -1569,7 +1569,7 @@ Host::RunShellCommand (const char *comma
     return error;
 }
 
-#if defined(__linux__) or defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__)
 // The functions below implement process launching via posix_spawn() for Linux
 // and FreeBSD.
 
@@ -1858,7 +1858,7 @@ Error
 Host::MakeDirectory (const char* path, uint32_t mode)
 {
     Error error;
-    error.SetErrorString("%s in not implemented on this host", __PRETTY_FUNCTION__);
+    error.SetErrorStringWithFormat("%s in not implemented on this host", __PRETTY_FUNCTION__);
     return error;
 }
 
@@ -1866,7 +1866,7 @@ Error
 Host::GetFilePermissions (const char* path, uint32_t &file_permissions)
 {
     Error error;
-    error.SetErrorString("%s is not supported on this host", __PRETTY_FUNCTION__);
+    error.SetErrorStringWithFormat("%s is not supported on this host", __PRETTY_FUNCTION__);
     return error;
 }
 
@@ -1874,7 +1874,7 @@ Error
 Host::SetFilePermissions (const char* path, uint32_t file_permissions)
 {
     Error error;
-    error.SetErrorString("%s is not supported on this host", __PRETTY_FUNCTION__);
+    error.SetErrorStringWithFormat("%s is not supported on this host", __PRETTY_FUNCTION__);
     return error;
 }
 
@@ -1882,7 +1882,7 @@ Error
 Host::Symlink (const char *src, const char *dst)
 {
     Error error;
-    error.SetErrorString("%s is not supported on this host", __PRETTY_FUNCTION__);
+    error.SetErrorStringWithFormat("%s is not supported on this host", __PRETTY_FUNCTION__);
     return error;
 }
 
@@ -1890,7 +1890,7 @@ Error
 Host::Readlink (const char *path, char *buf, size_t buf_len)
 {
     Error error;
-    error.SetErrorString("%s is not supported on this host", __PRETTY_FUNCTION__);
+    error.SetErrorStringWithFormat("%s is not supported on this host", __PRETTY_FUNCTION__);
     return error;
 }
 
@@ -1898,7 +1898,7 @@ Error
 Host::Unlink (const char *path)
 {
     Error error;
-    error.SetErrorString("%s is not supported on this host", __PRETTY_FUNCTION__);
+    error.SetErrorStringWithFormat("%s is not supported on this host", __PRETTY_FUNCTION__);
     return error;
 }
 

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp?rev=195766&r1=195765&r2=195766&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp Tue Nov 26 09:10:46 2013
@@ -1011,9 +1011,14 @@ GDBRemoteCommunicationServer::Handle_QSe
     packet.GetHexByteString(path);
     if (m_is_platform)
     {
+#ifdef _WIN32
+        // Not implemented on Windows
+        return SendUnimplementedResponse("GDBRemoteCommunicationServer::Handle_QSetWorkingDir unimplemented");
+#else
         // If this packet is sent to a platform, then change the current working directory
         if (::chdir(path.c_str()) != 0)
             return SendErrorResponse(errno);
+#endif
     }
     else
     {

Modified: lldb/trunk/source/Target/Platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Platform.cpp?rev=195766&r1=195765&r2=195766&view=diff
==============================================================================
--- lldb/trunk/source/Target/Platform.cpp (original)
+++ lldb/trunk/source/Target/Platform.cpp Tue Nov 26 09:10:46 2013
@@ -671,12 +671,17 @@ Platform::SetWorkingDirectory (const Con
 {
     if (IsHost())
     {
+#ifdef _WIN32
+        // Not implemented on Windows
+        return false;
+#else
         if (path)
         {
             if (chdir(path.GetCString()) == 0)
                 return true;
         }
         return false;
+#endif
     }
     else
     {





More information about the lldb-commits mailing list