1 //===-- PlatformOpenBSD.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_PlatformOpenBSD_h_
11 #define liblldb_PlatformOpenBSD_h_
12 
13 #include "Plugins/Platform/POSIX/PlatformPOSIX.h"
14 
15 namespace lldb_private {
16 namespace platform_openbsd {
17 
18 class PlatformOpenBSD : public PlatformPOSIX {
19 public:
20   PlatformOpenBSD(bool is_host);
21 
22   ~PlatformOpenBSD() override;
23 
24   static void Initialize();
25 
26   static void Terminate();
27 
28   //------------------------------------------------------------
29   // lldb_private::PluginInterface functions
30   //------------------------------------------------------------
31   static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
32 
33   static ConstString GetPluginNameStatic(bool is_host);
34 
35   static const char *GetPluginDescriptionStatic(bool is_host);
36 
37   ConstString GetPluginName() override;
38 
GetPluginVersion()39   uint32_t GetPluginVersion() override { return 1; }
40 
41   //------------------------------------------------------------
42   // lldb_private::Platform functions
43   //------------------------------------------------------------
GetDescription()44   const char *GetDescription() override {
45     return GetPluginDescriptionStatic(IsHost());
46   }
47 
48   void GetStatus(Stream &strm) override;
49 
50   bool GetSupportedArchitectureAtIndex(uint32_t idx, ArchSpec &arch) override;
51 
52   bool CanDebugProcess() override;
53 
54   void CalculateTrapHandlerSymbolNames() override;
55 
56   MmapArgList GetMmapArgumentList(const ArchSpec &arch, lldb::addr_t addr,
57                                   lldb::addr_t length, unsigned prot,
58                                   unsigned flags, lldb::addr_t fd,
59                                   lldb::addr_t offset) override;
60 
61 private:
62   DISALLOW_COPY_AND_ASSIGN(PlatformOpenBSD);
63 };
64 
65 } // namespace platform_openbsd
66 } // namespace lldb_private
67 
68 #endif // liblldb_PlatformOpenBSD_h_
69