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 (bool force, const lldb_private::ArchSpec *arch); 41 42 static lldb_private::ConstString 43 GetPluginNameStatic (bool is_host); 44 45 static const char * 46 GetPluginDescriptionStatic (bool is_host); 47 48 virtual lldb_private::ConstString 49 GetPluginName(); 50 51 virtual uint32_t GetPluginVersion()52 GetPluginVersion() 53 { 54 return 1; 55 } 56 57 //------------------------------------------------------------ 58 // lldb_private::Platform functions 59 //------------------------------------------------------------ 60 virtual Error 61 ResolveExecutable (const FileSpec &exe_file, 62 const ArchSpec &arch, 63 lldb::ModuleSP &module_sp, 64 const FileSpecList *module_search_paths_ptr); 65 66 virtual const char * GetDescription()67 GetDescription () 68 { 69 return GetPluginDescriptionStatic(IsHost()); 70 } 71 72 virtual void 73 GetStatus (Stream &strm); 74 75 virtual Error 76 GetFile (const FileSpec &platform_file, 77 const UUID* uuid, FileSpec &local_file); 78 79 virtual bool 80 GetProcessInfo (lldb::pid_t pid, ProcessInstanceInfo &proc_info); 81 82 virtual bool 83 GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch); 84 85 virtual size_t 86 GetSoftwareBreakpointTrapOpcode (Target &target, 87 BreakpointSite *bp_site); 88 89 virtual lldb_private::Error 90 LaunchProcess (lldb_private::ProcessLaunchInfo &launch_info); 91 92 virtual lldb::ProcessSP 93 Attach(ProcessAttachInfo &attach_info, Debugger &debugger, 94 Target *target, Listener &listener, Error &error); 95 96 // Linux processes can not be launched by spawning and attaching. 97 virtual bool CanDebugProcess()98 CanDebugProcess () 99 { 100 return false; 101 } 102 103 protected: 104 lldb::PlatformSP m_remote_platform_sp; // Allow multiple ways to connect to a remote darwin OS 105 106 private: 107 DISALLOW_COPY_AND_ASSIGN (PlatformLinux); 108 }; 109 } // namespace lldb_private 110 111 #endif // liblldb_PlatformLinux_h_ 112