aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
diff options
context:
space:
mode:
authorAnthony Ha <anthonyha96@gmail.com>2024-05-03 11:51:25 -0700
committerGitHub <noreply@github.com>2024-05-03 11:51:25 -0700
commit2f58b9aae2d6f1aeaecd98766ef31cebc0dcbb5b (patch)
tree541e0950889366ccdc301be85df99440a01691e2 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
parentf8a9973f8c1ef60281ace6f3cfeb24d9dcd5b3c3 (diff)
downloadllvm-2f58b9aae2d6f1aeaecd98766ef31cebc0dcbb5b.zip
llvm-2f58b9aae2d6f1aeaecd98766ef31cebc0dcbb5b.tar.gz
llvm-2f58b9aae2d6f1aeaecd98766ef31cebc0dcbb5b.tar.bz2
[lldb] Unify CalculateMD5 return types (#90921)
# Overview In my previous PR: https://github.com/llvm/llvm-project/pull/88812, @JDevlieghere suggested to match return types of the various calculate md5 functions. This PR achieves that by changing the various calculate md5 functions to return `llvm::ErrorOr<llvm::MD5::MD5Result>`.   The suggestion was to go for `std::optional<>` but I opted for `llvm::ErrorOr<>` because local calculate md5 was already possibly returning `ErrorOr`. To make sure I didn't break the md5 calculation functionality, I ran some tests for the gdb remote client, and things seem to work. # Testing 1. Remote file doesn't exist ![image](https://github.com/llvm/llvm-project/assets/1326275/b26859e2-18c3-4685-be8f-c6b6a5a4bc77) 1. Remote file differs ![image](https://github.com/llvm/llvm-project/assets/1326275/cbdb3c58-555a-401b-9444-c5ff4c04c491) 1. Remote file matches ![image](https://github.com/llvm/llvm-project/assets/1326275/07561572-22d1-4e0a-988f-bc91b5c2ffce) ## Test gaps Unfortunately, I had to modify `lldb/source/Plugins/Platform/MacOSX/PlatformDarwinDevice.cpp` and I can't test the changes there. Hopefully, the existing test suite / code review from whomever is reading this will catch any issues. Co-authored-by: Anthony Ha <antha@microsoft.com>
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
index 4be7eb0..898d176 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
@@ -392,7 +392,7 @@ public:
*command_output, // Pass nullptr if you don't want the command output
const Timeout<std::micro> &timeout);
- bool CalculateMD5(const FileSpec &file_spec, uint64_t &low, uint64_t &high);
+ llvm::ErrorOr<llvm::MD5::MD5Result> CalculateMD5(const FileSpec &file_spec);
lldb::DataBufferSP ReadRegister(
lldb::tid_t tid,