[Lldb-commits] [lldb] 0aaf480 - [lldb] Cleanup MacOSX platform headers (NFC)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Mon Mar 14 22:01:11 PDT 2022
Author: Jonas Devlieghere
Date: 2022-03-14T22:01:05-07:00
New Revision: 0aaf480be955718c0be99dc14a71b668bf15def0
URL: https://github.com/llvm/llvm-project/commit/0aaf480be955718c0be99dc14a71b668bf15def0
DIFF: https://github.com/llvm/llvm-project/commit/0aaf480be955718c0be99dc14a71b668bf15def0.diff
LOG: [lldb] Cleanup MacOSX platform headers (NFC)
While working on dde487e54782 I noticed that the MacOSX platforms were
in need of some love. This patch cleans up the headers:
- Move platforms into the lldb_private namespace.
- Remove lldb_private:: prefixes to improve readability.
- Fix header includes and use forward declarations (iwyu).
- Fix formatting
Added:
Modified:
lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h
lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h
lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h
lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h
lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h
lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h
lldb/source/Plugins/Platform/MacOSX/PlatformRemoteMacOSX.h
lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h
Removed:
################################################################################
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h
index 39ef789ffc1d7..4cadf9a703431 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h
@@ -9,14 +9,33 @@
#ifndef LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMAPPLESIMULATOR_H
#define LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMAPPLESIMULATOR_H
-#include <mutex>
-
#include "Plugins/Platform/MacOSX/PlatformDarwin.h"
#include "Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/FileSpec.h"
-
+#include "lldb/Utility/ProcessInfo.h"
+#include "lldb/Utility/Status.h"
+#include "lldb/Utility/XcodeSDK.h"
+#include "lldb/lldb-forward.h"
#include "llvm/ADT/Optional.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/Triple.h"
+
+#include <mutex>
+#include <vector>
+
+namespace lldb_private {
+class ArchSpec;
+class Args;
+class Debugger;
+class FileSpecList;
+class ModuleSpec;
+class Process;
+class ProcessLaunchInfo;
+class Stream;
+class Target;
+class UUID;
class PlatformAppleSimulator : public PlatformDarwin {
public:
@@ -27,22 +46,22 @@ class PlatformAppleSimulator : public PlatformDarwin {
// Class Methods
PlatformAppleSimulator(
- const char *class_name, const char *description,
- lldb_private::ConstString plugin_name, llvm::Triple::OSType preferred_os,
+ const char *class_name, const char *description, ConstString plugin_name,
+ llvm::Triple::OSType preferred_os,
llvm::SmallVector<llvm::StringRef, 4> supported_triples,
- llvm::StringRef sdk, lldb_private::XcodeSDK::Type sdk_type,
+ llvm::StringRef sdk, XcodeSDK::Type sdk_type,
CoreSimulatorSupport::DeviceType::ProductFamilyID kind);
static lldb::PlatformSP
CreateInstance(const char *class_name, const char *description,
- lldb_private::ConstString plugin_name,
+ ConstString plugin_name,
llvm::SmallVector<llvm::Triple::ArchType, 4> supported_arch,
llvm::Triple::OSType preferred_os,
llvm::SmallVector<llvm::Triple::OSType, 4> supported_os,
llvm::SmallVector<llvm::StringRef, 4> supported_triples,
- llvm::StringRef sdk, lldb_private::XcodeSDK::Type sdk_type,
+ llvm::StringRef sdk, XcodeSDK::Type sdk_type,
CoreSimulatorSupport::DeviceType::ProductFamilyID kind,
- bool force, const lldb_private::ArchSpec *arch);
+ bool force, const ArchSpec *arch);
virtual ~PlatformAppleSimulator();
@@ -51,40 +70,36 @@ class PlatformAppleSimulator : public PlatformDarwin {
}
llvm::StringRef GetDescription() override { return m_description; }
- lldb_private::Status
- LaunchProcess(lldb_private::ProcessLaunchInfo &launch_info) override;
+ Status LaunchProcess(ProcessLaunchInfo &launch_info) override;
- void GetStatus(lldb_private::Stream &strm) override;
+ void GetStatus(Stream &strm) override;
- lldb_private::Status ConnectRemote(lldb_private::Args &args) override;
+ Status ConnectRemote(Args &args) override;
- lldb_private::Status DisconnectRemote() override;
+ Status DisconnectRemote() override;
- lldb::ProcessSP DebugProcess(lldb_private::ProcessLaunchInfo &launch_info,
- lldb_private::Debugger &debugger,
- lldb_private::Target &target,
- lldb_private::Status &error) override;
+ lldb::ProcessSP DebugProcess(ProcessLaunchInfo &launch_info,
+ Debugger &debugger, Target &target,
+ Status &error) override;
- std::vector<lldb_private::ArchSpec> GetSupportedArchitectures(
- const lldb_private::ArchSpec &process_host_arch) override;
+ std::vector<ArchSpec>
+ GetSupportedArchitectures(const ArchSpec &process_host_arch) override;
- lldb_private::Status ResolveExecutable(
- const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp,
- const lldb_private::FileSpecList *module_search_paths_ptr) override;
+ Status
+ ResolveExecutable(const ModuleSpec &module_spec, lldb::ModuleSP &module_sp,
+ const FileSpecList *module_search_paths_ptr) override;
- 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;
+ Status GetSharedModule(const ModuleSpec &module_spec, Process *process,
+ lldb::ModuleSP &module_sp,
+ const FileSpecList *module_search_paths_ptr,
+ llvm::SmallVectorImpl<lldb::ModuleSP> *old_modules,
+ bool *did_create_ptr) override;
- uint32_t
- FindProcesses(const lldb_private::ProcessInstanceInfoMatch &match_info,
- lldb_private::ProcessInstanceInfoList &process_infos) override;
+ uint32_t FindProcesses(const ProcessInstanceInfoMatch &match_info,
+ ProcessInstanceInfoList &process_infos) override;
void
- AddClangModuleCompilationOptions(lldb_private::Target *target,
+ AddClangModuleCompilationOptions(Target *target,
std::vector<std::string> &options) override {
return PlatformDarwin::AddClangModuleCompilationOptionsForSDKType(
target, options, m_sdk_type);
@@ -93,18 +108,18 @@ class PlatformAppleSimulator : public PlatformDarwin {
protected:
const char *m_class_name;
const char *m_description;
- lldb_private::ConstString m_plugin_name;
+ ConstString m_plugin_name;
std::mutex m_core_sim_path_mutex;
- llvm::Optional<lldb_private::FileSpec> m_core_simulator_framework_path;
+ llvm::Optional<FileSpec> m_core_simulator_framework_path;
llvm::Optional<CoreSimulatorSupport::Device> m_device;
CoreSimulatorSupport::DeviceType::ProductFamilyID m_kind;
- lldb_private::FileSpec GetCoreSimulatorPath();
+ FileSpec GetCoreSimulatorPath();
llvm::Triple::OSType m_os_type = llvm::Triple::UnknownOS;
llvm::SmallVector<llvm::StringRef, 4> m_supported_triples = {};
llvm::StringRef m_sdk;
- lldb_private::XcodeSDK::Type m_sdk_type;
+ XcodeSDK::Type m_sdk_type;
void LoadCoreSimulator();
@@ -116,11 +131,12 @@ class PlatformAppleSimulator : public PlatformDarwin {
PlatformAppleSimulator(const PlatformAppleSimulator &) = delete;
const PlatformAppleSimulator &
operator=(const PlatformAppleSimulator &) = delete;
- lldb_private::Status
+ Status
- GetSymbolFile(const lldb_private::FileSpec &platform_file,
- const lldb_private::UUID *uuid_ptr,
- lldb_private::FileSpec &local_file);
+ GetSymbolFile(const FileSpec &platform_file, const UUID *uuid_ptr,
+ FileSpec &local_file);
};
+} // namespace lldb_private
+
#endif // LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMAPPLESIMULATOR_H
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
index be336fde542f2..edc8faaa399c8 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
@@ -10,17 +10,37 @@
#define LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMDARWIN_H
#include "Plugins/Platform/POSIX/PlatformPOSIX.h"
+#include "lldb/Core/FileSpecList.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/ProcessLaunchInfo.h"
+#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/FileSpec.h"
+#include "lldb/Utility/Status.h"
#include "lldb/Utility/StructuredData.h"
#include "lldb/Utility/XcodeSDK.h"
+#include "lldb/lldb-forward.h"
+#include "llvm/ADT/Optional.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/FileSystem.h"
+#include "llvm/ADT/Triple.h"
+#include "llvm/Support/Error.h"
+#include "llvm/Support/VersionTuple.h"
+#include <mutex>
#include <string>
-#include <tuple>
+#include <vector>
+
+namespace lldb_private {
+class BreakpointSite;
+class Debugger;
+class Module;
+class ModuleSpec;
+class Process;
+class ProcessLaunchInfo;
+class Stream;
+class Target;
class PlatformDarwin : public PlatformPOSIX {
public:
@@ -28,83 +48,70 @@ class PlatformDarwin : public PlatformPOSIX {
~PlatformDarwin() override;
- lldb_private::Status PutFile(const lldb_private::FileSpec &source,
- const lldb_private::FileSpec &destination,
- uint32_t uid = UINT32_MAX,
- uint32_t gid = UINT32_MAX) override;
+ Status PutFile(const FileSpec &source, const FileSpec &destination,
+ uint32_t uid = UINT32_MAX, uint32_t gid = UINT32_MAX) override;
- // lldb_private::Platform functions
- lldb_private::Status
- ResolveSymbolFile(lldb_private::Target &target,
- const lldb_private::ModuleSpec &sym_spec,
- lldb_private::FileSpec &sym_file) override;
+ // Platform functions
+ Status ResolveSymbolFile(Target &target, const ModuleSpec &sym_spec,
+ FileSpec &sym_file) override;
- lldb_private::FileSpecList LocateExecutableScriptingResources(
- lldb_private::Target *target, lldb_private::Module &module,
- lldb_private::Stream *feedback_stream) override;
+ FileSpecList
+ LocateExecutableScriptingResources(Target *target, Module &module,
+ Stream *feedback_stream) override;
- 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;
+ Status GetSharedModule(const ModuleSpec &module_spec, Process *process,
+ lldb::ModuleSP &module_sp,
+ const FileSpecList *module_search_paths_ptr,
+ llvm::SmallVectorImpl<lldb::ModuleSP> *old_modules,
+ bool *did_create_ptr) override;
- size_t GetSoftwareBreakpointTrapOpcode(
- lldb_private::Target &target,
- lldb_private::BreakpointSite *bp_site) override;
+ size_t GetSoftwareBreakpointTrapOpcode(Target &target,
+ BreakpointSite *bp_site) override;
- lldb::BreakpointSP
- SetThreadCreationBreakpoint(lldb_private::Target &target) override;
+ lldb::BreakpointSP SetThreadCreationBreakpoint(Target &target) override;
bool ModuleIsExcludedForUnconstrainedSearches(
- lldb_private::Target &target, const lldb::ModuleSP &module_sp) override;
+ Target &target, const lldb::ModuleSP &module_sp) override;
void
- ARMGetSupportedArchitectures(std::vector<lldb_private::ArchSpec> &archs,
+ ARMGetSupportedArchitectures(std::vector<ArchSpec> &archs,
llvm::Optional<llvm::Triple::OSType> os = {});
- void x86GetSupportedArchitectures(std::vector<lldb_private::ArchSpec> &archs);
+ void x86GetSupportedArchitectures(std::vector<ArchSpec> &archs);
- uint32_t GetResumeCountForLaunchInfo(
- lldb_private::ProcessLaunchInfo &launch_info) override;
+ uint32_t GetResumeCountForLaunchInfo(ProcessLaunchInfo &launch_info) override;
- lldb::ProcessSP DebugProcess(lldb_private::ProcessLaunchInfo &launch_info,
- lldb_private::Debugger &debugger,
- lldb_private::Target &target,
- lldb_private::Status &error) override;
+ lldb::ProcessSP DebugProcess(ProcessLaunchInfo &launch_info,
+ Debugger &debugger, Target &target,
+ Status &error) override;
void CalculateTrapHandlerSymbolNames() override;
- llvm::VersionTuple
- GetOSVersion(lldb_private::Process *process = nullptr) override;
+ llvm::VersionTuple GetOSVersion(Process *process = nullptr) override;
bool SupportsModules() override { return true; }
- lldb_private::ConstString
- GetFullNameForDylib(lldb_private::ConstString basename) override;
+ ConstString GetFullNameForDylib(ConstString basename) override;
- lldb_private::FileSpec LocateExecutable(const char *basename) override;
+ FileSpec LocateExecutable(const char *basename) override;
- lldb_private::Status
- LaunchProcess(lldb_private::ProcessLaunchInfo &launch_info) override;
+ Status LaunchProcess(ProcessLaunchInfo &launch_info) override;
static std::tuple<llvm::VersionTuple, llvm::StringRef>
ParseVersionBuildDir(llvm::StringRef str);
- llvm::Expected<lldb_private::StructuredData::DictionarySP>
- FetchExtendedCrashInformation(lldb_private::Process &process) override;
+ llvm::Expected<StructuredData::DictionarySP>
+ FetchExtendedCrashInformation(Process &process) override;
/// Return the toolchain directory the current LLDB instance is located in.
- static lldb_private::FileSpec GetCurrentToolchainDirectory();
+ static FileSpec GetCurrentToolchainDirectory();
/// Return the command line tools directory the current LLDB instance is
/// located in.
- static lldb_private::FileSpec GetCurrentCommandLineToolsDirectory();
+ static FileSpec GetCurrentCommandLineToolsDirectory();
protected:
- static const char *GetCompatibleArch(lldb_private::ArchSpec::Core core,
- size_t idx);
+ static const char *GetCompatibleArch(ArchSpec::Core core, size_t idx);
struct CrashInfoAnnotations {
uint64_t version; // unsigned long
@@ -131,44 +138,41 @@ class PlatformDarwin : public PlatformPOSIX {
/// A structured data array containing at each entry in each entry, the
/// module spec, its UUID, the crash messages and the abort cause.
/// \b nullptr if process has no crash information annotations.
- lldb_private::StructuredData::ArraySP
- ExtractCrashInfoAnnotations(lldb_private::Process &process);
+ StructuredData::ArraySP ExtractCrashInfoAnnotations(Process &process);
- void ReadLibdispatchOffsetsAddress(lldb_private::Process *process);
+ void ReadLibdispatchOffsetsAddress(Process *process);
- void ReadLibdispatchOffsets(lldb_private::Process *process);
+ void ReadLibdispatchOffsets(Process *process);
- virtual lldb_private::Status GetSharedModuleWithLocalCache(
- const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp,
- const lldb_private::FileSpecList *module_search_paths_ptr,
+ virtual Status GetSharedModuleWithLocalCache(
+ const ModuleSpec &module_spec, lldb::ModuleSP &module_sp,
+ const FileSpecList *module_search_paths_ptr,
llvm::SmallVectorImpl<lldb::ModuleSP> *old_modules, bool *did_create_ptr);
virtual bool CheckLocalSharedCache() const { return IsHost(); }
struct SDKEnumeratorInfo {
- lldb_private::FileSpec found_path;
- lldb_private::XcodeSDK::Type sdk_type;
+ FileSpec found_path;
+ XcodeSDK::Type sdk_type;
};
- static lldb_private::FileSystem::EnumerateDirectoryResult
+ static FileSystem::EnumerateDirectoryResult
DirectoryEnumerator(void *baton, llvm::sys::fs::file_type file_type,
llvm::StringRef path);
- static lldb_private::FileSpec
- FindSDKInXcodeForModules(lldb_private::XcodeSDK::Type sdk_type,
- const lldb_private::FileSpec &sdks_spec);
+ static FileSpec FindSDKInXcodeForModules(XcodeSDK::Type sdk_type,
+ const FileSpec &sdks_spec);
- static lldb_private::FileSpec
- GetSDKDirectoryForModules(lldb_private::XcodeSDK::Type sdk_type);
+ static FileSpec GetSDKDirectoryForModules(XcodeSDK::Type sdk_type);
- void AddClangModuleCompilationOptionsForSDKType(
- lldb_private::Target *target, std::vector<std::string> &options,
- lldb_private::XcodeSDK::Type sdk_type);
+ void
+ AddClangModuleCompilationOptionsForSDKType(Target *target,
+ std::vector<std::string> &options,
+ XcodeSDK::Type sdk_type);
- lldb_private::Status FindBundleBinaryInExecSearchPaths(
- const lldb_private::ModuleSpec &module_spec,
- lldb_private::Process *process, lldb::ModuleSP &module_sp,
- const lldb_private::FileSpecList *module_search_paths_ptr,
+ Status FindBundleBinaryInExecSearchPaths(
+ const ModuleSpec &module_spec, Process *process,
+ lldb::ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr,
llvm::SmallVectorImpl<lldb::ModuleSP> *old_modules, bool *did_create_ptr);
static std::string FindComponentInPath(llvm::StringRef path,
@@ -186,4 +190,6 @@ class PlatformDarwin : public PlatformPOSIX {
const PlatformDarwin &operator=(const PlatformDarwin &) = delete;
};
+} // namespace lldb_private
+
#endif // LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMDARWIN_H
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
index 1a9c7e574dbbc..6c30b8b1d0adc 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
@@ -9,24 +9,36 @@
#ifndef LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMDARWINKERNEL_H
#define LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMDARWINKERNEL_H
+#include "PlatformDarwin.h"
+#include "lldb/Host/FileSystem.h"
#include "lldb/Utility/ConstString.h"
-
-#if defined(__APPLE__) // This Plugin uses the Mac-specific
- // source/Host/macosx/cfcpp utilities
-
#include "lldb/Utility/FileSpec.h"
-
+#include "lldb/Utility/Status.h"
+#include "lldb/Utility/UUID.h"
+#include "lldb/lldb-forward.h"
+#include "lldb/lldb-private-enumerations.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/FileSystem.h"
-#include "PlatformDarwin.h"
+#include <vector>
+
+namespace lldb_private {
+class ArchSpec;
+class Debugger;
+class FileSpecList;
+class ModuleSpec;
+class Process;
+class Stream;
+
+#if defined(__APPLE__) // This Plugin uses the Mac-specific
+ // source/Host/macosx/cfcpp utilities
class PlatformDarwinKernel : public PlatformDarwin {
public:
- // Class Functions
- static lldb::PlatformSP CreateInstance(bool force,
- const lldb_private::ArchSpec *arch);
+ static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
- static void DebuggerInitialize(lldb_private::Debugger &debugger);
+ static void DebuggerInitialize(Debugger &debugger);
static void Initialize();
@@ -36,50 +48,45 @@ class PlatformDarwinKernel : public PlatformDarwin {
static llvm::StringRef GetDescriptionStatic();
- // Class Methods
- PlatformDarwinKernel(lldb_private::LazyBool is_ios_debug_session);
+ PlatformDarwinKernel(LazyBool is_ios_debug_session);
virtual ~PlatformDarwinKernel();
- // lldb_private::PluginInterface functions
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
- // lldb_private::Platform functions
llvm::StringRef GetDescription() override { return GetDescriptionStatic(); }
- void GetStatus(lldb_private::Stream &strm) override;
+ void GetStatus(Stream &strm) override;
- 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;
+ Status GetSharedModule(const ModuleSpec &module_spec, Process *process,
+ lldb::ModuleSP &module_sp,
+ const FileSpecList *module_search_paths_ptr,
+ llvm::SmallVectorImpl<lldb::ModuleSP> *old_modules,
+ bool *did_create_ptr) override;
- std::vector<lldb_private::ArchSpec> GetSupportedArchitectures(
- const lldb_private::ArchSpec &process_host_arch) override;
+ std::vector<ArchSpec>
+ GetSupportedArchitectures(const ArchSpec &process_host_arch) override;
bool SupportsModules() override { return false; }
void CalculateTrapHandlerSymbolNames() override;
protected:
- // Map from kext bundle ID ("com.apple.filesystems.exfat") to FileSpec for the
- // kext bundle on
- // the host ("/System/Library/Extensions/exfat.kext/Contents/Info.plist").
- typedef std::multimap<lldb_private::ConstString, lldb_private::FileSpec>
- BundleIDToKextMap;
+ // Map from kext bundle ID ("com.apple.filesystems.exfat") to FileSpec for
+ // the kext bundle on the host
+ // ("/System/Library/Extensions/exfat.kext/Contents/Info.plist").
+ typedef std::multimap<ConstString, FileSpec> BundleIDToKextMap;
typedef BundleIDToKextMap::iterator BundleIDToKextIterator;
- typedef std::vector<lldb_private::FileSpec> KernelBinaryCollection;
+ typedef std::vector<FileSpec> KernelBinaryCollection;
// Array of directories that were searched for kext bundles (used only for
- // reporting to user)
- typedef std::vector<lldb_private::FileSpec> DirectoriesSearchedCollection;
+ // reporting to user).
+ typedef std::vector<FileSpec> DirectoriesSearchedCollection;
typedef DirectoriesSearchedCollection::iterator DirectoriesSearchedIterator;
- // Populate m_search_directories and m_search_directories_no_recursing vectors
- // of directories
+ // Populate m_search_directories and m_search_directories_no_recursing
+ // vectors of directories.
void CollectKextAndKernelDirectories();
void GetUserSpecifiedDirectoriesToSearch();
@@ -89,115 +96,99 @@ class PlatformDarwinKernel : public PlatformDarwin {
void AddSDKSubdirsToSearchPaths(const std::string &dir);
- static lldb_private::FileSystem::EnumerateDirectoryResult
+ static FileSystem::EnumerateDirectoryResult
FindKDKandSDKDirectoriesInDirectory(void *baton, llvm::sys::fs::file_type ft,
llvm::StringRef path);
void SearchForKextsAndKernelsRecursively();
- static lldb_private::FileSystem::EnumerateDirectoryResult
+ static FileSystem::EnumerateDirectoryResult
GetKernelsAndKextsInDirectoryWithRecursion(void *baton,
llvm::sys::fs::file_type ft,
llvm::StringRef path);
- static lldb_private::FileSystem::EnumerateDirectoryResult
+ static FileSystem::EnumerateDirectoryResult
GetKernelsAndKextsInDirectoryNoRecursion(void *baton,
llvm::sys::fs::file_type ft,
llvm::StringRef path);
- static lldb_private::FileSystem::EnumerateDirectoryResult
+ static FileSystem::EnumerateDirectoryResult
GetKernelsAndKextsInDirectoryHelper(void *baton, llvm::sys::fs::file_type ft,
llvm::StringRef path, bool recurse);
- static std::vector<lldb_private::FileSpec>
+ static std::vector<FileSpec>
SearchForExecutablesRecursively(const std::string &dir);
static void AddKextToMap(PlatformDarwinKernel *thisp,
- const lldb_private::FileSpec &file_spec);
+ const FileSpec &file_spec);
// Returns true if there is a .dSYM bundle next to the kext, or next to the
// binary inside the kext.
- static bool
- KextHasdSYMSibling(const lldb_private::FileSpec &kext_bundle_filepath);
+ static bool KextHasdSYMSibling(const FileSpec &kext_bundle_filepath);
// Returns true if there is a .dSYM bundle next to the kernel
- static bool
- KernelHasdSYMSibling(const lldb_private::FileSpec &kernel_filepath);
+ static bool KernelHasdSYMSibling(const FileSpec &kernel_filepath);
// Returns true if there is a .dSYM bundle with NO kernel binary next to it
- static bool KerneldSYMHasNoSiblingBinary(
- const lldb_private::FileSpec &kernel_dsym_filepath);
+ static bool
+ KerneldSYMHasNoSiblingBinary(const FileSpec &kernel_dsym_filepath);
// Given a dsym_bundle argument ('.../foo.dSYM'), return a FileSpec
// with the binary inside it ('.../foo.dSYM/Contents/Resources/DWARF/foo').
// A dSYM bundle may have multiple DWARF binaries in them, so a vector
// of matches is returned.
- static std::vector<lldb_private::FileSpec>
- GetDWARFBinaryInDSYMBundle(lldb_private::FileSpec dsym_bundle);
-
- lldb_private::Status
- GetSharedModuleKext(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);
-
- lldb_private::Status GetSharedModuleKernel(
- const lldb_private::ModuleSpec &module_spec,
- lldb_private::Process *process, lldb::ModuleSP &module_sp,
- const lldb_private::FileSpecList *module_search_paths_ptr,
+ static std::vector<FileSpec> GetDWARFBinaryInDSYMBundle(FileSpec dsym_bundle);
+
+ Status GetSharedModuleKext(const ModuleSpec &module_spec, Process *process,
+ lldb::ModuleSP &module_sp,
+ const FileSpecList *module_search_paths_ptr,
+ llvm::SmallVectorImpl<lldb::ModuleSP> *old_modules,
+ bool *did_create_ptr);
+
+ Status GetSharedModuleKernel(
+ const ModuleSpec &module_spec, Process *process,
+ lldb::ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr,
llvm::SmallVectorImpl<lldb::ModuleSP> *old_modules, bool *did_create_ptr);
- lldb_private::Status
- ExamineKextForMatchingUUID(const lldb_private::FileSpec &kext_bundle_path,
- const lldb_private::UUID &uuid,
- const lldb_private::ArchSpec &arch,
- lldb::ModuleSP &exe_module_sp);
+ Status ExamineKextForMatchingUUID(const FileSpec &kext_bundle_path,
+ const UUID &uuid, const ArchSpec &arch,
+ lldb::ModuleSP &exe_module_sp);
// Most of the ivars are assembled under FileSystem::EnumerateDirectory calls
- // where the
- // function being called for each file/directory must be static. We'll pass a
- // this pointer
- // as a baton and access the ivars directly. Toss-up whether this should just
- // be a struct
- // at this point.
+ // where the function being called for each file/directory must be static.
+ // We'll pass a this pointer as a baton and access the ivars directly.
+ // Toss-up whether this should just be a struct at this point.
public:
- BundleIDToKextMap m_name_to_kext_path_map_with_dsyms; // multimap of
- // CFBundleID to
- // FileSpec on local
- // filesystem, kexts
- // with dSYMs next to
- // them
- BundleIDToKextMap m_name_to_kext_path_map_without_dsyms; // multimap of
- // CFBundleID to
- // FileSpec on local
- // filesystem, kexts
- // without dSYMs next
- // to them
- DirectoriesSearchedCollection
- m_search_directories; // list of directories we search for kexts/kernels
- DirectoriesSearchedCollection
- m_search_directories_no_recursing; // list of directories we search for
- // kexts/kernels, no recursion
- KernelBinaryCollection m_kernel_binaries_with_dsyms; // list of kernel
- // binaries we found on
- // local filesystem,
- // without dSYMs next to
- // them
- KernelBinaryCollection m_kernel_binaries_without_dsyms; // list of kernel
- // binaries we found
- // on local
- // filesystem, with
- // dSYMs next to them
- KernelBinaryCollection m_kernel_dsyms_no_binaries; // list of kernel
- // dsyms with no
- // binaries next to
- // them
- KernelBinaryCollection m_kernel_dsyms_yaas; // list of kernel
- // .dSYM.yaa files
-
- lldb_private::LazyBool m_ios_debug_session;
+ /// Multimap of CFBundleID to FileSpec on local filesystem, kexts with dSYMs
+ /// next to them.
+ BundleIDToKextMap m_name_to_kext_path_map_with_dsyms;
+
+ /// Multimap of CFBundleID to FileSpec on local filesystem, kexts without
+ /// dSYMs next to them.
+ BundleIDToKextMap m_name_to_kext_path_map_without_dsyms;
+
+ /// List of directories we search for kexts/kernels.
+ DirectoriesSearchedCollection m_search_directories;
+
+ /// List of directories we search for kexts/kernels, no recursion.
+ DirectoriesSearchedCollection m_search_directories_no_recursing;
+
+ /// List of kernel binaries we found on local filesystem, without dSYMs next
+ /// to them.
+ KernelBinaryCollection m_kernel_binaries_with_dsyms;
+
+ /// List of kernel binaries we found on local filesystem, with dSYMs next to
+ /// them.
+ KernelBinaryCollection m_kernel_binaries_without_dsyms;
+
+ /// List of kernel dsyms with no binaries next to them.
+ KernelBinaryCollection m_kernel_dsyms_no_binaries;
+
+ /// List of kernel .dSYM.yaa files.
+ KernelBinaryCollection m_kernel_dsyms_yaas;
+
+ LazyBool m_ios_debug_session;
PlatformDarwinKernel(const PlatformDarwinKernel &) = delete;
const PlatformDarwinKernel &operator=(const PlatformDarwinKernel &) = delete;
@@ -205,17 +196,14 @@ class PlatformDarwinKernel : public PlatformDarwin {
#else // __APPLE__
-// Since DynamicLoaderDarwinKernel is compiled in for all systems, and relies on
-// PlatformDarwinKernel for the plug-in name, we compile just the plug-in name
-// in
-// here to avoid issues. We are tracking an internal bug to resolve this issue
-// by
-// either not compiling in DynamicLoaderDarwinKernel for non-apple builds, or to
-// make
-// PlatformDarwinKernel build on all systems. PlatformDarwinKernel is currently
-// not
-// compiled on other platforms due to the use of the Mac-specific
-// source/Host/macosx/cfcpp utilities.
+// Since DynamicLoaderDarwinKernel is compiled in for all systems, and relies
+// on PlatformDarwinKernel for the plug-in name, we compile just the plug-in
+// name in here to avoid issues. We are tracking an internal bug to resolve
+// this issue by either not compiling in DynamicLoaderDarwinKernel for
+// non-apple builds, or to make PlatformDarwinKernel build on all systems.
+//
+// PlatformDarwinKernel is currently not compiled on other platforms due to the
+// use of the Mac-specific source/Host/macosx/cfcpp utilities.
class PlatformDarwinKernel {
public:
@@ -224,4 +212,6 @@ class PlatformDarwinKernel {
#endif // __APPLE__
+} // namespace lldb_private
+
#endif // LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMDARWINKERNEL_H
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h
index 36b57f755dc97..2843a8a2ccd73 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h
@@ -10,14 +10,29 @@
#define LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMMACOSX_H
#include "PlatformDarwin.h"
+#include "lldb/Target/Platform.h"
+#include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/Status.h"
+#include "lldb/Utility/XcodeSDK.h"
+#include "lldb/lldb-forward.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
+
+#include <vector>
+
+namespace lldb_private {
+class ArchSpec;
+class FileSpec;
+class FileSpecList;
+class ModuleSpec;
+class Process;
+class Target;
class PlatformMacOSX : public PlatformDarwin {
public:
PlatformMacOSX();
- // Class functions
- static lldb::PlatformSP CreateInstance(bool force,
- const lldb_private::ArchSpec *arch);
+ static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
static void Initialize();
@@ -29,36 +44,33 @@ class PlatformMacOSX : public PlatformDarwin {
static llvm::StringRef GetDescriptionStatic();
- // lldb_private::PluginInterface functions
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
- 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;
+ Status GetSharedModule(const ModuleSpec &module_spec, Process *process,
+ lldb::ModuleSP &module_sp,
+ const FileSpecList *module_search_paths_ptr,
+ llvm::SmallVectorImpl<lldb::ModuleSP> *old_modules,
+ bool *did_create_ptr) override;
llvm::StringRef GetDescription() override { return GetDescriptionStatic(); }
- lldb_private::Status
- GetFile(const lldb_private::FileSpec &source,
- const lldb_private::FileSpec &destination) override {
+ Status GetFile(const FileSpec &source, const FileSpec &destination) override {
return PlatformDarwin::GetFile(source, destination);
}
- std::vector<lldb_private::ArchSpec> GetSupportedArchitectures(
- const lldb_private::ArchSpec &process_host_arch) override;
+ std::vector<ArchSpec>
+ GetSupportedArchitectures(const ArchSpec &process_host_arch) override;
- lldb_private::ConstString
- GetSDKDirectory(lldb_private::Target &target) override;
+ ConstString GetSDKDirectory(Target &target) override;
void
- AddClangModuleCompilationOptions(lldb_private::Target *target,
+ AddClangModuleCompilationOptions(Target *target,
std::vector<std::string> &options) override {
return PlatformDarwin::AddClangModuleCompilationOptionsForSDKType(
- target, options, lldb_private::XcodeSDK::Type::MacOSX);
+ target, options, XcodeSDK::Type::MacOSX);
}
};
+} // namespace lldb_private
+
#endif // LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMMACOSX_H
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h
index b3a2b9b62ad4e..91dd02cc94323 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h
@@ -1,4 +1,5 @@
-//===-- PlatformRemoteAppleBridge.h ---------------------------------*- C++ -*-===//
+//===-- PlatformRemoteAppleBridge.h ---------------------------------*- C++
+//-*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -9,21 +10,21 @@
#ifndef LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEAPPLEBRIDGE_H
#define LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEAPPLEBRIDGE_H
-#include <string>
-
+#include "PlatformRemoteDarwinDevice.h"
#include "lldb/Utility/FileSpec.h"
+#include "lldb/lldb-forward.h"
+#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/FileSystem.h"
+#include <vector>
-#include "PlatformRemoteDarwinDevice.h"
+namespace lldb_private {
+class ArchSpec;
class PlatformRemoteAppleBridge : public PlatformRemoteDarwinDevice {
public:
PlatformRemoteAppleBridge();
- // Class Functions
- static lldb::PlatformSP CreateInstance(bool force,
- const lldb_private::ArchSpec *arch);
+ static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
static void Initialize();
@@ -33,19 +34,18 @@ class PlatformRemoteAppleBridge : public PlatformRemoteDarwinDevice {
static llvm::StringRef GetDescriptionStatic();
- // lldb_private::PluginInterface functions
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
- // lldb_private::Platform functions
-
llvm::StringRef GetDescription() override { return GetDescriptionStatic(); }
- std::vector<lldb_private::ArchSpec> GetSupportedArchitectures(
- const lldb_private::ArchSpec &process_host_arch) override;
+ std::vector<ArchSpec>
+ GetSupportedArchitectures(const ArchSpec &process_host_arch) override;
protected:
llvm::StringRef GetDeviceSupportDirectoryName() override;
llvm::StringRef GetPlatformName() override;
};
+} // namespace lldb_private
+
#endif // LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEAPPLEBRIDGE_H
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h
index b102bb79cc91e..2962f19bd2ee2 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h
@@ -9,13 +9,17 @@
#ifndef LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEAPPLETV_H
#define LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEAPPLETV_H
-#include <string>
-
+#include "PlatformRemoteDarwinDevice.h"
#include "lldb/Utility/FileSpec.h"
-
+#include "lldb/lldb-forward.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/FileSystem.h"
-#include "PlatformRemoteDarwinDevice.h"
+#include <string>
+#include <vector>
+
+namespace lldb_private {
+class ArchSpec;
class PlatformRemoteAppleTV : public PlatformRemoteDarwinDevice {
public:
@@ -48,4 +52,6 @@ class PlatformRemoteAppleTV : public PlatformRemoteDarwinDevice {
llvm::StringRef GetPlatformName() override;
};
+} // namespace lldb_private
+
#endif // LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEAPPLETV_H
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h
index 75b7dc458ba7b..20694f00d9f5e 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h
@@ -9,22 +9,20 @@
#ifndef LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEAPPLEWATCH_H
#define LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEAPPLEWATCH_H
-#include <string>
-#include <vector>
-
-#include "lldb/Utility/FileSpec.h"
-
#include "PlatformRemoteDarwinDevice.h"
+#include "lldb/lldb-forward.h"
+#include "llvm/ADT/StringRef.h"
+
+#include <vector>
-#include "llvm/Support/FileSystem.h"
+namespace lldb_private {
+class ArchSpec;
class PlatformRemoteAppleWatch : public PlatformRemoteDarwinDevice {
public:
PlatformRemoteAppleWatch();
- // Class Functions
- static lldb::PlatformSP CreateInstance(bool force,
- const lldb_private::ArchSpec *arch);
+ static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
static void Initialize();
@@ -34,21 +32,18 @@ class PlatformRemoteAppleWatch : public PlatformRemoteDarwinDevice {
static llvm::StringRef GetDescriptionStatic();
- // lldb_private::Platform functions
-
llvm::StringRef GetDescription() override { return GetDescriptionStatic(); }
- // lldb_private::PluginInterface functions
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
- // lldb_private::Platform functions
-
- std::vector<lldb_private::ArchSpec> GetSupportedArchitectures(
- const lldb_private::ArchSpec &process_host_arch) override;
+ std::vector<ArchSpec>
+ GetSupportedArchitectures(const ArchSpec &process_host_arch) override;
protected:
llvm::StringRef GetDeviceSupportDirectoryName() override;
llvm::StringRef GetPlatformName() override;
};
+} // namespace lldb_private
+
#endif // LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEAPPLEWATCH_H
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h
index 3b578a3fe917e..02cb09df7f77f 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h
@@ -1,4 +1,5 @@
-//===-- PlatformRemoteDarwinDevice.h -------------------------------------*- C++ -*-===//
+//===-- PlatformRemoteDarwinDevice.h -------------------------------------*- C++
+//-*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -9,12 +10,29 @@
#ifndef LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEDARWINDEVICE_H
#define LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEDARWINDEVICE_H
-#include <string>
-
#include "PlatformDarwin.h"
+#include "lldb/Host/FileSystem.h"
+#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/FileSpec.h"
-
+#include "lldb/Utility/Status.h"
+#include "lldb/Utility/XcodeSDK.h"
+#include "lldb/lldb-forward.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/VersionTuple.h"
+
+#include <mutex>
+#include <string>
+#include <vector>
+
+namespace lldb_private {
+class FileSpecList;
+class ModuleSpec;
+class Process;
+class Stream;
+class Target;
+class UUID;
class PlatformRemoteDarwinDevice : public PlatformDarwin {
public:
@@ -22,37 +40,34 @@ class PlatformRemoteDarwinDevice : public PlatformDarwin {
~PlatformRemoteDarwinDevice() override;
- // lldb_private::Platform functions
- lldb_private::Status ResolveExecutable(
- const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp,
- const lldb_private::FileSpecList *module_search_paths_ptr) override;
+ // Platform functions
+ Status
+ ResolveExecutable(const ModuleSpec &module_spec, lldb::ModuleSP &module_sp,
+ const FileSpecList *module_search_paths_ptr) override;
- void GetStatus(lldb_private::Stream &strm) override;
+ void GetStatus(Stream &strm) override;
- virtual lldb_private::Status
- GetSymbolFile(const lldb_private::FileSpec &platform_file,
- const lldb_private::UUID *uuid_ptr,
- lldb_private::FileSpec &local_file);
+ virtual Status GetSymbolFile(const FileSpec &platform_file,
+ const UUID *uuid_ptr, FileSpec &local_file);
- 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;
+ Status GetSharedModule(const ModuleSpec &module_spec, Process *process,
+ lldb::ModuleSP &module_sp,
+ const FileSpecList *module_search_paths_ptr,
+ llvm::SmallVectorImpl<lldb::ModuleSP> *old_modules,
+ bool *did_create_ptr) override;
void
- AddClangModuleCompilationOptions(lldb_private::Target *target,
+ AddClangModuleCompilationOptions(Target *target,
std::vector<std::string> &options) override {
return PlatformDarwin::AddClangModuleCompilationOptionsForSDKType(
- target, options, lldb_private::XcodeSDK::Type::iPhoneOS);
+ target, options, XcodeSDK::Type::iPhoneOS);
}
protected:
struct SDKDirectoryInfo {
- SDKDirectoryInfo(const lldb_private::FileSpec &sdk_dir_spec);
- lldb_private::FileSpec directory;
- lldb_private::ConstString build;
+ SDKDirectoryInfo(const FileSpec &sdk_dir_spec);
+ FileSpec directory;
+ ConstString build;
llvm::VersionTuple version;
bool user_cached;
};
@@ -77,19 +92,19 @@ class PlatformRemoteDarwinDevice : public PlatformDarwin {
const SDKDirectoryInfo *GetSDKDirectoryForCurrentOSVersion();
- static lldb_private::FileSystem::EnumerateDirectoryResult
+ static FileSystem::EnumerateDirectoryResult
GetContainedFilesIntoVectorOfStringsCallback(void *baton,
llvm::sys::fs::file_type ft,
llvm::StringRef path);
uint32_t FindFileInAllSDKs(const char *platform_file_path,
- lldb_private::FileSpecList &file_list);
+ FileSpecList &file_list);
bool GetFileInSDK(const char *platform_file_path, uint32_t sdk_idx,
- lldb_private::FileSpec &local_file);
+ FileSpec &local_file);
- uint32_t FindFileInAllSDKs(const lldb_private::FileSpec &platform_file,
- lldb_private::FileSpecList &file_list);
+ uint32_t FindFileInAllSDKs(const FileSpec &platform_file,
+ FileSpecList &file_list);
uint32_t GetConnectedSDKIndex();
@@ -106,4 +121,6 @@ class PlatformRemoteDarwinDevice : public PlatformDarwin {
operator=(const PlatformRemoteDarwinDevice &) = delete;
};
+} // namespace lldb_private
+
#endif // LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEDARWINDEVICE_H
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteMacOSX.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteMacOSX.h
index 67162b34c271b..d84b5c03c5873 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteMacOSX.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteMacOSX.h
@@ -9,21 +9,25 @@
#ifndef LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEMACOSX_H
#define LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEMACOSX_H
-#include <string>
-
+#include "PlatformRemoteDarwinDevice.h"
#include "lldb/Utility/FileSpec.h"
+#include "lldb/Utility/Status.h"
+#include "lldb/lldb-forward.h"
+#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/FileSystem.h"
+#include <string>
+#include <vector>
-#include "PlatformMacOSX.h"
-#include "PlatformRemoteDarwinDevice.h"
+namespace lldb_private {
+class ArchSpec;
+class FileSpec;
+class UUID;
class PlatformRemoteMacOSX : public virtual PlatformRemoteDarwinDevice {
public:
PlatformRemoteMacOSX();
- static lldb::PlatformSP CreateInstance(bool force,
- const lldb_private::ArchSpec *arch);
+ static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
static void Initialize();
@@ -37,17 +41,17 @@ class PlatformRemoteMacOSX : public virtual PlatformRemoteDarwinDevice {
llvm::StringRef GetDescription() override { return GetDescriptionStatic(); }
- lldb_private::Status
- GetFileWithUUID(const lldb_private::FileSpec &platform_file,
- const lldb_private::UUID *uuid_ptr,
- lldb_private::FileSpec &local_file) override;
+ Status GetFileWithUUID(const FileSpec &platform_file, const UUID *uuid_ptr,
+ FileSpec &local_file) override;
- std::vector<lldb_private::ArchSpec> GetSupportedArchitectures(
- const lldb_private::ArchSpec &process_host_arch) override;
+ std::vector<ArchSpec>
+ GetSupportedArchitectures(const ArchSpec &process_host_arch) override;
protected:
llvm::StringRef GetDeviceSupportDirectoryName() override;
llvm::StringRef GetPlatformName() override;
};
+} // namespace lldb_private
+
#endif // LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEMACOSX_H
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h
index 99409d80b3a0f..991bf1d4dd1a3 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h
@@ -9,20 +9,20 @@
#ifndef LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEIOS_H
#define LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEIOS_H
-#include <string>
-
#include "PlatformRemoteDarwinDevice.h"
-#include "lldb/Utility/FileSpec.h"
+#include "lldb/lldb-forward.h"
+#include "llvm/ADT/StringRef.h"
+
+#include <vector>
-#include "llvm/Support/FileSystem.h"
+namespace lldb_private {
+class ArchSpec;
class PlatformRemoteiOS : public PlatformRemoteDarwinDevice {
public:
PlatformRemoteiOS();
- // Class Functions
- static lldb::PlatformSP CreateInstance(bool force,
- const lldb_private::ArchSpec *arch);
+ static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
static void Initialize();
@@ -32,15 +32,12 @@ class PlatformRemoteiOS : public PlatformRemoteDarwinDevice {
static llvm::StringRef GetDescriptionStatic();
- // lldb_private::Platform functions
-
llvm::StringRef GetDescription() override { return GetDescriptionStatic(); }
- // lldb_private::PluginInterface functions
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
- std::vector<lldb_private::ArchSpec> GetSupportedArchitectures(
- const lldb_private::ArchSpec &process_host_arch) override;
+ std::vector<ArchSpec>
+ GetSupportedArchitectures(const ArchSpec &process_host_arch) override;
protected:
bool CheckLocalSharedCache() const override;
@@ -49,4 +46,6 @@ class PlatformRemoteiOS : public PlatformRemoteDarwinDevice {
llvm::StringRef GetPlatformName() override;
};
+} // namespace lldb_private
+
#endif // LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMREMOTEIOS_H
More information about the lldb-commits
mailing list