LLDB mainline
PlatformWasm.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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_WASM_PLATFORMWASM_H
10#define LLDB_SOURCE_PLUGINS_PLATFORM_WASM_PLATFORMWASM_H
11
12#include "lldb/Host/Host.h"
13#include "lldb/Host/HostInfo.h"
16
17namespace lldb_private {
18
20public:
21 static void Initialize();
22 static void Terminate();
23
24 static llvm::StringRef GetPluginNameStatic() { return "wasm"; }
25 static llvm::StringRef GetPluginDescriptionStatic();
26
27 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
28 llvm::StringRef GetDescription() override {
30 }
31
33 return HostInfo::GetUserIDResolver();
34 }
35
36 std::vector<ArchSpec>
37 GetSupportedArchitectures(const ArchSpec &process_host_arch) override;
38
40 Debugger &debugger, Target &target,
41 Status &error) override;
42
43 lldb::ProcessSP Attach(ProcessAttachInfo &attach_info, Debugger &debugger,
44 Target *target, Status &status) override;
45
46 Status ConnectRemote(Args &args) override;
47
49
51 lldb::addr_t length, unsigned prot,
52 unsigned flags, lldb::addr_t fd,
53 lldb::addr_t offset) override {
54 return Platform::GetHostPlatform()->GetMmapArgumentList(
55 arch, addr, length, prot, flags, fd, offset);
56 }
57
58private:
59 static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch);
60 static void DebuggerInitialize(Debugger &debugger);
61
62 PlatformWasm() : RemoteAwarePlatform(/*is_host=*/false) {}
63};
64
65} // namespace lldb_private
66
67#endif // LLDB_SOURCE_PLUGINS_PLATFORM_WASM_PLATFORMWASM_H
static llvm::raw_ostream & error(Stream &strm)
An architecture specification class.
Definition ArchSpec.h:31
A command line argument class.
Definition Args.h:33
A class to manage flag bits.
Definition Debugger.h:87
static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch)
lldb::ProcessSP DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger, Target &target, Status &error) override
Subclasses do not need to implement this function as it uses the Platform::LaunchProcess() followed b...
llvm::StringRef GetPluginName() override
Status ConnectRemote(Args &args) override
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
static void DebuggerInitialize(Debugger &debugger)
void CalculateTrapHandlerSymbolNames() override
Ask the Platform subclass to fill in the list of trap handler names.
static llvm::StringRef GetPluginNameStatic()
llvm::StringRef GetDescription() override
lldb::ProcessSP Attach(ProcessAttachInfo &attach_info, Debugger &debugger, Target *target, Status &status) override
Attach to an existing process using a process ID.
UserIDResolver & GetUserIDResolver() override
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.
static llvm::StringRef GetPluginDescriptionStatic()
static lldb::PlatformSP GetHostPlatform()
Get the native host platform plug-in.
Definition Platform.cpp:134
A base class for platforms which automatically want to be able to forward operations to a remote plat...
An error handling class.
Definition Status.h:118
An abstract interface for things that know how to map numeric user/group IDs into names.
A class that represents a running process on the host machine.
llvm::SmallVector< lldb::addr_t, 6 > MmapArgList
Definition Platform.h:64
std::shared_ptr< lldb_private::Platform > PlatformSP
std::shared_ptr< lldb_private::Process > ProcessSP
uint64_t addr_t
Definition lldb-types.h:80