LLDB mainline
PlatformLinux.h
Go to the documentation of this file.
1//===-- PlatformLinux.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_LINUX_PLATFORMLINUX_H
10#define LLDB_SOURCE_PLUGINS_PLATFORM_LINUX_PLATFORMLINUX_H
11
14
15namespace lldb_private {
16namespace platform_linux {
17
19public:
20 PlatformLinux(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-linux";
31 }
32
33 static llvm::StringRef GetPluginDescriptionStatic(bool is_host);
34
35 llvm::StringRef GetPluginName() override {
37 }
38
39 // lldb_private::Platform functions
40 llvm::StringRef GetDescription() override {
42 }
43
44 void GetStatus(Stream &strm) override;
45
46 std::vector<ArchSpec>
47 GetSupportedArchitectures(const ArchSpec &process_host_arch) override;
48
49 uint32_t GetResumeCountForLaunchInfo(ProcessLaunchInfo &launch_info) override;
50
51 bool CanDebugProcess() override;
52
53 void CalculateTrapHandlerSymbolNames() override;
54
55 lldb::UnwindPlanSP GetTrapHandlerUnwindPlan(const llvm::Triple &triple,
56 ConstString name) override;
57
59 lldb::addr_t length, unsigned prot,
60 unsigned flags, lldb::addr_t fd,
61 lldb::addr_t offset) override;
62
63 CompilerType GetSiginfoType(const llvm::Triple &triple) override;
64
65 std::vector<ArchSpec> m_supported_architectures;
66
67private:
68 std::mutex m_mutex;
69 std::shared_ptr<TypeSystemClang> m_type_system;
70};
71
72} // namespace platform_linux
73} // namespace lldb_private
74
75#endif // LLDB_SOURCE_PLUGINS_PLATFORM_LINUX_PLATFORMLINUX_H
An architecture specification class.
Definition: ArchSpec.h:31
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
A uniqued constant string class.
Definition: ConstString.h:40
bool IsHost() const
Definition: Platform.h:502
static const char * GetHostPlatformName()
Definition: Platform.cpp:61
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
void GetStatus(Stream &strm) override
Report the current status for this platform.
llvm::StringRef GetPluginName() override
Definition: PlatformLinux.h:35
void CalculateTrapHandlerSymbolNames() override
Ask the Platform subclass to fill in the list of trap handler names.
std::vector< ArchSpec > GetSupportedArchitectures(const ArchSpec &process_host_arch) override
Get the platform's supported architectures in the order in which they should be searched.
std::shared_ptr< TypeSystemClang > m_type_system
Definition: PlatformLinux.h:69
static llvm::StringRef GetPluginDescriptionStatic(bool is_host)
static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch)
lldb::UnwindPlanSP GetTrapHandlerUnwindPlan(const llvm::Triple &triple, ConstString name) override
Try to get a specific unwind plan for a named trap handler.
static llvm::StringRef GetPluginNameStatic(bool is_host)
Definition: PlatformLinux.h:29
MmapArgList GetMmapArgumentList(const ArchSpec &arch, lldb::addr_t addr, lldb::addr_t length, unsigned prot, unsigned flags, lldb::addr_t fd, lldb::addr_t offset) override
uint32_t GetResumeCountForLaunchInfo(ProcessLaunchInfo &launch_info) override
llvm::StringRef GetDescription() override
Definition: PlatformLinux.h:40
std::vector< ArchSpec > m_supported_architectures
Definition: PlatformLinux.h:65
bool CanDebugProcess() override
Not all platforms will support debugging a process by spawning somehow halted for a debugger (specifi...
CompilerType GetSiginfoType(const llvm::Triple &triple) override
A class that represents a running process on the host machine.
llvm::SmallVector< lldb::addr_t, 6 > MmapArgList
Definition: Platform.h:63
std::shared_ptr< lldb_private::Platform > PlatformSP
Definition: lldb-forward.h:388
std::shared_ptr< lldb_private::UnwindPlan > UnwindPlanSP
Definition: lldb-forward.h:483
uint64_t addr_t
Definition: lldb-types.h:80