[Lldb-commits] [PATCH] Convert open options for POSIX open on target platform.
Robert Flack
flackr at gmail.com
Tue Mar 17 14:12:43 PDT 2015
Hi ovyalov,
This moves the conversion of the open options to the target platform. On mac fcntl.h has different values for O_CREAT and O_TRUNC than on linux so by transmitting the standardized lldb open options we can correctly convert them on the target platform.
REPOSITORY
rL LLVM
http://reviews.llvm.org/D8395
Files:
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===================================================================
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -3233,8 +3233,7 @@
return UINT64_MAX;
stream.PutCStringAsRawHex8(path.c_str());
stream.PutChar(',');
- const uint32_t posix_open_flags = File::ConvertOpenOptionsForPOSIXOpen(flags);
- stream.PutHex32(posix_open_flags);
+ stream.PutHex32(flags);
stream.PutChar(',');
stream.PutHex32(mode);
const char* packet = stream.GetData();
Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
===================================================================
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
@@ -567,7 +567,8 @@
{
if (packet.GetChar() == ',')
{
- uint32_t flags = packet.GetHexMaxU32(false, 0);
+ uint32_t flags = File::ConvertOpenOptionsForPOSIXOpen(
+ packet.GetHexMaxU32(false, 0));
if (packet.GetChar() == ',')
{
mode_t mode = packet.GetHexMaxU32(false, 0600);
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8395.22127.patch
Type: text/x-patch
Size: 1336 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150317/8ac5d6ce/attachment.bin>
More information about the lldb-commits
mailing list