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 liblldb_PlatformMacOSX_h_
10 #define liblldb_PlatformMacOSX_h_
11 
12 #include "PlatformDarwin.h"
13 
14 class PlatformMacOSX : public PlatformDarwin {
15 public:
16   PlatformMacOSX(bool is_host);
17 
18   ~PlatformMacOSX() override;
19 
20   // Class functions
21   static lldb::PlatformSP CreateInstance(bool force,
22                                          const lldb_private::ArchSpec *arch);
23 
24   static void Initialize();
25 
26   static void Terminate();
27 
28   static lldb_private::ConstString GetPluginNameStatic(bool is_host);
29 
30   static const char *GetDescriptionStatic(bool is_host);
31 
32   // lldb_private::PluginInterface functions
33   lldb_private::ConstString GetPluginName() override {
34     return GetPluginNameStatic(IsHost());
35   }
36 
37   uint32_t GetPluginVersion() override { return 1; }
38 
39   lldb_private::Status
40   GetSharedModule(const lldb_private::ModuleSpec &module_spec,
41                   lldb_private::Process *process, lldb::ModuleSP &module_sp,
42                   const lldb_private::FileSpecList *module_search_paths_ptr,
43                   lldb::ModuleSP *old_module_sp_ptr,
44                   bool *did_create_ptr) override;
45 
46   const char *GetDescription() override {
47     return GetDescriptionStatic(IsHost());
48   }
49 
50   lldb_private::Status
51   GetSymbolFile(const lldb_private::FileSpec &platform_file,
52                 const lldb_private::UUID *uuid_ptr,
53                 lldb_private::FileSpec &local_file);
54 
55   lldb_private::Status
56   GetFile(const lldb_private::FileSpec &source,
57           const lldb_private::FileSpec &destination) override {
58     return PlatformDarwin::GetFile(source, destination);
59   }
60 
61   lldb_private::Status
62   GetFileWithUUID(const lldb_private::FileSpec &platform_file,
63                   const lldb_private::UUID *uuid_ptr,
64                   lldb_private::FileSpec &local_file) override;
65 
66   bool GetSupportedArchitectureAtIndex(uint32_t idx,
67                                        lldb_private::ArchSpec &arch) override;
68 
69   lldb_private::ConstString
70   GetSDKDirectory(lldb_private::Target &target) override;
71 
72   void
73   AddClangModuleCompilationOptions(lldb_private::Target *target,
74                                    std::vector<std::string> &options) override {
75     return PlatformDarwin::AddClangModuleCompilationOptionsForSDKType(
76         target, options, PlatformDarwin::SDKType::MacOSX);
77   }
78 
79 private:
80   DISALLOW_COPY_AND_ASSIGN(PlatformMacOSX);
81 };
82 
83 #endif // liblldb_PlatformMacOSX_h_
84