1 //===-- PlatformAndroid.h ---------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef liblldb_PlatformAndroid_h_ 11 #define liblldb_PlatformAndroid_h_ 12 13 // C Includes 14 // C++ Includes 15 16 #include <string> 17 18 // Other libraries and framework includes 19 // Project includes 20 #include "Plugins/Platform/Linux/PlatformLinux.h" 21 22 namespace lldb_private { 23 namespace platform_android { 24 25 class PlatformAndroid : public platform_linux::PlatformLinux 26 { 27 public: 28 static void 29 Initialize (); 30 31 static void 32 Terminate (); 33 34 PlatformAndroid (bool is_host); 35 36 virtual 37 ~PlatformAndroid(); 38 39 //------------------------------------------------------------ 40 // lldb_private::PluginInterface functions 41 //------------------------------------------------------------ 42 static lldb::PlatformSP 43 CreateInstance (bool force, const ArchSpec *arch); 44 45 static ConstString 46 GetPluginNameStatic (bool is_host); 47 48 static const char * 49 GetPluginDescriptionStatic (bool is_host); 50 51 ConstString 52 GetPluginName() override; 53 54 uint32_t 55 GetPluginVersion() override 56 { 57 return 1; 58 } 59 60 //------------------------------------------------------------ 61 // lldb_private::Platform functions 62 //------------------------------------------------------------ 63 64 Error 65 ConnectRemote (Args& args) override; 66 67 Error 68 GetFile (const FileSpec& source, 69 const FileSpec& destination) override; 70 71 Error 72 PutFile (const FileSpec& source, 73 const FileSpec& destination, 74 uint32_t uid = UINT32_MAX, 75 uint32_t gid = UINT32_MAX) override; 76 77 uint32_t 78 GetSdkVersion(); 79 80 bool 81 GetRemoteOSVersion() override; 82 83 Error 84 DisconnectRemote () override; 85 86 protected: 87 const char * 88 GetCacheHostname () override; 89 90 Error 91 DownloadModuleSlice (const FileSpec &src_file_spec, 92 const uint64_t src_offset, 93 const uint64_t src_size, 94 const FileSpec &dst_file_spec) override; 95 96 Error 97 DownloadSymbolFile (const lldb::ModuleSP& module_sp, 98 const FileSpec& dst_file_spec) override; 99 100 private: 101 std::string m_device_id; 102 uint32_t m_sdk_version; 103 104 DISALLOW_COPY_AND_ASSIGN (PlatformAndroid); 105 }; 106 107 } // namespace platofor_android 108 } // namespace lldb_private 109 110 #endif // liblldb_PlatformAndroid_h_ 111