aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
diff options
context:
space:
mode:
authorMichał Górny <mgorny@moritz.systems>2021-08-10 12:03:35 +0200
committerMichał Górny <mgorny@moritz.systems>2021-09-10 14:08:36 +0200
commitdbb0c14d2729d135d9d6bb2d0e858e128129da08 (patch)
tree1da5eb36baa80bc00b3e242a434f1e5e26608266 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
parentc240d2bb06dabe8fb3a1c2da978fbdc9f642de73 (diff)
downloadllvm-dbb0c14d2729d135d9d6bb2d0e858e128129da08.zip
llvm-dbb0c14d2729d135d9d6bb2d0e858e128129da08.tar.gz
llvm-dbb0c14d2729d135d9d6bb2d0e858e128129da08.tar.bz2
[lldb] Add new commands and tests for getting file perms & exists
Add two new commands 'platform get-file-permissions' and 'platform file-exists' for the respective bits of LLDB protocol. Add tests for them. Fix error handling in GetFilePermissions(). Differential Revision: https://reviews.llvm.org/D107809
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
index 4109374..248fd57 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
@@ -661,9 +661,10 @@ GDBRemoteCommunicationServerCommon::Handle_vFile_Mode(
std::error_code ec;
const uint32_t mode = FileSystem::Instance().GetPermissions(file_spec, ec);
StreamString response;
- response.Printf("F%x", mode);
- if (mode == 0 || ec)
- response.Printf(",%x", (int)Status(ec).GetError());
+ if (mode != llvm::sys::fs::perms_not_known)
+ response.Printf("F%x", mode);
+ else
+ response.Printf("F-1,%x", (int)Status(ec).GetError());
return SendPacketNoLock(response.GetString());
}
return SendErrorResponse(23);