LLDB  mainline
PlatformMacOSX.h
Go to the documentation of this file.
1 //===-- PlatformMacOSX.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_PLATFORMMACOSX_H
10 #define LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMMACOSX_H
11 
12 #include "PlatformDarwinDevice.h"
13 #include "lldb/Target/Platform.h"
15 #include "lldb/Utility/Status.h"
16 #include "lldb/Utility/XcodeSDK.h"
17 #include "lldb/lldb-forward.h"
18 #include "llvm/ADT/SmallVector.h"
19 #include "llvm/ADT/StringRef.h"
20 
21 #include <vector>
22 
23 namespace lldb_private {
24 class ArchSpec;
25 class FileSpec;
26 class FileSpecList;
27 class ModuleSpec;
28 class Process;
29 class Target;
30 
32 public:
34 
35  static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
36 
37  static void Initialize();
38 
39  static void Terminate();
40 
41  static llvm::StringRef GetPluginNameStatic() {
43  }
44 
45  static llvm::StringRef GetDescriptionStatic();
46 
47  llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
48 
49  Status GetSharedModule(const ModuleSpec &module_spec, Process *process,
50  lldb::ModuleSP &module_sp,
51  const FileSpecList *module_search_paths_ptr,
53  bool *did_create_ptr) override;
54 
55  llvm::StringRef GetDescription() override { return GetDescriptionStatic(); }
56 
57  Status GetFile(const FileSpec &source, const FileSpec &destination) override {
58  return PlatformDarwin::GetFile(source, destination);
59  }
60 
61  std::vector<ArchSpec>
62  GetSupportedArchitectures(const ArchSpec &process_host_arch) override;
63 
64  ConstString GetSDKDirectory(Target &target) override;
65 
66  void
68  std::vector<std::string> &options) override {
70  target, options, XcodeSDK::Type::MacOSX);
71  }
72 
73 protected:
74  llvm::StringRef GetDeviceSupportDirectoryName() override;
75  llvm::StringRef GetPlatformName() override;
76 };
77 
78 } // namespace lldb_private
79 
80 #endif // LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMMACOSX_H
lldb_private::ArchSpec
Definition: ArchSpec.h:33
lldb_private::Process
Definition: Process.h:338
lldb_private::PlatformMacOSX::GetDescriptionStatic
static llvm::StringRef GetDescriptionStatic()
Definition: PlatformMacOSX.cpp:88
lldb_private::Target
Definition: Target.h:473
PlatformPOSIX::GetFile
lldb_private::Status GetFile(const lldb_private::FileSpec &source, const lldb_private::FileSpec &destination) override
Definition: PlatformPOSIX.cpp:155
XcodeSDK.h
Platform.h
lldb_private::FileSpec
Definition: FileSpec.h:56
lldb_private::PlatformMacOSX::GetSharedModule
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
Definition: PlatformMacOSX.cpp:171
lldb_private::PlatformMacOSX::GetPluginName
llvm::StringRef GetPluginName() override
Definition: PlatformMacOSX.h:47
lldb_private::PlatformMacOSX::GetSDKDirectory
ConstString GetSDKDirectory(Target &target) override
Definition: PlatformMacOSX.cpp:101
lldb_private::LLDBLog::Process
@ Process
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::PlatformMacOSX::GetPluginNameStatic
static llvm::StringRef GetPluginNameStatic()
Definition: PlatformMacOSX.h:41
lldb_private::PlatformMacOSX::AddClangModuleCompilationOptions
void AddClangModuleCompilationOptions(Target *target, std::vector< std::string > &options) override
Definition: PlatformMacOSX.h:67
lldb_private::PlatformMacOSX::GetDescription
llvm::StringRef GetDescription() override
Definition: PlatformMacOSX.h:55
lldb_private::PlatformMacOSX::GetDeviceSupportDirectoryName
llvm::StringRef GetDeviceSupportDirectoryName() override
Definition: PlatformMacOSX.cpp:215
lldb_private::PlatformMacOSX::CreateInstance
static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch)
Definition: PlatformMacOSX.cpp:92
PlatformDarwinDevice.h
lldb_private::ModuleSpec
Definition: ModuleSpec.h:27
lldb_private::Status
Definition: Status.h:44
lldb_private::PlatformDarwin::AddClangModuleCompilationOptionsForSDKType
void AddClangModuleCompilationOptionsForSDKType(Target *target, std::vector< std::string > &options, XcodeSDK::Type sdk_type)
Definition: PlatformDarwin.cpp:981
lldb_private::PlatformMacOSX::GetPlatformName
llvm::StringRef GetPlatformName() override
Definition: PlatformMacOSX.cpp:219
lldb_private::PlatformDarwinDevice
Abstract Darwin platform with a potential device support directory.
Definition: PlatformDarwinDevice.h:21
lldb_private::PlatformMacOSX::GetFile
Status GetFile(const FileSpec &source, const FileSpec &destination) override
Definition: PlatformMacOSX.h:57
lldb_private::PlatformMacOSX::PlatformMacOSX
PlatformMacOSX()
Default Constructor.
Definition: PlatformMacOSX.cpp:99
lldb-forward.h
Status.h
lldb_private::PlatformMacOSX::GetSupportedArchitectures
std::vector< ArchSpec > GetSupportedArchitectures(const ArchSpec &process_host_arch) override
Get the platform's supported architectures in the order in which they should be searched.
Definition: PlatformMacOSX.cpp:137
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::PlatformMacOSX
Definition: PlatformMacOSX.h:31
lldb_private::LLDBLog::Target
@ Target
lldb_private::PlatformMacOSX::Initialize
static void Initialize()
Definition: PlatformMacOSX.cpp:45
ConstString.h
llvm::SmallVectorImpl
Definition: Disassembler.h:42
lldb_private::PlatformMacOSX::Terminate
static void Terminate()
Definition: PlatformMacOSX.cpp:69
lldb_private::Platform::GetHostPlatformName
static const char * GetHostPlatformName()
Definition: Platform.cpp:61