xref: /freebsd-src/contrib/llvm-project/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.h (revision 81ad626541db97eb356e2c1d4a20eb2a26a766ab)
10b57cec5SDimitry Andric //===-- PlatformOpenBSD.h ---------------------------------------*- C++ -*-===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
95ffd83dbSDimitry Andric #ifndef LLDB_SOURCE_PLUGINS_PLATFORM_OPENBSD_PLATFORMOPENBSD_H
105ffd83dbSDimitry Andric #define LLDB_SOURCE_PLUGINS_PLATFORM_OPENBSD_PLATFORMOPENBSD_H
110b57cec5SDimitry Andric 
120b57cec5SDimitry Andric #include "Plugins/Platform/POSIX/PlatformPOSIX.h"
130b57cec5SDimitry Andric 
140b57cec5SDimitry Andric namespace lldb_private {
150b57cec5SDimitry Andric namespace platform_openbsd {
160b57cec5SDimitry Andric 
170b57cec5SDimitry Andric class PlatformOpenBSD : public PlatformPOSIX {
180b57cec5SDimitry Andric public:
190b57cec5SDimitry Andric   PlatformOpenBSD(bool is_host);
200b57cec5SDimitry Andric 
210b57cec5SDimitry Andric   static void Initialize();
220b57cec5SDimitry Andric 
230b57cec5SDimitry Andric   static void Terminate();
240b57cec5SDimitry Andric 
250b57cec5SDimitry Andric   // lldb_private::PluginInterface functions
260b57cec5SDimitry Andric   static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
270b57cec5SDimitry Andric 
GetPluginNameStatic(bool is_host)28349cc55cSDimitry Andric   static llvm::StringRef GetPluginNameStatic(bool is_host) {
29349cc55cSDimitry Andric     return is_host ? Platform::GetHostPlatformName() : "remote-openbsd";
30349cc55cSDimitry Andric   }
310b57cec5SDimitry Andric 
32349cc55cSDimitry Andric   static llvm::StringRef GetPluginDescriptionStatic(bool is_host);
330b57cec5SDimitry Andric 
GetPluginName()34349cc55cSDimitry Andric   llvm::StringRef GetPluginName() override {
35349cc55cSDimitry Andric     return GetPluginNameStatic(IsHost());
36349cc55cSDimitry Andric   }
370b57cec5SDimitry Andric 
380b57cec5SDimitry Andric   // lldb_private::Platform functions
GetDescription()39349cc55cSDimitry Andric   llvm::StringRef GetDescription() override {
400b57cec5SDimitry Andric     return GetPluginDescriptionStatic(IsHost());
410b57cec5SDimitry Andric   }
420b57cec5SDimitry Andric 
430b57cec5SDimitry Andric   void GetStatus(Stream &strm) override;
440b57cec5SDimitry Andric 
45*81ad6265SDimitry Andric   std::vector<ArchSpec>
46*81ad6265SDimitry Andric   GetSupportedArchitectures(const ArchSpec &process_host_arch) override;
470b57cec5SDimitry Andric 
480b57cec5SDimitry Andric   bool CanDebugProcess() override;
490b57cec5SDimitry Andric 
500b57cec5SDimitry Andric   void CalculateTrapHandlerSymbolNames() override;
510b57cec5SDimitry Andric 
520b57cec5SDimitry Andric   MmapArgList GetMmapArgumentList(const ArchSpec &arch, lldb::addr_t addr,
530b57cec5SDimitry Andric                                   lldb::addr_t length, unsigned prot,
540b57cec5SDimitry Andric                                   unsigned flags, lldb::addr_t fd,
550b57cec5SDimitry Andric                                   lldb::addr_t offset) override;
56349cc55cSDimitry Andric 
57349cc55cSDimitry Andric   std::vector<ArchSpec> m_supported_architectures;
580b57cec5SDimitry Andric };
590b57cec5SDimitry Andric 
600b57cec5SDimitry Andric } // namespace platform_openbsd
610b57cec5SDimitry Andric } // namespace lldb_private
620b57cec5SDimitry Andric 
635ffd83dbSDimitry Andric #endif // LLDB_SOURCE_PLUGINS_PLATFORM_OPENBSD_PLATFORMOPENBSD_H
64