1 //===-- PlatformFreeBSD.h ---------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_PlatformFreeBSD_h_
11 #define liblldb_PlatformFreeBSD_h_
15 // Other libraries and framework includes
17 #include "lldb/Target/Platform.h"
19 class PlatformFreeBSD : public lldb_private::Platform
22 // Mostly taken from PlatformDarwin and PlatformMacOSX
24 //------------------------------------------------------------
26 //------------------------------------------------------------
27 static lldb::PlatformSP
28 CreateInstance (bool force, const lldb_private::ArchSpec *arch);
36 static lldb_private::ConstString
37 GetPluginNameStatic (bool is_host);
40 GetDescriptionStatic (bool is_host);
42 //------------------------------------------------------------
44 //------------------------------------------------------------
45 PlatformFreeBSD (bool is_host);
50 //------------------------------------------------------------
51 // lldb_private::PluginInterface functions
52 //------------------------------------------------------------
53 virtual lldb_private::ConstString
56 return GetPluginNameStatic (IsHost());
68 return GetDescriptionStatic(IsHost());
71 //------------------------------------------------------------
72 // lldb_private::Platform functions
73 //------------------------------------------------------------
74 virtual lldb_private::Error
75 RunShellCommand (const char *command,
76 const char *working_dir,
79 std::string *command_output,
80 uint32_t timeout_sec);
82 virtual lldb_private::Error
83 ResolveExecutable (const lldb_private::ModuleSpec &module_spec,
84 lldb::ModuleSP &module_sp,
85 const lldb_private::FileSpecList *module_search_paths_ptr);
88 GetSoftwareBreakpointTrapOpcode (lldb_private::Target &target,
89 lldb_private::BreakpointSite *bp_site);
92 GetRemoteOSVersion ();
95 GetRemoteOSBuildString (std::string &s);
98 GetRemoteOSKernelDescription (std::string &s);
100 // Remote Platform subclasses need to override this function
101 virtual lldb_private::ArchSpec
102 GetRemoteSystemArchitecture ();
105 IsConnected () const;
107 virtual lldb_private::Error
108 ConnectRemote (lldb_private::Args& args);
110 virtual lldb_private::Error
117 GetUserName (uint32_t uid);
120 GetGroupName (uint32_t gid);
123 GetProcessInfo (lldb::pid_t pid,
124 lldb_private::ProcessInstanceInfo &proc_info);
127 FindProcesses (const lldb_private::ProcessInstanceInfoMatch &match_info,
128 lldb_private::ProcessInstanceInfoList &process_infos);
130 virtual lldb_private::Error
131 LaunchProcess (lldb_private::ProcessLaunchInfo &launch_info);
133 virtual lldb::ProcessSP
134 Attach(lldb_private::ProcessAttachInfo &attach_info,
135 lldb_private::Debugger &debugger,
136 lldb_private::Target *target,
137 lldb_private::Error &error);
139 // FreeBSD processes can not be launched by spawning and attaching.
141 CanDebugProcess () { return false; }
143 // Only on PlatformMacOSX:
144 virtual lldb_private::Error
145 GetFileWithUUID (const lldb_private::FileSpec &platform_file,
146 const lldb_private::UUID* uuid, lldb_private::FileSpec &local_file);
149 GetSharedModule (const lldb_private::ModuleSpec &module_spec,
150 lldb::ModuleSP &module_sp,
151 const lldb_private::FileSpecList *module_search_paths_ptr,
152 lldb::ModuleSP *old_module_sp_ptr,
153 bool *did_create_ptr);
156 GetSupportedArchitectureAtIndex (uint32_t idx, lldb_private::ArchSpec &arch);
159 GetStatus (lldb_private::Stream &strm);
162 CalculateTrapHandlerSymbolNames ();
165 lldb::PlatformSP m_remote_platform_sp; // Allow multiple ways to connect to a remote freebsd OS
168 DISALLOW_COPY_AND_ASSIGN (PlatformFreeBSD);
171 #endif // liblldb_PlatformFreeBSD_h_