[Lldb-commits] [lldb] r189364 - Fix MinGW build after lldb-platform-work merge:

Virgile Bello virgile.bello at gmail.com
Tue Aug 27 09:21:50 PDT 2013


Author: xen2
Date: Tue Aug 27 11:21:49 2013
New Revision: 189364

URL: http://llvm.org/viewvc/llvm-project?rev=189364&view=rev
Log:
Fix MinGW build after lldb-platform-work merge:

- mode_t is defined in <sys/types.h>
- reorganized S_* user rights into win32.h
- Use Host::Kill instead of kill
- Currently #ifdef functions using pread/pwrite.

Modified:
    lldb/trunk/include/lldb/Host/File.h
    lldb/trunk/include/lldb/Host/windows/win32.h
    lldb/trunk/source/Host/common/File.cpp
    lldb/trunk/source/Host/windows/Windows.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp

Modified: lldb/trunk/include/lldb/Host/File.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/File.h?rev=189364&r1=189363&r2=189364&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/File.h (original)
+++ lldb/trunk/include/lldb/Host/File.h Tue Aug 27 11:21:49 2013
@@ -12,6 +12,7 @@
 #if defined(__cplusplus)
 
 #include <stdio.h>
+#include <sys/types.h>
 
 #include "lldb/lldb-private.h"
 

Modified: lldb/trunk/include/lldb/Host/windows/win32.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/windows/win32.h?rev=189364&r1=189363&r2=189364&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/windows/win32.h (original)
+++ lldb/trunk/include/lldb/Host/windows/win32.h Tue Aug 27 11:21:49 2013
@@ -20,8 +20,24 @@ char* realpath(const char * name, char *
 #define PATH_MAX MAX_PATH
 
 #define O_NOCTTY    0
+#define O_NONBLOCK  0
 #define SIGTRAP     5
 #define SIGKILL     9
 #define SIGSTOP     20
 
+#if defined(_MSC_VER)
+# define S_IRUSR  S_IREAD                      /* read, user */
+# define S_IWUSR  S_IWRITE                     /* write, user */
+# define S_IXUSR  0                            /* execute, user */
+#endif
+#define S_IRGRP  0                            /* read, group */
+#define S_IWGRP  0                            /* write, group */
+#define S_IXGRP  0                            /* execute, group */
+#define S_IROTH  0                            /* read, others */
+#define S_IWOTH  0                            /* write, others */
+#define S_IXOTH  0                            /* execute, others */
+#define S_IRWXU  0
+#define S_IRWXG  0
+#define S_IRWXO  0
+
 #endif  // LLDB_lldb_win32_h_

Modified: lldb/trunk/source/Host/common/File.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/File.cpp?rev=189364&r1=189363&r2=189364&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/File.cpp (original)
+++ lldb/trunk/source/Host/common/File.cpp Tue Aug 27 11:21:49 2013
@@ -252,14 +252,12 @@ File::Open (const char *path, uint32_t o
         if (permissions & ePermissionsUserRead)     mode |= S_IRUSR;
         if (permissions & ePermissionsUserWrite)    mode |= S_IWUSR;
         if (permissions & ePermissionsUserExecute)  mode |= S_IXUSR;
-#ifndef _WIN32
         if (permissions & ePermissionsGroupRead)    mode |= S_IRGRP;
         if (permissions & ePermissionsGroupWrite)   mode |= S_IWGRP;
         if (permissions & ePermissionsGroupExecute) mode |= S_IXGRP;
         if (permissions & ePermissionsWorldRead)    mode |= S_IROTH;
         if (permissions & ePermissionsWorldWrite)   mode |= S_IWOTH;
         if (permissions & ePermissionsWorldExecute) mode |= S_IXOTH;
-#endif
     }
 
     do

Modified: lldb/trunk/source/Host/windows/Windows.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/Windows.cpp?rev=189364&r1=189363&r2=189364&view=diff
==============================================================================
--- lldb/trunk/source/Host/windows/Windows.cpp (original)
+++ lldb/trunk/source/Host/windows/Windows.cpp Tue Aug 27 11:21:49 2013
@@ -65,7 +65,7 @@ char * strcasestr(const char *s, const c
     return ((char *) s);
 }
 
-char* __cdecl realpath(const char * name, char * resolved)
+char* realpath(const char * name, char * resolved)
 {
     char *retname = NULL;  /* we will return this, if we fail */
 

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=189364&r1=189363&r2=189364&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp Tue Aug 27 11:21:49 2013
@@ -885,7 +885,7 @@ GDBRemoteCommunicationServer::Handle_qKi
             if (m_spawned_pids.find(pid) == m_spawned_pids.end())
                 return SendErrorResponse (10);
         }
-        kill (pid, SIGTERM);
+        Host::Kill (pid, SIGTERM);
         
         for (size_t i=0; i<10; ++i)
         {
@@ -904,7 +904,7 @@ GDBRemoteCommunicationServer::Handle_qKi
             if (m_spawned_pids.find(pid) == m_spawned_pids.end())
                 return true;
         }
-        kill (pid, SIGKILL);
+        Host::Kill (pid, SIGKILL);
         
         for (size_t i=0; i<10; ++i)
         {
@@ -1111,6 +1111,10 @@ GDBRemoteCommunicationServer::Handle_vFi
 bool
 GDBRemoteCommunicationServer::Handle_vFile_pRead (StringExtractorGDBRemote &packet)
 {
+#ifdef _WIN32
+    // Not implemented on Windows
+    return false;
+#else
     StreamGDBRemote response;
     packet.SetFilePos(::strlen("vFile:pread:"));
     int fd = packet.GetS32(-1);
@@ -1140,11 +1144,16 @@ GDBRemoteCommunicationServer::Handle_vFi
     }
     SendPacketNoLock(response.GetData(), response.GetSize());
     return true;
+#endif
 }
 
 bool
 GDBRemoteCommunicationServer::Handle_vFile_pWrite (StringExtractorGDBRemote &packet)
 {
+#ifdef _WIN32
+    // Not implemented on Windows
+    return false;
+#else
     packet.SetFilePos(::strlen("vFile:pwrite:"));
 
     StreamGDBRemote response;
@@ -1172,6 +1181,7 @@ GDBRemoteCommunicationServer::Handle_vFi
 
     SendPacketNoLock(response.GetData(), response.GetSize());
     return true;
+#endif
 }
 
 bool





More information about the lldb-commits mailing list