diff options
author | Michał Górny <mgorny@moritz.systems> | 2021-07-28 20:07:03 +0200 |
---|---|---|
committer | Michał Górny <mgorny@moritz.systems> | 2021-08-09 12:06:59 +0200 |
commit | 14735cab655441ba45c4b88ad82f11267e5fe916 (patch) | |
tree | e91adc4f155d47507389f4e63f02be5cbe3170b6 /lldb/source/Interpreter/ScriptInterpreter.cpp | |
parent | 8a7c657c4d65deb13880634823659d9e9d924e4a (diff) | |
download | llvm-14735cab655441ba45c4b88ad82f11267e5fe916.zip llvm-14735cab655441ba45c4b88ad82f11267e5fe916.tar.gz llvm-14735cab655441ba45c4b88ad82f11267e5fe916.tar.bz2 |
[lldb] [gdb-remote] Add eOpenOptionReadWrite for future gdb compat
Modify OpenOptions enum to open the future path into synchronizing
vFile:open bits with GDB. Currently, LLDB and GDB use different flag
models effectively making it impossible to match bits. Notably, LLDB
uses two bits to indicate read and write status, and uses union of both
for read/write. GDB uses a value of 0 for read-only, 1 for write-only
and 2 for read/write.
In order to future-proof the code for the GDB variant:
1. Add a distinct eOpenOptionReadWrite constant to be used instead
of (eOpenOptionRead | eOpenOptionWrite) when R/W access is required.
2. Rename eOpenOptionRead and eOpenOptionWrite to eOpenOptionReadOnly
and eOpenOptionWriteOnly respectively, to make it clear that they
do not mean to be combined and require update to all call sites.
3. Use the intersection of all three flags when matching against
the three possible values.
This commit does not change the actual bits used by LLDB.
Differential Revision: https://reviews.llvm.org/D106984
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreter.cpp')
-rw-r--r-- | lldb/source/Interpreter/ScriptInterpreter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreter.cpp b/lldb/source/Interpreter/ScriptInterpreter.cpp index f264748..ac0a52d 100644 --- a/lldb/source/Interpreter/ScriptInterpreter.cpp +++ b/lldb/source/Interpreter/ScriptInterpreter.cpp @@ -141,12 +141,12 @@ ScriptInterpreterIORedirect::Create(bool enable_io, Debugger &debugger, new ScriptInterpreterIORedirect(debugger, result)); auto nullin = FileSystem::Instance().Open(FileSpec(FileSystem::DEV_NULL), - File::eOpenOptionRead); + File::eOpenOptionReadOnly); if (!nullin) return nullin.takeError(); auto nullout = FileSystem::Instance().Open(FileSpec(FileSystem::DEV_NULL), - File::eOpenOptionWrite); + File::eOpenOptionWriteOnly); if (!nullout) return nullin.takeError(); |