1 //===-- PlatformAndroid.h ---------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_PlatformAndroid_h_
11 #define liblldb_PlatformAndroid_h_
18 // Other libraries and framework includes
20 #include "Plugins/Platform/Linux/PlatformLinux.h"
22 #include "AdbClient.h"
24 namespace lldb_private {
25 namespace platform_android {
27 class PlatformAndroid : public platform_linux::PlatformLinux {
29 PlatformAndroid(bool is_host);
31 ~PlatformAndroid() override;
33 static void Initialize();
35 static void Terminate();
37 //------------------------------------------------------------
38 // lldb_private::PluginInterface functions
39 //------------------------------------------------------------
40 static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
42 static ConstString GetPluginNameStatic(bool is_host);
44 static const char *GetPluginDescriptionStatic(bool is_host);
46 ConstString GetPluginName() override;
48 uint32_t GetPluginVersion() override { return 1; }
50 //------------------------------------------------------------
51 // lldb_private::Platform functions
52 //------------------------------------------------------------
54 Error ConnectRemote(Args &args) override;
56 Error GetFile(const FileSpec &source, const FileSpec &destination) override;
58 Error PutFile(const FileSpec &source, const FileSpec &destination,
59 uint32_t uid = UINT32_MAX, uint32_t gid = UINT32_MAX) override;
61 uint32_t GetSdkVersion();
63 bool GetRemoteOSVersion() override;
65 Error DisconnectRemote() override;
67 uint32_t GetDefaultMemoryCacheLineSize() override;
70 const char *GetCacheHostname() override;
72 Error DownloadModuleSlice(const FileSpec &src_file_spec,
73 const uint64_t src_offset, const uint64_t src_size,
74 const FileSpec &dst_file_spec) override;
76 Error DownloadSymbolFile(const lldb::ModuleSP &module_sp,
77 const FileSpec &dst_file_spec) override;
79 const char *GetLibdlFunctionDeclarations() const override;
82 AdbClient::SyncService *GetSyncService(Error &error);
84 std::unique_ptr<AdbClient::SyncService> m_adb_sync_svc;
85 std::string m_device_id;
86 uint32_t m_sdk_version;
88 DISALLOW_COPY_AND_ASSIGN(PlatformAndroid);
91 } // namespace platofor_android
92 } // namespace lldb_private
94 #endif // liblldb_PlatformAndroid_h_