1 //===-- PlatformLinux.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_PlatformLinux_h_ 11 #define liblldb_PlatformLinux_h_ 12 13 // C Includes 14 // C++ Includes 15 // Other libraries and framework includes 16 // Project includes 17 #include "Plugins/Platform/POSIX/PlatformPOSIX.h" 18 19 namespace lldb_private { 20 namespace platform_linux { 21 22 class PlatformLinux : public PlatformPOSIX 23 { 24 public: 25 PlatformLinux(bool is_host); 26 27 ~PlatformLinux() override; 28 29 static void 30 DebuggerInitialize (Debugger &debugger); 31 32 static void 33 Initialize (); 34 35 static void 36 Terminate (); 37 38 //------------------------------------------------------------ 39 // lldb_private::PluginInterface functions 40 //------------------------------------------------------------ 41 static lldb::PlatformSP 42 CreateInstance (bool force, const ArchSpec *arch); 43 44 static ConstString 45 GetPluginNameStatic (bool is_host); 46 47 static const char * 48 GetPluginDescriptionStatic (bool is_host); 49 50 ConstString 51 GetPluginName() override; 52 53 uint32_t 54 GetPluginVersion() override 55 { 56 return 1; 57 } 58 59 //------------------------------------------------------------ 60 // lldb_private::Platform functions 61 //------------------------------------------------------------ 62 Error 63 ResolveExecutable (const ModuleSpec &module_spec, 64 lldb::ModuleSP &module_sp, 65 const FileSpecList *module_search_paths_ptr) override; 66 67 const char * 68 GetDescription () override 69 { 70 return GetPluginDescriptionStatic(IsHost()); 71 } 72 73 void 74 GetStatus (Stream &strm) override; 75 76 Error 77 GetFileWithUUID (const FileSpec &platform_file, 78 const UUID* uuid, FileSpec &local_file) override; 79 80 bool 81 GetProcessInfo (lldb::pid_t pid, ProcessInstanceInfo &proc_info) override; 82 83 uint32_t 84 FindProcesses (const ProcessInstanceInfoMatch &match_info, 85 ProcessInstanceInfoList &process_infos) override; 86 87 bool 88 GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch) override; 89 90 int32_t 91 GetResumeCountForLaunchInfo (ProcessLaunchInfo &launch_info) override; 92 93 bool 94 CanDebugProcess () override; 95 96 lldb::ProcessSP 97 DebugProcess (ProcessLaunchInfo &launch_info, 98 Debugger &debugger, 99 Target *target, 100 Error &error) override; 101 102 void 103 CalculateTrapHandlerSymbolNames () override; 104 105 uint64_t 106 ConvertMmapFlagsToPlatform(const ArchSpec &arch, unsigned flags) override; 107 108 ConstString 109 GetFullNameForDylib (ConstString basename) override; 110 111 private: 112 DISALLOW_COPY_AND_ASSIGN (PlatformLinux); 113 }; 114 115 } // namespace platform_linux 116 } // namespace lldb_private 117 118 #endif // liblldb_PlatformLinux_h_ 119