[lldb] [gdb-remote] Implement fallback to vFile:stat for GetFileSize()
authorMichał Górny <mgorny@moritz.systems>
Mon, 9 Aug 2021 19:25:18 +0000 (21:25 +0200)
committerMichał Górny <mgorny@moritz.systems>
Fri, 10 Sep 2021 09:09:35 +0000 (11:09 +0200)
commit21e2d7ce43c42df5d60a2805c801b8f1eda7919c
tree65215c157754b83f3fd24df707a6bd4ae5478a0d
parent7d42eb3af7792fc3e8429f8a1581fd8c7dc5e7f5
[lldb] [gdb-remote] Implement fallback to vFile:stat for GetFileSize()

Implement a fallback to getting the file size via vFile:stat packet
when the remote server does not implement vFile:size.  This makes it
possible to query file sizes from remote gdbserver.

Note that unlike vFile:size, the fallback will not work if the server is
unable to open the file.

While at it, add a few tests for the 'platform get-size' command.

Differential Revision: https://reviews.llvm.org/D107780
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
lldb/test/API/functionalities/gdb_remote_client/TestGDBRemotePlatformFile.py