[all-commits] [llvm/llvm-project] 2c6d90: [lldb] [Commands] Remove 'append' from 'platform f...

Michał Górny via All-commits all-commits at lists.llvm.org
Wed Sep 8 06:42:30 PDT 2021


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

  Changed paths:
    M lldb/source/Commands/CommandObjectPlatform.cpp
    M lldb/test/API/functionalities/gdb_remote_client/TestGDBRemotePlatformFile.py

  Log Message:
  -----------
  [lldb] [Commands] Remove 'append' from 'platform file open' mode

Remove File::eOpenOptionAppend from the mode used by 'platform file
open' command.  According to POSIX, O_APPEND causes all successive
writes to be done at the end of the file.  This effectively makes
the offset argument to 'platform file write' meaningless.

Furthermore, apparently O_APPEND is not implemented reliably everywhere.
The Linux manpage for pwrite(2) suggests that Linux does respect
O_APPEND there while according to POSIX it should not, so the actual
behavior would be dependent on how the vFile:pwrite packet is
implemented on the server.

Ideally, the mode used for opening flags would be provided via options.
However, changing the default mode seems to be a reasonable intermediate
solution.

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




More information about the All-commits mailing list