1 //===-- PlatformDarwinDevice.h ----------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMDARWINDEVICE_H
10 #define LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMDARWINDEVICE_H
12 #include "PlatformDarwin.h"
14 #include "llvm/ADT/StringRef.h"
18 namespace lldb_private
{
20 /// Abstract Darwin platform with a potential device support directory.
21 class PlatformDarwinDevice
: public PlatformDarwin
{
23 using PlatformDarwin::PlatformDarwin
;
24 ~PlatformDarwinDevice() override
;
27 virtual Status
GetSharedModuleWithLocalCache(
28 const ModuleSpec
&module_spec
, lldb::ModuleSP
&module_sp
,
29 const FileSpecList
*module_search_paths_ptr
,
30 llvm::SmallVectorImpl
<lldb::ModuleSP
> *old_modules
, bool *did_create_ptr
);
32 struct SDKDirectoryInfo
{
33 SDKDirectoryInfo(const FileSpec
&sdk_dir_spec
);
36 llvm::VersionTuple version
;
40 typedef std::vector
<SDKDirectoryInfo
> SDKDirectoryInfoCollection
;
42 bool UpdateSDKDirectoryInfosIfNeeded();
44 const SDKDirectoryInfo
*GetSDKDirectoryForLatestOSVersion();
45 const SDKDirectoryInfo
*GetSDKDirectoryForCurrentOSVersion();
47 static FileSystem::EnumerateDirectoryResult
48 GetContainedFilesIntoVectorOfStringsCallback(void *baton
,
49 llvm::sys::fs::file_type ft
,
50 llvm::StringRef path
);
52 const char *GetDeviceSupportDirectory();
53 const char *GetDeviceSupportDirectoryForOSVersion();
55 virtual llvm::StringRef
GetPlatformName() = 0;
56 virtual llvm::StringRef
GetDeviceSupportDirectoryName() = 0;
58 std::mutex m_sdk_dir_mutex
;
59 SDKDirectoryInfoCollection m_sdk_directory_infos
;
62 std::string m_device_support_directory
;
63 std::string m_device_support_directory_for_os_version
;
65 } // namespace lldb_private
67 #endif // LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMDARWINDEVICE_H