summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
diff options
context:
space:
mode:
authorLawrence D'Anna <lawrence_danna@apple.com>2019-10-14 20:15:34 +0000
committerLawrence D'Anna <lawrence_danna@apple.com>2019-10-14 20:15:34 +0000
commit62c9fe4273e8f2a0f3f0f4c86de3a90668532354 (patch)
tree50c6f7a76ff044c13465b9ad7583558d6c275e1d /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
parent322f12afc3673fc868899857b069ce59084dba05 (diff)
downloadbcm5719-llvm-62c9fe4273e8f2a0f3f0f4c86de3a90668532354.tar.gz
bcm5719-llvm-62c9fe4273e8f2a0f3f0f4c86de3a90668532354.zip
uint32_t options -> File::OpenOptions options
Summary: This patch re-types everywhere that passes a File::OpenOptions as a uint32_t so it actually uses File::OpenOptions. It also converts some OpenOptions related functions that fail by returning 0 or NULL into llvm::Expected split off from https://reviews.llvm.org/D68737 Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68853 llvm-svn: 374817
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
index c4169403982..c7349db7d97 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
@@ -507,7 +507,11 @@ GDBRemoteCommunicationServerCommon::Handle_vFile_Open(
packet.GetHexByteStringTerminatedBy(path, ',');
if (!path.empty()) {
if (packet.GetChar() == ',') {
- uint32_t flags = packet.GetHexMaxU32(false, 0);
+ // FIXME
+ // The flag values for OpenOptions do not match the values used by GDB
+ // * https://sourceware.org/gdb/onlinedocs/gdb/Open-Flags.html#Open-Flags
+ // * rdar://problem/46788934
+ auto flags = File::OpenOptions(packet.GetHexMaxU32(false, 0));
if (packet.GetChar() == ',') {
mode_t mode = packet.GetHexMaxU32(false, 0600);
FileSpec path_spec(path);
@@ -546,7 +550,7 @@ GDBRemoteCommunicationServerCommon::Handle_vFile_Close(
int err = -1;
int save_errno = 0;
if (fd >= 0) {
- NativeFile file(fd, 0, true);
+ NativeFile file(fd, File::OpenOptions(0), true);
Status error = file.Close();
err = 0;
save_errno = error.GetError();
OpenPOWER on IntegriCloud