1 //===-- PlatformLinux.h -----------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_PLATFORM_LINUX_PLATFORMLINUX_H
10 #define LLDB_SOURCE_PLUGINS_PLATFORM_LINUX_PLATFORMLINUX_H
12 #include "Plugins/Platform/POSIX/PlatformPOSIX.h"
13 #include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
15 namespace lldb_private
{
16 namespace platform_linux
{
18 class PlatformLinux
: public PlatformPOSIX
{
20 PlatformLinux(bool is_host
);
22 static void Initialize();
24 static void Terminate();
26 // lldb_private::PluginInterface functions
27 static lldb::PlatformSP
CreateInstance(bool force
, const ArchSpec
*arch
);
29 static llvm::StringRef
GetPluginNameStatic(bool is_host
) {
30 return is_host
? Platform::GetHostPlatformName() : "remote-linux";
33 static llvm::StringRef
GetPluginDescriptionStatic(bool is_host
);
35 llvm::StringRef
GetPluginName() override
{
36 return GetPluginNameStatic(IsHost());
39 // lldb_private::Platform functions
40 llvm::StringRef
GetDescription() override
{
41 return GetPluginDescriptionStatic(IsHost());
44 void GetStatus(Stream
&strm
) override
;
47 GetSupportedArchitectures(const ArchSpec
&process_host_arch
) override
;
49 uint32_t GetResumeCountForLaunchInfo(ProcessLaunchInfo
&launch_info
) override
;
51 bool CanDebugProcess() override
;
53 void CalculateTrapHandlerSymbolNames() override
;
55 lldb::UnwindPlanSP
GetTrapHandlerUnwindPlan(const llvm::Triple
&triple
,
56 ConstString name
) override
;
58 MmapArgList
GetMmapArgumentList(const ArchSpec
&arch
, lldb::addr_t addr
,
59 lldb::addr_t length
, unsigned prot
,
60 unsigned flags
, lldb::addr_t fd
,
61 lldb::addr_t offset
) override
;
63 CompilerType
GetSiginfoType(const llvm::Triple
&triple
) override
;
65 std::vector
<ArchSpec
> m_supported_architectures
;
69 std::shared_ptr
<TypeSystemClang
> m_type_system
;
72 } // namespace platform_linux
73 } // namespace lldb_private
75 #endif // LLDB_SOURCE_PLUGINS_PLATFORM_LINUX_PLATFORMLINUX_H