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 void DebuggerInitialize(lldb_private::Debugger &debugger);
34
35 static llvm::StringRef GetPluginNameStatic(bool is_host) {
36 return is_host ? Platform::GetHostPlatformName() : "remote-android";
37 }
38
39 static llvm::StringRef GetPluginDescriptionStatic(bool is_host);
40
41 llvm::StringRef GetPluginName() override {
43 }
44
45 // lldb_private::Platform functions
46
47 Status ConnectRemote(Args &args) override;
48
49 Status GetFile(const FileSpec &source, const FileSpec &destination) override;
50
51 Status PutFile(const FileSpec &source, const FileSpec &destination,
52 uint32_t uid = UINT32_MAX, uint32_t gid = UINT32_MAX) override;
53
54 uint32_t GetSdkVersion();
55
56 bool GetRemoteOSVersion() override;
57
58 Status DisconnectRemote() override;
59
60 uint32_t GetDefaultMemoryCacheLineSize() override;
61
62protected:
63 const char *GetCacheHostname() override;
64
65 Status DownloadModuleSlice(const FileSpec &src_file_spec,
66 const uint64_t src_offset, const uint64_t src_size,
67 const FileSpec &dst_file_spec) override;
68
70 const FileSpec &dst_file_spec) override;
71
72 llvm::StringRef
74
75 typedef std::unique_ptr<AdbClient> AdbClientUP;
77
78 virtual llvm::StringRef GetPropertyPackageName();
79
80 std::string GetRunAs();
81
82private:
84
85 std::unique_ptr<AdbClient::SyncService> m_adb_sync_svc;
86 std::string m_device_id;
87 uint32_t m_sdk_version;
88};
89
90} // namespace platform_android
91} // namespace lldb_private
92
93#endif // LLDB_SOURCE_PLUGINS_PLATFORM_ANDROID_PLATFORMANDROID_H
static llvm::raw_ostream & error(Stream &strm)
An architecture specification class.
Definition: ArchSpec.h:31
A command line argument class.
Definition: Args.h:33
A class to manage flag bits.
Definition: Debugger.h:80
A file utility class.
Definition: FileSpec.h:56
bool IsHost() const
Definition: Platform.h:478
static const char * GetHostPlatformName()
Definition: Platform.cpp:61
A plug-in interface definition class for debugging a process.
Definition: Process.h:341
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)
virtual AdbClientUP GetAdbClient(Status &error)
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
static void DebuggerInitialize(lldb_private::Debugger &debugger)
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.
std::shared_ptr< lldb_private::Platform > PlatformSP
Definition: lldb-forward.h:386
std::shared_ptr< lldb_private::Module > ModuleSP
Definition: lldb-forward.h:371