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