xref: /freebsd-src/contrib/llvm-project/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h (revision e67e85659c0de33e617e5fbf1028c6e8b49eee53)
1 //===-- PlatformFreeBSD.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 LLDB_SOURCE_PLUGINS_PLATFORM_FREEBSD_PLATFORMFREEBSD_H
10 #define LLDB_SOURCE_PLUGINS_PLATFORM_FREEBSD_PLATFORMFREEBSD_H
11 
12 #include "Plugins/Platform/POSIX/PlatformPOSIX.h"
13 #include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
14 
15 namespace lldb_private {
16 namespace platform_freebsd {
17 
18 class PlatformFreeBSD : public PlatformPOSIX {
19 public:
20   PlatformFreeBSD(bool is_host);
21 
22   static void Initialize();
23 
24   static void Terminate();
25 
26   // lldb_private::PluginInterface functions
27   static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
28 
29   static llvm::StringRef GetPluginNameStatic(bool is_host) {
30     return is_host ? Platform::GetHostPlatformName() : "remote-freebsd";
31   }
32 
33   static llvm::StringRef GetPluginDescriptionStatic(bool is_host);
34 
35   llvm::StringRef GetPluginName() override {
36     return GetPluginNameStatic(IsHost());
37   }
38 
39   // lldb_private::Platform functions
40   llvm::StringRef GetDescription() override {
41     return GetPluginDescriptionStatic(IsHost());
42   }
43 
44   void GetStatus(Stream &strm) override;
45 
46   std::vector<ArchSpec> GetSupportedArchitectures() override;
47 
48   bool CanDebugProcess() override;
49 
50   void CalculateTrapHandlerSymbolNames() override;
51 
52   MmapArgList GetMmapArgumentList(const ArchSpec &arch, lldb::addr_t addr,
53                                   lldb::addr_t length, unsigned prot,
54                                   unsigned flags, lldb::addr_t fd,
55                                   lldb::addr_t offset) override;
56 
57   CompilerType GetSiginfoType(const llvm::Triple &triple) override;
58 
59   std::vector<ArchSpec> m_supported_architectures;
60 
61 private:
62   std::unique_ptr<TypeSystemClang> m_type_system_up;
63 };
64 
65 } // namespace platform_freebsd
66 } // namespace lldb_private
67 
68 #endif // LLDB_SOURCE_PLUGINS_PLATFORM_FREEBSD_PLATFORMFREEBSD_H
69