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 21 class PlatformLinux : public PlatformPOSIX 22 { 23 public: 24 25 static void 26 DebuggerInitialize (lldb_private::Debugger &debugger); 27 28 static void 29 Initialize (); 30 31 static void 32 Terminate (); 33 34 PlatformLinux (bool is_host); 35 36 virtual 37 ~PlatformLinux(); 38 39 //------------------------------------------------------------ 40 // lldb_private::PluginInterface functions 41 //------------------------------------------------------------ 42 static lldb::PlatformSP 43 CreateInstance (bool force, const lldb_private::ArchSpec *arch); 44 45 static lldb_private::ConstString 46 GetPluginNameStatic (bool is_host); 47 48 static const char * 49 GetPluginDescriptionStatic (bool is_host); 50 51 lldb_private::ConstString 52 GetPluginName() override; 53 54 uint32_t 55 GetPluginVersion() override 56 { 57 return 1; 58 } 59 60 //------------------------------------------------------------ 61 // lldb_private::Platform functions 62 //------------------------------------------------------------ 63 Error 64 ResolveExecutable (const FileSpec &exe_file, 65 const ArchSpec &arch, 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 bool 86 GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch) override; 87 88 size_t 89 GetSoftwareBreakpointTrapOpcode (Target &target, 90 BreakpointSite *bp_site) override; 91 92 int32_t 93 GetResumeCountForLaunchInfo (ProcessLaunchInfo &launch_info) override; 94 95 bool 96 CanDebugProcess () override; 97 98 lldb::ProcessSP 99 DebugProcess (ProcessLaunchInfo &launch_info, 100 Debugger &debugger, 101 Target *target, 102 Listener &listener, 103 Error &error) override; 104 105 void 106 CalculateTrapHandlerSymbolNames () override; 107 108 Error 109 LaunchNativeProcess ( 110 ProcessLaunchInfo &launch_info, 111 lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate, 112 NativeProcessProtocolSP &process_sp) override; 113 114 Error 115 AttachNativeProcess (lldb::pid_t pid, 116 lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate, 117 NativeProcessProtocolSP &process_sp) override; 118 119 static bool 120 UseLlgsForLocalDebugging (); 121 122 private: 123 DISALLOW_COPY_AND_ASSIGN (PlatformLinux); 124 }; 125 } // namespace lldb_private 126 127 #endif // liblldb_PlatformLinux_h_ 128