1 //===-- PlatformMacOSX.h ----------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef liblldb_PlatformMacOSX_h_
11 #define liblldb_PlatformMacOSX_h_
12 
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "PlatformDarwin.h"
18 
19 class PlatformMacOSX : public PlatformDarwin {
20 public:
21   PlatformMacOSX(bool is_host);
22 
23   ~PlatformMacOSX() override;
24 
25   //------------------------------------------------------------
26   // Class functions
27   //------------------------------------------------------------
28   static lldb::PlatformSP CreateInstance(bool force,
29                                          const lldb_private::ArchSpec *arch);
30 
31   static void Initialize();
32 
33   static void Terminate();
34 
35   static lldb_private::ConstString GetPluginNameStatic(bool is_host);
36 
37   static const char *GetDescriptionStatic(bool is_host);
38 
39   //------------------------------------------------------------
40   // lldb_private::PluginInterface functions
41   //------------------------------------------------------------
42   lldb_private::ConstString GetPluginName() override {
43     return GetPluginNameStatic(IsHost());
44   }
45 
46   uint32_t GetPluginVersion() override { return 1; }
47 
48   lldb_private::Error
49   GetSharedModule(const lldb_private::ModuleSpec &module_spec,
50                   lldb_private::Process *process, lldb::ModuleSP &module_sp,
51                   const lldb_private::FileSpecList *module_search_paths_ptr,
52                   lldb::ModuleSP *old_module_sp_ptr,
53                   bool *did_create_ptr) override;
54 
55   const char *GetDescription() override {
56     return GetDescriptionStatic(IsHost());
57   }
58 
59   lldb_private::Error GetSymbolFile(const lldb_private::FileSpec &platform_file,
60                                     const lldb_private::UUID *uuid_ptr,
61                                     lldb_private::FileSpec &local_file);
62 
63   lldb_private::Error
64   GetFile(const lldb_private::FileSpec &source,
65           const lldb_private::FileSpec &destination) override {
66     return PlatformDarwin::GetFile(source, destination);
67   }
68 
69   lldb_private::Error
70   GetFileWithUUID(const lldb_private::FileSpec &platform_file,
71                   const lldb_private::UUID *uuid_ptr,
72                   lldb_private::FileSpec &local_file) override;
73 
74   bool GetSupportedArchitectureAtIndex(uint32_t idx,
75                                        lldb_private::ArchSpec &arch) override;
76 
77   lldb_private::ConstString
78   GetSDKDirectory(lldb_private::Target &target) override;
79 
80   void
81   AddClangModuleCompilationOptions(lldb_private::Target *target,
82                                    std::vector<std::string> &options) override {
83     return PlatformDarwin::AddClangModuleCompilationOptionsForSDKType(
84         target, options, PlatformDarwin::SDKType::MacOSX);
85   }
86 
87 private:
88   DISALLOW_COPY_AND_ASSIGN(PlatformMacOSX);
89 };
90 
91 #endif // liblldb_PlatformMacOSX_h_
92