Update the vFile:open: description to note that the flags

in the packet are lldb enum values, not the open(2) oflags -- 
forgot about that wrinkle.  Also added a comment to File.h 
noting that the existing values cannot be modified or we'll
have a compatibilty break with any alternative platform
implementations, or older versions of lldb-server.

llvm-svn: 349282
This commit is contained in:
Jason Molenda 2018-12-15 18:40:38 +00:00
parent cf6bb77f65
commit fbdb8b2e1c
2 changed files with 5 additions and 1 deletions

View File

@ -303,7 +303,9 @@ for the lldb testsuite to be run on a remote target device/system.
// //
// request packet has the fields: // request packet has the fields:
// 1. ASCII hex encoded filename // 1. ASCII hex encoded filename
// 2. oflags to be passed to open(2), base 16 // 2. flags passed to the open call, base 16.
// Note that these are not the oflags that open(2) takes, but
// are the constant values in enum OpenOptions from lldb's File.h
// 3. mode bits, base 16 // 3. mode bits, base 16
// //
// response is F followed by the opened file descriptor in base 10. // response is F followed by the opened file descriptor in base 10.

View File

@ -33,6 +33,8 @@ public:
static int kInvalidDescriptor; static int kInvalidDescriptor;
static FILE *kInvalidStream; static FILE *kInvalidStream;
// NB this enum is used in the lldb platform gdb-remote packet
// vFile:open: and existing values cannot be modified.
enum OpenOptions { enum OpenOptions {
eOpenOptionRead = (1u << 0), // Open file for reading eOpenOptionRead = (1u << 0), // Open file for reading
eOpenOptionWrite = (1u << 1), // Open file for writing eOpenOptionWrite = (1u << 1), // Open file for writing