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 
39   uint32_t GetPluginVersion() override { return 1; }
40 
41   //------------------------------------------------------------
42   // lldb_private::Platform functions
43   //------------------------------------------------------------
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   uint64_t ConvertMmapFlagsToPlatform(const ArchSpec &arch,
57                                       unsigned flags) override;
58 
59 private:
60   DISALLOW_COPY_AND_ASSIGN(PlatformOpenBSD);
61 };
62 
63 } // namespace platform_openbsd
64 } // namespace lldb_private
65 
66 #endif // liblldb_PlatformOpenBSD_h_
67