1 //===-- PlatformLinux.h -----------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef liblldb_PlatformLinux_h_
10 #define liblldb_PlatformLinux_h_
11 
12 #include "Plugins/Platform/POSIX/PlatformPOSIX.h"
13 
14 namespace lldb_private {
15 namespace platform_linux {
16 
17 class PlatformLinux : public PlatformPOSIX {
18 public:
19   PlatformLinux(bool is_host);
20 
21   ~PlatformLinux() override;
22 
23   static void Initialize();
24 
25   static void Terminate();
26 
27   //------------------------------------------------------------
28   // lldb_private::PluginInterface functions
29   //------------------------------------------------------------
30   static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
31 
32   static ConstString GetPluginNameStatic(bool is_host);
33 
34   static const char *GetPluginDescriptionStatic(bool is_host);
35 
36   ConstString GetPluginName() override;
37 
38   uint32_t GetPluginVersion() override { return 1; }
39 
40   //------------------------------------------------------------
41   // lldb_private::Platform functions
42   //------------------------------------------------------------
43   const char *GetDescription() override {
44     return GetPluginDescriptionStatic(IsHost());
45   }
46 
47   void GetStatus(Stream &strm) override;
48 
49   bool GetSupportedArchitectureAtIndex(uint32_t idx, ArchSpec &arch) override;
50 
51   int32_t GetResumeCountForLaunchInfo(ProcessLaunchInfo &launch_info) override;
52 
53   bool CanDebugProcess() override;
54 
55   std::vector<std::string>
56   GetSystemIncludeDirectories(lldb::LanguageType lang) override;
57 
58   lldb::ProcessSP DebugProcess(ProcessLaunchInfo &launch_info,
59                                Debugger &debugger, Target *target,
60                                Status &error) override;
61 
62   void CalculateTrapHandlerSymbolNames() override;
63 
64   MmapArgList GetMmapArgumentList(const ArchSpec &arch, lldb::addr_t addr,
65                                   lldb::addr_t length, unsigned prot,
66                                   unsigned flags, lldb::addr_t fd,
67                                   lldb::addr_t offset) override;
68 
69 private:
70   DISALLOW_COPY_AND_ASSIGN(PlatformLinux);
71 };
72 
73 } // namespace platform_linux
74 } // namespace lldb_private
75 
76 #endif // liblldb_PlatformLinux_h_
77