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 "lldb/Target/Platform.h" 18 19 namespace lldb_private { 20 21 class PlatformLinux : public Platform 22 { 23 public: 24 25 static void 26 Initialize (); 27 28 static void 29 Terminate (); 30 31 PlatformLinux (bool is_host); 32 33 virtual 34 ~PlatformLinux(); 35 36 //------------------------------------------------------------ 37 // lldb_private::PluginInterface functions 38 //------------------------------------------------------------ 39 static Platform * 40 CreateInstance (); 41 42 static const char * 43 GetPluginNameStatic(); 44 45 static const char * 46 GetShortPluginNameStatic(bool is_host); 47 48 static const char * 49 GetPluginDescriptionStatic(bool is_host); 50 51 virtual const char * 52 GetPluginName() 53 { 54 return GetPluginNameStatic(); 55 } 56 57 virtual const char * 58 GetShortPluginName() 59 { 60 return "PlatformLinux"; 61 } 62 63 virtual uint32_t 64 GetPluginVersion() 65 { 66 return 1; 67 } 68 69 //------------------------------------------------------------ 70 // lldb_private::Platform functions 71 //------------------------------------------------------------ 72 virtual Error 73 ResolveExecutable (const FileSpec &exe_file, 74 const ArchSpec &arch, 75 lldb::ModuleSP &module_sp); 76 77 virtual const char * 78 GetDescription () 79 { 80 return GetPluginDescriptionStatic(IsHost()); 81 } 82 83 virtual void 84 GetStatus (Stream &strm); 85 86 virtual Error 87 GetFile (const FileSpec &platform_file, 88 const UUID* uuid, FileSpec &local_file); 89 90 virtual bool 91 GetProcessInfo (lldb::pid_t pid, ProcessInstanceInfo &proc_info); 92 93 virtual bool 94 GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch); 95 96 virtual size_t 97 GetSoftwareBreakpointTrapOpcode (Target &target, 98 BreakpointSite *bp_site); 99 100 virtual lldb_private::Error 101 LaunchProcess (lldb_private::ProcessLaunchInfo &launch_info); 102 103 virtual lldb::ProcessSP 104 Attach(ProcessAttachInfo &attach_info, Debugger &debugger, 105 Target *target, Listener &listener, Error &error); 106 107 virtual bool 108 CanDebugProcess () 109 { 110 return false; 111 } 112 113 protected: 114 lldb::PlatformSP m_remote_platform_sp; // Allow multiple ways to connect to a remote darwin OS 115 116 private: 117 DISALLOW_COPY_AND_ASSIGN (PlatformLinux); 118 }; 119 } // namespace lldb_private 120 121 #endif // liblldb_PlatformLinux_h_ 122