1 //===-- PlatformFreeBSD.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_PlatformFreeBSD_h_ 11 #define liblldb_PlatformFreeBSD_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 class PlatformFreeBSD : public lldb_private::Platform 20 { 21 public: 22 // Mostly taken from PlatformDarwin and PlatformMacOSX 23 24 //------------------------------------------------------------ 25 // Class functions 26 //------------------------------------------------------------ 27 static lldb_private::Platform* 28 CreateInstance (bool force, const lldb_private::ArchSpec *arch); 29 30 static void 31 Initialize (); 32 33 static void 34 Terminate (); 35 36 static lldb_private::ConstString 37 GetPluginNameStatic (bool is_host); 38 39 static const char * 40 GetDescriptionStatic (bool is_host); 41 42 //------------------------------------------------------------ 43 // Class Methods 44 //------------------------------------------------------------ 45 PlatformFreeBSD (bool is_host); 46 47 virtual 48 ~PlatformFreeBSD(); 49 50 //------------------------------------------------------------ 51 // lldb_private::PluginInterface functions 52 //------------------------------------------------------------ 53 virtual lldb_private::ConstString GetPluginName()54 GetPluginName() 55 { 56 return GetPluginNameStatic (IsHost()); 57 } 58 59 virtual uint32_t GetPluginVersion()60 GetPluginVersion() 61 { 62 return 1; 63 } 64 65 virtual const char * GetDescription()66 GetDescription () 67 { 68 return GetDescriptionStatic(IsHost()); 69 } 70 71 //------------------------------------------------------------ 72 // lldb_private::Platform functions 73 //------------------------------------------------------------ 74 virtual lldb_private::Error 75 ResolveExecutable (const lldb_private::FileSpec &exe_file, 76 const lldb_private::ArchSpec &arch, 77 lldb::ModuleSP &module_sp, 78 const lldb_private::FileSpecList *module_search_paths_ptr); 79 80 virtual size_t 81 GetSoftwareBreakpointTrapOpcode (lldb_private::Target &target, 82 lldb_private::BreakpointSite *bp_site); 83 84 virtual bool 85 GetRemoteOSVersion (); 86 87 virtual bool 88 GetRemoteOSBuildString (std::string &s); 89 90 virtual bool 91 GetRemoteOSKernelDescription (std::string &s); 92 93 // Remote Platform subclasses need to override this function 94 virtual lldb_private::ArchSpec 95 GetRemoteSystemArchitecture (); 96 97 virtual bool 98 IsConnected () const; 99 100 virtual lldb_private::Error 101 ConnectRemote (lldb_private::Args& args); 102 103 virtual lldb_private::Error 104 DisconnectRemote (); 105 106 virtual const char * 107 GetHostname (); 108 109 virtual const char * 110 GetUserName (uint32_t uid); 111 112 virtual const char * 113 GetGroupName (uint32_t gid); 114 115 virtual bool 116 GetProcessInfo (lldb::pid_t pid, 117 lldb_private::ProcessInstanceInfo &proc_info); 118 119 virtual uint32_t 120 FindProcesses (const lldb_private::ProcessInstanceInfoMatch &match_info, 121 lldb_private::ProcessInstanceInfoList &process_infos); 122 123 virtual lldb_private::Error 124 LaunchProcess (lldb_private::ProcessLaunchInfo &launch_info); 125 126 virtual lldb::ProcessSP 127 Attach(lldb_private::ProcessAttachInfo &attach_info, 128 lldb_private::Debugger &debugger, 129 lldb_private::Target *target, 130 lldb_private::Listener &listener, 131 lldb_private::Error &error); 132 133 // FreeBSD processes can not be launched by spawning and attaching. 134 virtual bool CanDebugProcess()135 CanDebugProcess () { return false; } 136 137 // Only on PlatformMacOSX: 138 virtual lldb_private::Error 139 GetFile (const lldb_private::FileSpec &platform_file, 140 const lldb_private::UUID* uuid, lldb_private::FileSpec &local_file); 141 142 lldb_private::Error 143 GetSharedModule (const lldb_private::ModuleSpec &module_spec, 144 lldb::ModuleSP &module_sp, 145 const lldb_private::FileSpecList *module_search_paths_ptr, 146 lldb::ModuleSP *old_module_sp_ptr, 147 bool *did_create_ptr); 148 149 virtual bool 150 GetSupportedArchitectureAtIndex (uint32_t idx, lldb_private::ArchSpec &arch); 151 152 virtual void 153 GetStatus (lldb_private::Stream &strm); 154 155 protected: 156 lldb::PlatformSP m_remote_platform_sp; // Allow multiple ways to connect to a remote freebsd OS 157 158 private: 159 DISALLOW_COPY_AND_ASSIGN (PlatformFreeBSD); 160 }; 161 162 #endif // liblldb_PlatformFreeBSD_h_ 163