================ @@ -8,98 +8,45 @@ #include "AdbClient.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/FileUtilities.h" - -#include "lldb/Host/ConnectionFileDescriptor.h" -#include "lldb/Host/FileSystem.h" -#include "lldb/Host/PosixApi.h" -#include "lldb/Utility/DataBuffer.h" -#include "lldb/Utility/DataBufferHeap.h" -#include "lldb/Utility/DataEncoder.h" -#include "lldb/Utility/DataExtractor.h" +#include "lldb/Host/posix/ConnectionFileDescriptorPosix.h" #include "lldb/Utility/FileSpec.h" +#include "lldb/Utility/LLDBLog.h" +#include "lldb/Utility/Log.h" #include "lldb/Utility/StreamString.h" -#include "lldb/Utility/Timeout.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringRef.h" #include <climits> - -#include <algorithm> #include <cstdlib> -#include <fstream> #include <sstream> -// On Windows, transitive dependencies pull in <Windows.h>, which defines a -// macro that clashes with a method name. -#ifdef SendMessage -#undef SendMessage -#endif - using namespace lldb; using namespace lldb_private; using namespace lldb_private::platform_android; using namespace std::chrono; +using namespace adb_client_utils; -static const seconds kReadTimeout(20); -static const char *kOKAY = "OKAY"; -static const char *kFAIL = "FAIL"; -static const char *kDATA = "DATA"; -static const char *kDONE = "DONE"; - -static const char *kSEND = "SEND"; -static const char *kRECV = "RECV"; -static const char *kSTAT = "STAT"; - -static const size_t kSyncPacketLen = 8; -// Maximum size of a filesync DATA packet. -static const size_t kMaxPushData = 2 * 1024; -// Default mode for pushed files. -static const uint32_t kDefaultMode = 0100770; // S_IFREG | S_IRWXU | S_IRWXG - -static const char *kSocketNamespaceAbstract = "localabstract"; -static const char *kSocketNamespaceFileSystem = "localfilesystem"; - -static Status ReadAllBytes(Connection &conn, void *buffer, size_t size) { +const static char *kSocketNamespaceAbstract = "localabstract"; +const static char *kSocketNamespaceFileSystem = "localfilesystem"; ---------------- labath wrote:
(I realise you're following existing pattern, but this doesn't actually define a constant.) ```suggestion static constexpr char kSocketNamespaceAbstract[] = "localabstract"; static constexpr char kSocketNamespaceFileSystem[] = "localfilesystem"; ``` https://github.com/llvm/llvm-project/pull/145382 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits