[all-commits] [llvm/llvm-project] 14735c: [lldb] [gdb-remote] Add eOpenOptionReadWrite for f...

Michał Górny via All-commits all-commits at lists.llvm.org
Mon Aug 9 03:35:24 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 14735cab655441ba45c4b88ad82f11267e5fe916
      https://github.com/llvm/llvm-project/commit/14735cab655441ba45c4b88ad82f11267e5fe916
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2021-08-09 (Mon, 09 Aug 2021)

  Changed paths:
    M lldb/docs/lldb-platform-packets.txt
    M lldb/include/lldb/Host/File.h
    M lldb/source/API/SBStream.cpp
    M lldb/source/Commands/CommandObjectMemory.cpp
    M lldb/source/Commands/CommandObjectPlatform.cpp
    M lldb/source/Commands/CommandObjectSettings.cpp
    M lldb/source/Commands/CommandObjectTarget.cpp
    M lldb/source/Core/Debugger.cpp
    M lldb/source/Core/StreamFile.cpp
    M lldb/source/Expression/REPL.cpp
    M lldb/source/Host/common/File.cpp
    M lldb/source/Host/common/FileSystem.cpp
    M lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
    M lldb/source/Host/windows/Host.cpp
    M lldb/source/Interpreter/CommandInterpreter.cpp
    M lldb/source/Interpreter/ScriptInterpreter.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
    M lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
    M lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    M lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
    M lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    M lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
    M lldb/source/Target/ModuleCache.cpp
    M lldb/source/Target/Platform.cpp
    M lldb/source/Target/Process.cpp
    M lldb/source/Target/Target.cpp
    M lldb/unittests/Host/FileSystemTest.cpp
    M lldb/unittests/Host/FileTest.cpp
    M lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp

  Log Message:
  -----------
  [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


  Commit: 8bbef4f9afd8b5f6b4435d5bab48b75f048f353c
      https://github.com/llvm/llvm-project/commit/8bbef4f9afd8b5f6b4435d5bab48b75f048f353c
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2021-08-09 (Mon, 09 Aug 2021)

  Changed paths:
    M lldb/docs/lldb-platform-packets.txt
    M lldb/include/lldb/Host/File.h
    M lldb/source/Host/common/File.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
    A lldb/test/API/functionalities/gdb_remote_client/TestGDBRemotePlatformFile.py
    M lldb/test/API/functionalities/gdb_remote_client/gdbclientutils.py

  Log Message:
  -----------
  [lldb] [gdb-remote] Sync vFile:open mode constants with GDB

Sync the mode constants used to drive vFile:open requests with these
used by GDB and defined for the gdb remote protocol.  This makes it
possible to use 'platform file open' after connecting to gdbremote
server (and to some degree to operate on the open file modulo other
incompatibilities).

Differential Revision: https://reviews.llvm.org/D106985


  Commit: 9929cfbcd5bf5402fbb180e5bb3f917f50bbdf94
      https://github.com/llvm/llvm-project/commit/9929cfbcd5bf5402fbb180e5bb3f917f50bbdf94
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2021-08-09 (Mon, 09 Aug 2021)

  Changed paths:
    M lldb/docs/lldb-platform-packets.txt
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
    M lldb/test/API/functionalities/gdb_remote_client/TestGDBRemotePlatformFile.py
    A lldb/test/API/tools/lldb-server/TestGdbRemotePlatformFile.py

  Log Message:
  -----------
  [lldb] [gdb-remote] Use hexadecimal numbers in vFile packats for GDB compliance

Use hexadecimal numbers rather than decimal in various vFile packets
in order to fix compatibility with gdbserver.  This also changes the few
custom LLDB packets -- while technically they do not have to be changed,
it is easier to use the same syntax consistently across LLDB.

Differential Revision: https://reviews.llvm.org/D107475


Compare: https://github.com/llvm/llvm-project/compare/8a7c657c4d65...9929cfbcd5bf


More information about the All-commits mailing list