1 //===-- PlatformLinux.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_PlatformLinux_h_
11 #define liblldb_PlatformLinux_h_
15 // Other libraries and framework includes
17 #include "Plugins/Platform/POSIX/PlatformPOSIX.h"
19 namespace lldb_private {
20 namespace platform_linux {
22 class PlatformLinux : public PlatformPOSIX {
24 PlatformLinux(bool is_host);
26 ~PlatformLinux() override;
28 static void DebuggerInitialize(Debugger &debugger);
30 static void Initialize();
32 static void Terminate();
34 //------------------------------------------------------------
35 // lldb_private::PluginInterface functions
36 //------------------------------------------------------------
37 static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
39 static ConstString GetPluginNameStatic(bool is_host);
41 static const char *GetPluginDescriptionStatic(bool is_host);
43 ConstString GetPluginName() override;
45 uint32_t GetPluginVersion() override { return 1; }
47 //------------------------------------------------------------
48 // lldb_private::Platform functions
49 //------------------------------------------------------------
50 Error ResolveExecutable(const ModuleSpec &module_spec,
51 lldb::ModuleSP &module_sp,
52 const FileSpecList *module_search_paths_ptr) override;
54 const char *GetDescription() override {
55 return GetPluginDescriptionStatic(IsHost());
58 void GetStatus(Stream &strm) override;
60 Error GetFileWithUUID(const FileSpec &platform_file, const UUID *uuid,
61 FileSpec &local_file) override;
63 bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &proc_info) override;
65 uint32_t FindProcesses(const ProcessInstanceInfoMatch &match_info,
66 ProcessInstanceInfoList &process_infos) override;
68 bool GetSupportedArchitectureAtIndex(uint32_t idx, ArchSpec &arch) override;
70 int32_t GetResumeCountForLaunchInfo(ProcessLaunchInfo &launch_info) override;
72 bool CanDebugProcess() override;
74 lldb::ProcessSP DebugProcess(ProcessLaunchInfo &launch_info,
75 Debugger &debugger, Target *target,
76 Error &error) override;
78 void CalculateTrapHandlerSymbolNames() override;
80 uint64_t ConvertMmapFlagsToPlatform(const ArchSpec &arch,
81 unsigned flags) override;
83 ConstString GetFullNameForDylib(ConstString basename) override;
86 DISALLOW_COPY_AND_ASSIGN(PlatformLinux);
89 } // namespace platform_linux
90 } // namespace lldb_private
92 #endif // liblldb_PlatformLinux_h_