[Lldb-commits] [PATCH] D123616: [debugserver] Add HAVE_LIBCOMPRESSION guards
Jonas Devlieghere via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Apr 12 09:16:13 PDT 2022
JDevlieghere created this revision.
JDevlieghere added a reviewer: jasonmolenda.
Herald added a project: All.
JDevlieghere requested review of this revision.
The current debugserver CMake allows it to be built with or without libcompression. It conditionally links against libcompression if it's available and sets the corresponding `HAVE_LIBCOMPRESSION` define. The code itself however is using libcompression unconditionally. This patch adds the missing `HAVE_LIBCOMPRESSION` guards. The other alternative is to make libcompression a hard dependency.
https://github.com/llvm/llvm-project/issues/112
https://reviews.llvm.org/D123616
Files:
lldb/tools/debugserver/source/RNBRemote.cpp
Index: lldb/tools/debugserver/source/RNBRemote.cpp
===================================================================
--- lldb/tools/debugserver/source/RNBRemote.cpp
+++ lldb/tools/debugserver/source/RNBRemote.cpp
@@ -45,7 +45,9 @@
#include "RNBSocket.h"
#include "StdStringExtractor.h"
+#if defined(HAVE_LIBCOMPRESSION)
#include <compression.h>
+#endif
#include <TargetConditionals.h>
#include <algorithm>
@@ -597,6 +599,7 @@
// If compression is not requested, the original packet contents are returned
std::string RNBRemote::CompressString(const std::string &orig) {
+#if defined(HAVE_LIBCOMPRESSION)
std::string compressed;
compression_types compression_type = GetCompressionType();
if (compression_type != compression_types::none) {
@@ -709,6 +712,9 @@
}
return compressed;
+#else
+ return orig;
+#endif
}
rnb_err_t RNBRemote::SendPacket(const std::string &s) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123616.422258.patch
Type: text/x-patch
Size: 903 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220412/ae66bbff/attachment.bin>
More information about the lldb-commits
mailing list