LLDB mainline
PlatformDarwinDevice.h
Go to the documentation of this file.
1//===-- PlatformDarwinDevice.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_PLATFORMDARWINDEVICE_H
10#define LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMDARWINDEVICE_H
11
12#include "PlatformDarwin.h"
13
14#include "lldb/Utility/Locked.h"
15#include "llvm/ADT/SmallVector.h"
16#include "llvm/ADT/StringRef.h"
17
18#include <string>
19
20namespace lldb_private {
21
22/// Abstract Darwin platform with a potential device support directory.
24public:
27
28protected:
30 const ModuleSpec &module_spec, lldb::ModuleSP &module_sp,
31 llvm::SmallVectorImpl<lldb::ModuleSP> *old_modules, bool *did_create_ptr,
32 Target &target);
33
35 SDKDirectoryInfo(const FileSpec &sdk_dir_spec, llvm::StringRef dirname_str);
38 llvm::VersionTuple version;
39 };
40
41 typedef std::vector<SDKDirectoryInfo> SDKDirectoryInfoCollection;
42
43 /// Look for expanded shared cache directories under the given dir.
44 /// Expanded shared cache directories found under the given dir will
45 /// be added to \a m_sdk_directory_infos.
46 ///
47 /// \param[in] dir
48 /// Directory to search under.
49 ///
50 /// \param[in] log_msg_descriptor
51 /// Text to describe the origin of this directory, in logging.
52 void AddSharedCacheDirectory(llvm::StringRef dir,
53 llvm::StringRef log_msg_descriptor);
54
56
59
62 llvm::sys::fs::file_type ft,
63 llvm::StringRef path);
64
65 const char *GetDeviceSupportDirectory();
67
68 virtual llvm::StringRef GetPlatformName() = 0;
69 virtual llvm::SmallVector<llvm::StringRef>
71
72 std::mutex m_sdk_dir_mutex;
74
75private:
77 /// Dependent modules are loaded in parallel, so more than one thread can
78 /// fill this at the same time.
80};
81} // namespace lldb_private
82
83#endif // LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMDARWINDEVICE_H
A uniqued constant string class.
Definition ConstString.h:40
A file utility class.
Definition FileSpec.h:56
Bundles a value of type T with the Mutex that guards it.
Definition Locked.h:178
Abstract Darwin platform with a potential device support directory.
static FileSystem::EnumerateDirectoryResult GetContainedFilesIntoVectorOfFileSpecsCallback(void *baton, llvm::sys::fs::file_type ft, llvm::StringRef path)
virtual llvm::StringRef GetPlatformName()=0
virtual Status GetSharedModuleWithLocalCache(const ModuleSpec &module_spec, lldb::ModuleSP &module_sp, llvm::SmallVectorImpl< lldb::ModuleSP > *old_modules, bool *did_create_ptr, Target &target)
std::vector< SDKDirectoryInfo > SDKDirectoryInfoCollection
const SDKDirectoryInfo * GetSDKDirectoryForCurrentOSVersion()
SDKDirectoryInfoCollection m_sdk_directory_infos
const SDKDirectoryInfo * GetSDKDirectoryForLatestOSVersion()
void AddSharedCacheDirectory(llvm::StringRef dir, llvm::StringRef log_msg_descriptor)
Look for expanded shared cache directories under the given dir.
virtual llvm::SmallVector< llvm::StringRef > GetDeviceSupportDirectoryNames()=0
Guarded< std::string, std::mutex > m_device_support_directory_for_os_version
Dependent modules are loaded in parallel, so more than one thread can fill this at the same time.
PlatformDarwin(const PlatformDarwin &)=delete
An error handling class.
Definition Status.h:118
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Module > ModuleSP
SDKDirectoryInfo(const FileSpec &sdk_dir_spec, llvm::StringRef dirname_str)