2015-02-13 02:13:44 +08:00
|
|
|
//===-- PlatformAndroid.h ---------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef liblldb_PlatformAndroid_h_
|
|
|
|
#define liblldb_PlatformAndroid_h_
|
|
|
|
|
|
|
|
// C Includes
|
|
|
|
// C++ Includes
|
2016-07-01 02:10:27 +08:00
|
|
|
#include <memory>
|
2015-03-26 01:58:13 +08:00
|
|
|
#include <string>
|
|
|
|
|
2015-02-13 02:13:44 +08:00
|
|
|
// Other libraries and framework includes
|
|
|
|
// Project includes
|
|
|
|
#include "Plugins/Platform/Linux/PlatformLinux.h"
|
|
|
|
|
2016-07-01 02:10:27 +08:00
|
|
|
#include "AdbClient.h"
|
|
|
|
|
2015-02-13 02:13:44 +08:00
|
|
|
namespace lldb_private {
|
2015-03-31 17:52:22 +08:00
|
|
|
namespace platform_android {
|
2015-02-13 02:13:44 +08:00
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
class PlatformAndroid : public platform_linux::PlatformLinux {
|
|
|
|
public:
|
|
|
|
PlatformAndroid(bool is_host);
|
|
|
|
|
|
|
|
~PlatformAndroid() override;
|
|
|
|
|
|
|
|
static void Initialize();
|
|
|
|
|
|
|
|
static void Terminate();
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
// lldb_private::PluginInterface functions
|
|
|
|
//------------------------------------------------------------
|
|
|
|
static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
|
|
|
|
|
|
|
|
static ConstString GetPluginNameStatic(bool is_host);
|
|
|
|
|
|
|
|
static const char *GetPluginDescriptionStatic(bool is_host);
|
|
|
|
|
|
|
|
ConstString GetPluginName() override;
|
|
|
|
|
|
|
|
uint32_t GetPluginVersion() override { return 1; }
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
// lldb_private::Platform functions
|
|
|
|
//------------------------------------------------------------
|
|
|
|
|
2017-05-12 12:51:55 +08:00
|
|
|
Status ConnectRemote(Args &args) override;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2017-05-12 12:51:55 +08:00
|
|
|
Status GetFile(const FileSpec &source, const FileSpec &destination) override;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2017-05-12 12:51:55 +08:00
|
|
|
Status PutFile(const FileSpec &source, const FileSpec &destination,
|
|
|
|
uint32_t uid = UINT32_MAX, uint32_t gid = UINT32_MAX) override;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
|
|
|
uint32_t GetSdkVersion();
|
|
|
|
|
|
|
|
bool GetRemoteOSVersion() override;
|
|
|
|
|
2017-05-12 12:51:55 +08:00
|
|
|
Status DisconnectRemote() override;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
|
|
|
uint32_t GetDefaultMemoryCacheLineSize() override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
const char *GetCacheHostname() override;
|
|
|
|
|
2017-05-12 12:51:55 +08:00
|
|
|
Status DownloadModuleSlice(const FileSpec &src_file_spec,
|
|
|
|
const uint64_t src_offset, const uint64_t src_size,
|
|
|
|
const FileSpec &dst_file_spec) override;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2017-05-12 12:51:55 +08:00
|
|
|
Status DownloadSymbolFile(const lldb::ModuleSP &module_sp,
|
|
|
|
const FileSpec &dst_file_spec) override;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2017-08-15 00:39:16 +08:00
|
|
|
llvm::StringRef
|
|
|
|
GetLibdlFunctionDeclarations(lldb_private::Process *process) override;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
|
|
|
private:
|
2017-05-12 12:51:55 +08:00
|
|
|
AdbClient::SyncService *GetSyncService(Status &error);
|
2016-09-07 04:57:50 +08:00
|
|
|
|
|
|
|
std::unique_ptr<AdbClient::SyncService> m_adb_sync_svc;
|
|
|
|
std::string m_device_id;
|
|
|
|
uint32_t m_sdk_version;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(PlatformAndroid);
|
|
|
|
};
|
2015-03-31 17:52:22 +08:00
|
|
|
|
|
|
|
} // namespace platofor_android
|
2015-02-13 02:13:44 +08:00
|
|
|
} // namespace lldb_private
|
|
|
|
|
2015-10-27 08:45:06 +08:00
|
|
|
#endif // liblldb_PlatformAndroid_h_
|