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 LLDB_SOURCE_PLUGINS_PLATFORM_ANDROID_PLATFORMANDROID_H
10#define LLDB_SOURCE_PLUGINS_PLATFORM_ANDROID_PLATFORMANDROID_H
11
12#include <memory>
13#include <string>
14
16
17#include "AdbClient.h"
18
19namespace lldb_private {
20namespace platform_android {
21
23public:
24 PlatformAndroid(bool is_host);
25
26 static void Initialize();
27
28 static void Terminate();
29
30 // lldb_private::PluginInterface functions
31 static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
32
33 static llvm::StringRef GetPluginNameStatic(bool is_host) {
34 return is_host ? Platform::GetHostPlatformName() : "remote-android";
35 }
36
37 static llvm::StringRef GetPluginDescriptionStatic(bool is_host);
38
39 llvm::StringRef GetPluginName() override {
41 }
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
60protected:
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
73private:
75
76 std::unique_ptr<AdbClient::SyncService> m_adb_sync_svc;
77 std::string m_device_id;
79};
80
81} // namespace platofor_android
82} // namespace lldb_private
83
84#endif // LLDB_SOURCE_PLUGINS_PLATFORM_ANDROID_PLATFORMANDROID_H
static llvm::raw_ostream & error(Stream &strm)
An architecture specification class.
Definition: ArchSpec.h:32
A command line argument class.
Definition: Args.h:33
A file utility class.
Definition: FileSpec.h:56
bool IsHost() const
Definition: Platform.h:421
static const char * GetHostPlatformName()
Definition: Platform.cpp:62
A plug-in interface definition class for debugging a process.
Definition: Process.h:343
An error handling class.
Definition: Status.h:44
std::unique_ptr< AdbClient::SyncService > m_adb_sync_svc
Status GetFile(const FileSpec &source, const FileSpec &destination) override
static llvm::StringRef GetPluginDescriptionStatic(bool is_host)
static llvm::StringRef GetPluginNameStatic(bool is_host)
Status PutFile(const FileSpec &source, const FileSpec &destination, uint32_t uid=UINT32_MAX, uint32_t gid=UINT32_MAX) override
Status DownloadSymbolFile(const lldb::ModuleSP &module_sp, const FileSpec &dst_file_spec) override
llvm::StringRef GetLibdlFunctionDeclarations(lldb_private::Process *process) override
uint32_t GetDefaultMemoryCacheLineSize() override
Allow the platform to set preferred memory cache line size.
Status DownloadModuleSlice(const FileSpec &src_file_spec, const uint64_t src_offset, const uint64_t src_size, const FileSpec &dst_file_spec) override
static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch)
AdbClient::SyncService * GetSyncService(Status &error)
#define UINT32_MAX
Definition: lldb-defines.h:19
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14