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 "PlatformDarwin.h"
13 
14 class PlatformMacOSX : public PlatformDarwin {
15 public:
16   PlatformMacOSX();
17 
18   // Class functions
19   static lldb::PlatformSP CreateInstance(bool force,
20                                          const lldb_private::ArchSpec *arch);
21 
22   static void Initialize();
23 
24   static void Terminate();
25 
26   static lldb_private::ConstString GetPluginNameStatic();
27 
28   static const char *GetDescriptionStatic();
29 
30   // lldb_private::PluginInterface functions
GetPluginName()31   lldb_private::ConstString GetPluginName() override {
32     return GetPluginNameStatic();
33   }
34 
GetPluginVersion()35   uint32_t GetPluginVersion() override { return 1; }
36 
37   lldb_private::Status
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,
41                   llvm::SmallVectorImpl<lldb::ModuleSP> *old_modules,
42                   bool *did_create_ptr) override;
43 
GetDescription()44   const char *GetDescription() override { return GetDescriptionStatic(); }
45 
46   lldb_private::Status
GetFile(const lldb_private::FileSpec & source,const lldb_private::FileSpec & destination)47   GetFile(const lldb_private::FileSpec &source,
48           const lldb_private::FileSpec &destination) override {
49     return PlatformDarwin::GetFile(source, destination);
50   }
51 
52   bool GetSupportedArchitectureAtIndex(uint32_t idx,
53                                        lldb_private::ArchSpec &arch) override;
54 
55   lldb_private::ConstString
56   GetSDKDirectory(lldb_private::Target &target) override;
57 
58   void
AddClangModuleCompilationOptions(lldb_private::Target * target,std::vector<std::string> & options)59   AddClangModuleCompilationOptions(lldb_private::Target *target,
60                                    std::vector<std::string> &options) override {
61     return PlatformDarwin::AddClangModuleCompilationOptionsForSDKType(
62         target, options, lldb_private::XcodeSDK::Type::MacOSX);
63   }
64 
65 private:
66 #if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
67   uint32_t m_num_arm_arches = 0;
68 #endif
69 };
70 
71 #endif // LLDB_SOURCE_PLUGINS_PLATFORM_MACOSX_PLATFORMMACOSX_H
72