LLDB  mainline
PlatformRemoteDarwinDevice.h
Go to the documentation of this file.
1 //===-- PlatformRemoteDarwinDevice.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_MACOSX_PLATFORMREMOTEDARWINDEVICE_H
10 #define LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEDARWINDEVICE_H
11 
12 #include <string>
13 
14 #include "PlatformDarwin.h"
15 #include "lldb/Utility/FileSpec.h"
16 
17 #include "llvm/Support/FileSystem.h"
18 
20 public:
22 
23  ~PlatformRemoteDarwinDevice() override;
24 
25  // lldb_private::Platform functions
27  const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp,
28  const lldb_private::FileSpecList *module_search_paths_ptr) override;
29 
30  void GetStatus(lldb_private::Stream &strm) override;
31 
32  virtual lldb_private::Status
33  GetSymbolFile(const lldb_private::FileSpec &platform_file,
34  const lldb_private::UUID *uuid_ptr,
35  lldb_private::FileSpec &local_file);
36 
38  GetSharedModule(const lldb_private::ModuleSpec &module_spec,
39  lldb_private::Process *process, lldb::ModuleSP &module_sp,
40  const lldb_private::FileSpecList *module_search_paths_ptr,
42  bool *did_create_ptr) override;
43 
44  void
46  std::vector<std::string> &options) override {
48  target, options, lldb_private::XcodeSDK::Type::iPhoneOS);
49  }
50 
51 protected:
53  SDKDirectoryInfo(const lldb_private::FileSpec &sdk_dir_spec);
56  llvm::VersionTuple version;
58  };
59 
60  typedef std::vector<SDKDirectoryInfo> SDKDirectoryInfoCollection;
61 
62  std::mutex m_sdk_dir_mutex;
69 
71 
72  const char *GetDeviceSupportDirectory();
73 
75 
77 
79 
82  llvm::sys::fs::file_type ft,
83  llvm::StringRef path);
84 
85  uint32_t FindFileInAllSDKs(const char *platform_file_path,
86  lldb_private::FileSpecList &file_list);
87 
88  bool GetFileInSDK(const char *platform_file_path, uint32_t sdk_idx,
89  lldb_private::FileSpec &local_file);
90 
92  lldb_private::FileSpecList &file_list);
93 
95 
96  // Get index of SDK in SDKDirectoryInfoCollection by its pointer and return
97  // UINT32_MAX if that SDK not found.
99 
100  virtual llvm::StringRef GetDeviceSupportDirectoryName() = 0;
101  virtual llvm::StringRef GetPlatformName() = 0;
102 
103 private:
106  operator=(const PlatformRemoteDarwinDevice &) = delete;
107 };
108 
109 #endif // LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEDARWINDEVICE_H
PlatformRemoteDarwinDevice::m_device_support_directory_for_os_version
std::string m_device_support_directory_for_os_version
Definition: PlatformRemoteDarwinDevice.h:65
lldb_private::UUID
Definition: UUID.h:23
PlatformRemoteDarwinDevice::SDKDirectoryInfo
Definition: PlatformRemoteDarwinDevice.h:52
PlatformRemoteDarwinDevice::SDKDirectoryInfoCollection
std::vector< SDKDirectoryInfo > SDKDirectoryInfoCollection
Definition: PlatformRemoteDarwinDevice.h:60
PlatformRemoteDarwinDevice::PlatformRemoteDarwinDevice
PlatformRemoteDarwinDevice()
Default Constructor.
Definition: PlatformRemoteDarwinDevice.cpp:39
PlatformRemoteDarwinDevice::m_build_update
std::string m_build_update
Definition: PlatformRemoteDarwinDevice.h:66
PlatformRemoteDarwinDevice::GetSDKIndexBySDKDirectoryInfo
uint32_t GetSDKIndexBySDKDirectoryInfo(const SDKDirectoryInfo *sdk_info)
Definition: PlatformRemoteDarwinDevice.cpp:651
PlatformRemoteDarwinDevice::GetSDKDirectoryForLatestOSVersion
const SDKDirectoryInfo * GetSDKDirectoryForLatestOSVersion()
Definition: PlatformRemoteDarwinDevice.cpp:321
PlatformRemoteDarwinDevice::m_last_module_sdk_idx
uint32_t m_last_module_sdk_idx
Definition: PlatformRemoteDarwinDevice.h:67
lldb_private::Process
Definition: Process.h:342
PlatformRemoteDarwinDevice::GetSDKDirectoryForCurrentOSVersion
const SDKDirectoryInfo * GetSDKDirectoryForCurrentOSVersion()
Definition: PlatformRemoteDarwinDevice.cpp:263
PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded
bool UpdateSDKDirectoryInfosIfNeeded()
Definition: PlatformRemoteDarwinDevice.cpp:141
PlatformRemoteDarwinDevice::AddClangModuleCompilationOptions
void AddClangModuleCompilationOptions(lldb_private::Target *target, std::vector< std::string > &options) override
Definition: PlatformRemoteDarwinDevice.h:45
lldb_private::Stream
Definition: Stream.h:28
PlatformRemoteDarwinDevice
Definition: PlatformRemoteDarwinDevice.h:19
lldb_private::Target
Definition: Target.h:454
PlatformDarwin
Definition: PlatformDarwin.h:25
PlatformRemoteDarwinDevice::GetDeviceSupportDirectory
const char * GetDeviceSupportDirectory()
Definition: PlatformRemoteDarwinDevice.cpp:335
PlatformRemoteDarwinDevice::GetSymbolFile
virtual lldb_private::Status GetSymbolFile(const lldb_private::FileSpec &platform_file, const lldb_private::UUID *uuid_ptr, lldb_private::FileSpec &local_file)
Definition: PlatformRemoteDarwinDevice.cpp:438
PlatformRemoteDarwinDevice::SDKDirectoryInfo::version
llvm::VersionTuple version
Definition: PlatformRemoteDarwinDevice.h:56
lldb_private::FileSpec
Definition: FileSpec.h:56
PlatformRemoteDarwinDevice::GetFileInSDK
bool GetFileInSDK(const char *platform_file_path, uint32_t sdk_idx, lldb_private::FileSpec &local_file)
Definition: PlatformRemoteDarwinDevice.cpp:405
PlatformRemoteDarwinDevice::m_sdk_dir_mutex
std::mutex m_sdk_dir_mutex
Definition: PlatformRemoteDarwinDevice.h:62
PlatformRemoteDarwinDevice::GetSharedModule
lldb_private::Status GetSharedModule(const lldb_private::ModuleSpec &module_spec, lldb_private::Process *process, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, llvm::SmallVectorImpl< lldb::ModuleSP > *old_modules, bool *did_create_ptr) override
Definition: PlatformRemoteDarwinDevice.cpp:498
PlatformDarwin::AddClangModuleCompilationOptionsForSDKType
void AddClangModuleCompilationOptionsForSDKType(lldb_private::Target *target, std::vector< std::string > &options, lldb_private::XcodeSDK::Type sdk_type)
Definition: PlatformDarwin.cpp:1510
PlatformRemoteDarwinDevice::SDKDirectoryInfo::directory
lldb_private::FileSpec directory
Definition: PlatformRemoteDarwinDevice.h:54
lldb_private::FileSystem::EnumerateDirectoryResult
EnumerateDirectoryResult
Definition: FileSystem.h:162
lldb_private::ConstString
Definition: ConstString.h:40
PlatformRemoteDarwinDevice::GetContainedFilesIntoVectorOfStringsCallback
static lldb_private::FileSystem::EnumerateDirectoryResult GetContainedFilesIntoVectorOfStringsCallback(void *baton, llvm::sys::fs::file_type ft, llvm::StringRef path)
Definition: PlatformRemoteDarwinDevice.cpp:134
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:39
PlatformRemoteDarwinDevice::m_device_support_directory
std::string m_device_support_directory
Definition: PlatformRemoteDarwinDevice.h:64
PlatformRemoteDarwinDevice::~PlatformRemoteDarwinDevice
~PlatformRemoteDarwinDevice() override
Destructor.
PlatformRemoteDarwinDevice::operator=
const PlatformRemoteDarwinDevice & operator=(const PlatformRemoteDarwinDevice &)=delete
PlatformRemoteDarwinDevice::GetDeviceSupportDirectoryName
virtual llvm::StringRef GetDeviceSupportDirectoryName()=0
PlatformRemoteDarwinDevice::GetStatus
void GetStatus(lldb_private::Stream &strm) override
Report the current status for this platform.
Definition: PlatformRemoteDarwinDevice.cpp:50
PlatformRemoteDarwinDevice::GetPlatformName
virtual llvm::StringRef GetPlatformName()=0
lldb_private::ModuleSpec
Definition: ModuleSpec.h:26
lldb_private::Status
Definition: Status.h:44
uint32_t
PlatformRemoteDarwinDevice::m_connected_module_sdk_idx
uint32_t m_connected_module_sdk_idx
Definition: PlatformRemoteDarwinDevice.h:68
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:31
PlatformRemoteDarwinDevice::m_sdk_directory_infos
SDKDirectoryInfoCollection m_sdk_directory_infos
Definition: PlatformRemoteDarwinDevice.h:63
PlatformRemoteDarwinDevice::FindFileInAllSDKs
uint32_t FindFileInAllSDKs(const char *platform_file_path, lldb_private::FileSpecList &file_list)
FileSpec.h
PlatformRemoteDarwinDevice::SDKDirectoryInfo::user_cached
bool user_cached
Definition: PlatformRemoteDarwinDevice.h:57
PlatformRemoteDarwinDevice::SDKDirectoryInfo::SDKDirectoryInfo
SDKDirectoryInfo(const lldb_private::FileSpec &sdk_dir_spec)
Definition: PlatformRemoteDarwinDevice.cpp:29
llvm::SmallVectorImpl
Definition: Disassembler.h:42
PlatformRemoteDarwinDevice::ResolveExecutable
lldb_private::Status ResolveExecutable(const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr) override
Definition: PlatformRemoteDarwinDevice.cpp:66
PlatformDarwin.h
PlatformRemoteDarwinDevice::GetDeviceSupportDirectoryForOSVersion
const char * GetDeviceSupportDirectoryForOSVersion()
Definition: PlatformRemoteDarwinDevice.cpp:356
PlatformRemoteDarwinDevice::SDKDirectoryInfo::build
lldb_private::ConstString build
Definition: PlatformRemoteDarwinDevice.h:55
PlatformRemoteDarwinDevice::GetConnectedSDKIndex
uint32_t GetConnectedSDKIndex()
Definition: PlatformRemoteDarwinDevice.cpp:630