[PATCH] D57011: Refactor HAVE_LIBCOMPRESSION and related code in GDBRemoteCommunication
Raphael Isemann via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 25 00:22:04 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL352175: Refactor HAVE_LIBCOMPRESSION and related code in GDBRemoteCommunication (authored by teemperor, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D57011?vs=183265&id=183488#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57011/new/
https://reviews.llvm.org/D57011
Files:
lldb/trunk/include/lldb/Host/Config.h
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -41,8 +41,7 @@
#define DEBUGSERVER_BASENAME "lldb-server"
#endif
-#if defined(__APPLE__)
-#define HAVE_LIBCOMPRESSION
+#if defined(HAVE_LIBCOMPRESSION)
#include <compression.h>
#endif
@@ -67,10 +66,7 @@
#endif
m_echo_number(0), m_supports_qEcho(eLazyBoolCalculate), m_history(512),
m_send_acks(true), m_compression_type(CompressionType::None),
- m_listen_url(), m_decompression_scratch_type(CompressionType::None),
- m_decompression_scratch(nullptr) {
- // Unused unless HAVE_LIBCOMPRESSION is defined.
- (void)m_decompression_scratch_type;
+ m_listen_url() {
}
//----------------------------------------------------------------------
@@ -81,8 +77,10 @@
Disconnect();
}
+#if defined(HAVE_LIBCOMPRESSION)
if (m_decompression_scratch)
free (m_decompression_scratch);
+#endif
// Stop the communications read thread which is used to parse all incoming
// packets. This function will block until the read thread returns.
Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
===================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
@@ -18,6 +18,7 @@
#include <vector>
#include "lldb/Core/Communication.h"
+#include "lldb/Host/Config.h"
#include "lldb/Host/HostThread.h"
#include "lldb/Utility/Args.h"
#include "lldb/Utility/Listener.h"
@@ -217,8 +218,10 @@
HostThread m_listen_thread;
std::string m_listen_url;
- CompressionType m_decompression_scratch_type;
- void *m_decompression_scratch;
+#if defined(HAVE_LIBCOMPRESSION)
+ CompressionType m_decompression_scratch_type = CompressionType::None;
+ void *m_decompression_scratch = nullptr;
+#endif
DISALLOW_COPY_AND_ASSIGN(GDBRemoteCommunication);
};
Index: lldb/trunk/include/lldb/Host/Config.h
===================================================================
--- lldb/trunk/include/lldb/Host/Config.h
+++ lldb/trunk/include/lldb/Host/Config.h
@@ -25,6 +25,8 @@
#define HAVE_SIGACTION 1
+#define HAVE_LIBCOMPRESSION 1
+
#else
#error This file is only used by the Xcode build.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57011.183488.patch
Type: text/x-patch
Size: 2515 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190125/3f1dd405/attachment.bin>
More information about the llvm-commits
mailing list