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