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 
13 
14 namespace lldb_private {
15 namespace platform_linux {
16 
17 class PlatformLinux : public PlatformPOSIX {
18 public:
19  PlatformLinux(bool is_host);
20 
21  static void Initialize();
22 
23  static void Terminate();
24 
25  // lldb_private::PluginInterface functions
26  static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
27 
28  static llvm::StringRef GetPluginNameStatic(bool is_host) {
29  return is_host ? Platform::GetHostPlatformName() : "remote-linux";
30  }
31 
32  static llvm::StringRef GetPluginDescriptionStatic(bool is_host);
33 
34  llvm::StringRef GetPluginName() override {
35  return GetPluginNameStatic(IsHost());
36  }
37 
38  // lldb_private::Platform functions
39  llvm::StringRef GetDescription() override {
41  }
42 
43  void GetStatus(Stream &strm) override;
44 
45  std::vector<ArchSpec> GetSupportedArchitectures() override;
46 
48 
49  bool CanDebugProcess() override;
50 
51  void CalculateTrapHandlerSymbolNames() override;
52 
53  lldb::UnwindPlanSP GetTrapHandlerUnwindPlan(const llvm::Triple &triple,
54  ConstString name) override;
55 
57  lldb::addr_t length, unsigned prot,
58  unsigned flags, lldb::addr_t fd,
59  lldb::addr_t offset) override;
60 
61  std::vector<ArchSpec> m_supported_architectures;
62 };
63 
64 } // namespace platform_linux
65 } // namespace lldb_private
66 
67 #endif // LLDB_SOURCE_PLUGINS_PLATFORM_LINUX_PLATFORMLINUX_H
lldb_private::ArchSpec
Definition: ArchSpec.h:33
lldb_private::MmapArgList
llvm::SmallVector< lldb::addr_t, 6 > MmapArgList
Definition: Platform.h:58
lldb_private::platform_linux::PlatformLinux::GetStatus
void GetStatus(Stream &strm) override
Report the current status for this platform.
Definition: PlatformLinux.cpp:136
lldb_private::platform_linux::PlatformLinux::CalculateTrapHandlerSymbolNames
void CalculateTrapHandlerSymbolNames() override
Ask the Platform subclass to fill in the list of trap handler names.
Definition: PlatformLinux.cpp:200
lldb_private::Stream
Definition: Stream.h:28
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
PlatformPOSIX
Definition: PlatformPOSIX.h:18
lldb_private::platform_linux::PlatformLinux::PlatformLinux
PlatformLinux(bool is_host)
Default Constructor.
Definition: PlatformLinux.cpp:110
lldb_private::ProcessLaunchInfo
Definition: ProcessLaunchInfo.h:31
lldb_private::platform_linux::PlatformLinux::GetPluginNameStatic
static llvm::StringRef GetPluginNameStatic(bool is_host)
Definition: PlatformLinux.h:28
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::platform_linux::PlatformLinux::GetResumeCountForLaunchInfo
uint32_t GetResumeCountForLaunchInfo(ProcessLaunchInfo &launch_info) override
Definition: PlatformLinux.cpp:157
lldb_private::platform_linux::PlatformLinux
Definition: PlatformLinux.h:17
lldb_private::platform_linux::PlatformLinux::GetPluginDescriptionStatic
static llvm::StringRef GetPluginDescriptionStatic(bool is_host)
Definition: PlatformLinux.cpp:77
lldb_private::platform_linux::PlatformLinux::GetMmapArgumentList
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
Definition: PlatformLinux.cpp:296
uint32_t
lldb_private::platform_linux::PlatformLinux::CanDebugProcess
bool CanDebugProcess() override
Not all platforms will support debugging a process by spawning somehow halted for a debugger (specifi...
Definition: PlatformLinux.cpp:191
lldb_private::platform_linux::PlatformLinux::GetPluginName
llvm::StringRef GetPluginName() override
Definition: PlatformLinux.h:34
lldb_private::platform_linux::PlatformLinux::m_supported_architectures
std::vector< ArchSpec > m_supported_architectures
Definition: PlatformLinux.h:61
lldb_private::platform_linux::PlatformLinux::Terminate
static void Terminate()
Definition: PlatformLinux.cpp:99
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
PlatformPOSIX.h
lldb_private::platform_linux::PlatformLinux::GetDescription
llvm::StringRef GetDescription() override
Definition: PlatformLinux.h:39
lldb_private::Platform::IsHost
bool IsHost() const
Definition: Platform.h:423
lldb_private::platform_linux::PlatformLinux::GetSupportedArchitectures
std::vector< ArchSpec > GetSupportedArchitectures() override
Get the platform's supported architectures in the order in which they should be searched.
Definition: PlatformLinux.cpp:130
lldb_private::Platform::GetHostPlatformName
static const char * GetHostPlatformName()
Definition: Platform.cpp:60
lldb_private::platform_linux::PlatformLinux::Initialize
static void Initialize()
Definition: PlatformLinux.cpp:83
lldb_private::platform_linux::PlatformLinux::GetTrapHandlerUnwindPlan
lldb::UnwindPlanSP GetTrapHandlerUnwindPlan(const llvm::Triple &triple, ConstString name) override
Try to get a specific unwind plan for a named trap handler.
Definition: PlatformLinux.cpp:288
lldb_private::platform_linux::PlatformLinux::CreateInstance
static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch)
Definition: PlatformLinux.cpp:44