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         uint32_t
87         GetDefaultMemoryCacheLineSize() override;
88 
89      protected:
90         const char *
91         GetCacheHostname () override;
92 
93         Error
94         DownloadModuleSlice (const FileSpec &src_file_spec,
95                              const uint64_t src_offset,
96                              const uint64_t src_size,
97                              const FileSpec &dst_file_spec) override;
98 
99         Error
100         DownloadSymbolFile (const lldb::ModuleSP& module_sp,
101                             const FileSpec& dst_file_spec) override;
102 
103     private:
104         std::string m_device_id;
105         uint32_t m_sdk_version;
106 
107         DISALLOW_COPY_AND_ASSIGN (PlatformAndroid);
108     };
109 
110 } // namespace platofor_android
111 } // namespace lldb_private
112 
113 #endif  // liblldb_PlatformAndroid_h_
114