LLDB mainline
|
#include "AdbClient.h"
#include "lldb/Host/ConnectionFileDescriptor.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Utility/Connection.h"
#include "lldb/Utility/DataEncoder.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/Timeout.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/FileUtilities.h"
#include <chrono>
#include <climits>
#include <cstdlib>
#include <fstream>
#include <sstream>
Go to the source code of this file.
Functions | |
const seconds | kReadTimeout (20) |
static Status | ReadAllBytes (Connection &conn, void *buffer, size_t size) |
static Status | ReadAdbMessage (Connection &conn, std::vector< char > &message) |
static Status | GetResponseError (Connection &conn, const char *response_id) |
static Status | ReadResponseStatus (Connection &conn) |
static Status | SendAdbMessage (Connection &conn, llvm::StringRef packet) |
static Status | ConnectToAdb (Connection &conn) |
static Status | EnterSyncMode (Connection &conn) |
static Status | SelectTargetDevice (Connection &conn, llvm::StringRef device_id) |
Variables | |
static const char * | kSocketNamespaceAbstract = "localabstract" |
static const char * | kSocketNamespaceFileSystem = "localfilesystem" |
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 |
static const size_t | kMaxPushData = 2 * 1024 |
static const uint32_t | kDefaultMode = 0100770 |
|
static |
Definition at line 149 of file AdbClient.cpp.
References lldb_private::Connection::Connect(), error(), lldb_private::GetLog(), LLDB_LOGF, and lldb_private::Platform.
Referenced by lldb_private::platform_android::AdbClient::Connect(), lldb_private::platform_android::AdbClient::ResolveDeviceID(), and lldb_private::platform_android::AdbSyncService::SetupSyncConnection().
|
static |
Definition at line 163 of file AdbClient.cpp.
References error(), ReadResponseStatus(), and SendAdbMessage().
Referenced by lldb_private::platform_android::AdbSyncService::SetupSyncConnection().
|
static |
Definition at line 100 of file AdbClient.cpp.
References error(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::GetLog(), kFAIL, LLDB_LOGF, lldb_private::Platform, ReadAdbMessage(), and lldb_private::Status.
Referenced by ReadResponseStatus().
const seconds kReadTimeout | ( | 20 | ) |
Referenced by ReadAllBytes().
|
static |
Definition at line 79 of file AdbClient.cpp.
References error(), and ReadAllBytes().
Referenced by GetResponseError(), and lldb_private::platform_android::AdbClient::ResolveDeviceID().
|
static |
Definition at line 52 of file AdbClient.cpp.
References lldb::eConnectionStatusSuccess, error(), lldb_private::Status::FromErrorStringWithFormat(), kReadTimeout(), and lldb_private::Connection::Read().
Referenced by lldb_private::platform_android::AdbSyncService::PullFileChunk(), lldb_private::platform_android::AdbSyncService::PushFileImpl(), ReadAdbMessage(), ReadResponseStatus(), lldb_private::platform_android::AdbSyncService::ReadSyncHeader(), and lldb_private::platform_android::AdbSyncService::StatImpl().
|
static |
Definition at line 116 of file AdbClient.cpp.
References error(), GetResponseError(), kOKAY, and ReadAllBytes().
Referenced by lldb_private::platform_android::AdbClient::DeletePortForwarding(), EnterSyncMode(), lldb_private::platform_android::AdbClient::internalShell(), lldb_private::platform_android::AdbClient::ResolveDeviceID(), SelectTargetDevice(), lldb_private::platform_android::AdbClient::SetPortForwarding(), and lldb_private::platform_android::AdbClient::SetPortForwarding().
|
static |
Definition at line 171 of file AdbClient.cpp.
References error(), lldb_private::GetLog(), LLDB_LOG, lldb_private::Platform, ReadResponseStatus(), and SendAdbMessage().
Referenced by lldb_private::platform_android::AdbClient::internalShell(), and lldb_private::platform_android::AdbSyncService::SetupSyncConnection().
|
static |
Definition at line 132 of file AdbClient.cpp.
References error(), and lldb_private::Connection::Write().
Referenced by EnterSyncMode(), lldb_private::platform_android::AdbClient::internalShell(), lldb_private::platform_android::AdbClient::ResolveDeviceID(), SelectTargetDevice(), and lldb_private::platform_android::AdbClient::SendDeviceMessage().
|
static |
Definition at line 43 of file AdbClient.cpp.
Referenced by lldb_private::platform_android::AdbSyncService::PullFileChunk(), and lldb_private::platform_android::AdbSyncService::PushFileImpl().
|
static |
Definition at line 50 of file AdbClient.cpp.
Referenced by lldb_private::platform_android::AdbSyncService::PushFileImpl().
|
static |
Definition at line 44 of file AdbClient.cpp.
Referenced by lldb_private::platform_android::AdbSyncService::PullFileChunk(), and lldb_private::platform_android::AdbSyncService::PushFileImpl().
|
static |
Definition at line 42 of file AdbClient.cpp.
Referenced by GetResponseError(), lldb_private::platform_android::AdbSyncService::PullFileChunk(), and lldb_private::platform_android::AdbSyncService::PushFileImpl().
|
static |
Definition at line 49 of file AdbClient.cpp.
Referenced by lldb_private::platform_android::AdbSyncService::PushFileImpl().
|
static |
Definition at line 41 of file AdbClient.cpp.
Referenced by lldb_private::platform_android::AdbSyncService::PushFileImpl(), and ReadResponseStatus().
|
static |
Definition at line 46 of file AdbClient.cpp.
Referenced by lldb_private::platform_android::AdbSyncService::PullFileImpl().
|
static |
Definition at line 45 of file AdbClient.cpp.
Referenced by lldb_private::platform_android::AdbSyncService::PushFileImpl().
|
static |
Definition at line 38 of file AdbClient.cpp.
Referenced by lldb_private::platform_android::AdbClient::SetPortForwarding().
|
static |
Definition at line 39 of file AdbClient.cpp.
Referenced by lldb_private::platform_android::AdbClient::SetPortForwarding().
|
static |
Definition at line 47 of file AdbClient.cpp.
Referenced by lldb_private::platform_android::AdbSyncService::StatImpl().
|
static |
Definition at line 48 of file AdbClient.cpp.
Referenced by lldb_private::platform_android::AdbSyncService::ReadSyncHeader(), and lldb_private::platform_android::AdbSyncService::SendSyncRequest().