]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h
Vendor import of lldb trunk r256945:
[FreeBSD/FreeBSD.git] / source / Plugins / Platform / MacOSX / PlatformRemoteAppleTV.h
1 //===-- PlatformRemoteAppleTV.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_PlatformRemoteAppleTV_h_
11 #define liblldb_PlatformRemoteAppleTV_h_
12
13 // C Includes
14 // C++ Includes
15 #include <string>
16
17 // Other libraries and framework includes
18 // Project includes
19 #include "lldb/Host/FileSpec.h"
20
21 #include "PlatformDarwin.h"
22
23 class PlatformRemoteAppleTV : public PlatformDarwin
24 {
25 public:
26     PlatformRemoteAppleTV();
27
28     ~PlatformRemoteAppleTV() override = default;
29
30     //------------------------------------------------------------
31     // Class Functions
32     //------------------------------------------------------------
33     static lldb::PlatformSP
34     CreateInstance (bool force, const lldb_private::ArchSpec *arch);
35
36     static void
37     Initialize ();
38
39     static void
40     Terminate ();
41     
42     static lldb_private::ConstString
43     GetPluginNameStatic ();
44
45     static const char *
46     GetDescriptionStatic();
47     
48     //------------------------------------------------------------
49     // Class Methods
50     //------------------------------------------------------------
51     //------------------------------------------------------------
52     // lldb_private::PluginInterface functions
53     //------------------------------------------------------------
54     lldb_private::ConstString
55     GetPluginName() override
56     {
57         return GetPluginNameStatic();
58     }
59     
60     uint32_t
61     GetPluginVersion() override
62     {
63         return 1;
64     }
65
66     //------------------------------------------------------------
67     // lldb_private::Platform functions
68     //------------------------------------------------------------
69     lldb_private::Error
70     ResolveExecutable (const lldb_private::ModuleSpec &module_spec,
71                        lldb::ModuleSP &module_sp,
72                        const lldb_private::FileSpecList *module_search_paths_ptr) override;
73
74     const char *
75     GetDescription () override
76     {
77         return GetDescriptionStatic();
78     }
79
80     void
81     GetStatus (lldb_private::Stream &strm) override;
82
83     virtual lldb_private::Error
84     GetSymbolFile (const lldb_private::FileSpec &platform_file, 
85                    const lldb_private::UUID *uuid_ptr,
86                    lldb_private::FileSpec &local_file);
87
88     lldb_private::Error
89     GetSharedModule (const lldb_private::ModuleSpec &module_spec,
90                      lldb_private::Process* process,
91                      lldb::ModuleSP &module_sp,
92                      const lldb_private::FileSpecList *module_search_paths_ptr,
93                      lldb::ModuleSP *old_module_sp_ptr,
94                      bool *did_create_ptr) override;
95
96     bool
97     GetSupportedArchitectureAtIndex (uint32_t idx, 
98                                      lldb_private::ArchSpec &arch) override;
99     
100     void
101     AddClangModuleCompilationOptions (lldb_private::Target *target, std::vector<std::string> &options) override
102     {
103         return PlatformDarwin::AddClangModuleCompilationOptionsForSDKType(target, options, PlatformDarwin::SDKType::iPhoneOS);
104     }
105
106 protected:
107     struct SDKDirectoryInfo
108     {
109         SDKDirectoryInfo (const lldb_private::FileSpec &sdk_dir_spec);
110         lldb_private::FileSpec directory;
111         lldb_private::ConstString build;
112         uint32_t version_major;
113         uint32_t version_minor;
114         uint32_t version_update;
115         bool user_cached;
116     };
117     typedef std::vector<SDKDirectoryInfo> SDKDirectoryInfoCollection;
118     SDKDirectoryInfoCollection m_sdk_directory_infos;
119     std::string m_device_support_directory;
120     std::string m_device_support_directory_for_os_version;
121     std::string m_build_update;
122     uint32_t m_last_module_sdk_idx;
123     uint32_t m_connected_module_sdk_idx;
124
125     bool
126     UpdateSDKDirectoryInfosIfNeeded();
127
128     const char *
129     GetDeviceSupportDirectory();
130
131     const char *
132     GetDeviceSupportDirectoryForOSVersion();
133
134     const SDKDirectoryInfo *
135     GetSDKDirectoryForLatestOSVersion ();
136
137     const SDKDirectoryInfo *
138     GetSDKDirectoryForCurrentOSVersion ();
139
140     static lldb_private::FileSpec::EnumerateDirectoryResult
141     GetContainedFilesIntoVectorOfStringsCallback (void *baton,
142                                                   lldb_private::FileSpec::FileType file_type,
143                                                   const lldb_private::FileSpec &file_spec);
144
145     uint32_t
146     FindFileInAllSDKs (const char *platform_file_path,
147                        lldb_private::FileSpecList &file_list);
148
149     bool
150     GetFileInSDK (const char *platform_file_path,
151                   uint32_t sdk_idx,
152                   lldb_private::FileSpec &local_file);
153
154     bool
155     GetFileInSDKRoot (const char *platform_file_path,
156                       const char *sdkroot_path,
157                       bool symbols_dirs_only,
158                       lldb_private::FileSpec &local_file);
159
160     uint32_t
161     FindFileInAllSDKs (const lldb_private::FileSpec &platform_file,
162                        lldb_private::FileSpecList &file_list);
163
164     uint32_t
165     GetConnectedSDKIndex ();
166
167 private:
168     DISALLOW_COPY_AND_ASSIGN (PlatformRemoteAppleTV);
169 };
170
171 #endif // liblldb_PlatformRemoteAppleTV_h_