forked from OSchip/llvm-project
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. llvm-svn: 189364
This commit is contained in:
parent
dcdae946f3
commit
ae12a3640d
|
@ -12,6 +12,7 @@
|
|||
#if defined(__cplusplus)
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "lldb/lldb-private.h"
|
||||
|
||||
|
|
|
@ -20,8 +20,24 @@ char* realpath(const char * name, char * resolved);
|
|||
#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_
|
||||
|
|
|
@ -252,14 +252,12 @@ File::Open (const char *path, uint32_t options, uint32_t permissions)
|
|||
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
|
||||
|
|
|
@ -65,7 +65,7 @@ char * strcasestr(const char *s, const char* find)
|
|||
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 */
|
||||
|
||||
|
|
|
@ -885,7 +885,7 @@ GDBRemoteCommunicationServer::Handle_qKillSpawnedProcess (StringExtractorGDBRemo
|
|||
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_qKillSpawnedProcess (StringExtractorGDBRemo
|
|||
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_vFile_Close (StringExtractorGDBRemote &pack
|
|||
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_vFile_pRead (StringExtractorGDBRemote &pack
|
|||
}
|
||||
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_vFile_pWrite (StringExtractorGDBRemote &pac
|
|||
|
||||
SendPacketNoLock(response.GetData(), response.GetSize());
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
Loading…
Reference in New Issue