LLDB  mainline
PlatformAndroid.h
Go to the documentation of this file.
1 //===-- PlatformAndroid.h ---------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef liblldb_PlatformAndroid_h_
10 #define liblldb_PlatformAndroid_h_
11 
12 #include <memory>
13 #include <string>
14 
16 
17 #include "AdbClient.h"
18 
19 namespace lldb_private {
20 namespace platform_android {
21 
23 public:
24  PlatformAndroid(bool is_host);
25 
26  ~PlatformAndroid() override;
27 
28  static void Initialize();
29 
30  static void Terminate();
31 
32  // lldb_private::PluginInterface functions
33  static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
34 
35  static ConstString GetPluginNameStatic(bool is_host);
36 
37  static const char *GetPluginDescriptionStatic(bool is_host);
38 
39  ConstString GetPluginName() override;
40 
41  uint32_t GetPluginVersion() override { return 1; }
42 
43  // lldb_private::Platform functions
44 
45  Status ConnectRemote(Args &args) override;
46 
47  Status GetFile(const FileSpec &source, const FileSpec &destination) override;
48 
49  Status PutFile(const FileSpec &source, const FileSpec &destination,
50  uint32_t uid = UINT32_MAX, uint32_t gid = UINT32_MAX) override;
51 
53 
54  bool GetRemoteOSVersion() override;
55 
56  Status DisconnectRemote() override;
57 
59 
60 protected:
61  const char *GetCacheHostname() override;
62 
63  Status DownloadModuleSlice(const FileSpec &src_file_spec,
64  const uint64_t src_offset, const uint64_t src_size,
65  const FileSpec &dst_file_spec) override;
66 
67  Status DownloadSymbolFile(const lldb::ModuleSP &module_sp,
68  const FileSpec &dst_file_spec) override;
69 
70  llvm::StringRef
72 
73 private:
74  AdbClient::SyncService *GetSyncService(Status &error);
75 
76  std::unique_ptr<AdbClient::SyncService> m_adb_sync_svc;
77  std::string m_device_id;
78  uint32_t m_sdk_version;
79 
80  DISALLOW_COPY_AND_ASSIGN(PlatformAndroid);
81 };
82 
83 } // namespace platofor_android
84 } // namespace lldb_private
85 
86 #endif // liblldb_PlatformAndroid_h_
static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch)
A command line argument class.
Definition: Args.h:32
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
static const char * GetPluginDescriptionStatic(bool is_host)
A file utility class.
Definition: FileSpec.h:55
An architecture specification class.
Definition: ArchSpec.h:32
Status GetFile(const FileSpec &source, const FileSpec &destination) override
#define UINT32_MAX
Definition: lldb-defines.h:31
A plug-in interface definition class for debugging a process.
Definition: Process.h:353
Status DownloadSymbolFile(const lldb::ModuleSP &module_sp, const FileSpec &dst_file_spec) override
static ConstString GetPluginNameStatic(bool is_host)
uint32_t GetDefaultMemoryCacheLineSize() override
Allow the platform to set preferred memory cache line size.
A uniqued constant string class.
Definition: ConstString.h:38
Status DownloadModuleSlice(const FileSpec &src_file_spec, const uint64_t src_offset, const uint64_t src_size, const FileSpec &dst_file_spec) override
Status PutFile(const FileSpec &source, const FileSpec &destination, uint32_t uid=UINT32_MAX, uint32_t gid=UINT32_MAX) override
llvm::StringRef GetLibdlFunctionDeclarations(lldb_private::Process *process) override
An error handling class.
Definition: Status.h:44