16#include "llvm/ADT/StringExtras.h"
17#include "llvm/Support/ErrorExtras.h"
29 "/System/Cryptexes/App/usr/libexec/webinspector-wasm-lldb-platform";
34 return "Platform for debugging Wasm via WebInspector";
50 LLDB_LOG(log,
"force = {0}, arch = ({1}, {2})", force,
52 arch ? arch->
GetTriple().getTriple() :
"<null>");
65 return llvm::createStringErrorV(
"platform binary not found: {0}",
70 if (!expected_platform_port)
71 return expected_platform_port.takeError();
72 uint16_t platform_port = *expected_platform_port;
75 if (!expected_debugserver_port)
76 return expected_debugserver_port.takeError();
77 uint16_t debugserver_port = *expected_debugserver_port;
95 "Platform exited: pid = {0}, signal = "
104 return status.takeError();
111 llvm::formatv(
"connect://localhost:{0}", platform_port).str());
116 if (status.Success())
117 return llvm::Error::success();
121 "[{0}/{1}] platform not yet listening on port {2}: trying again in {3}",
125 return status.takeError();
130 return llvm::Error::success();
154 "EnsureConnected failed: {0}");
164 "EnsureConnected failed: {0}");
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
#define LLDB_LOG_ERROR(log, error,...)
#define LLDB_PLUGIN_DEFINE(PluginName)
An architecture specification class.
llvm::Triple & GetTriple()
Architecture triple accessor.
const char * GetArchitectureName() const
Returns a static string representing the current architecture.
A command line argument class.
size_t GetArgumentCount() const
Gets the number of arguments left in this command object.
void AppendArgument(llvm::StringRef arg_str, char quote_char='\0')
Appends a new argument to the end of the list argument list.
A class to manage flag bits.
static FileSystem & Instance()
ValueType Clear(ValueType mask=~static_cast< ValueType >(0))
Clear one or more flags.
static Status LaunchProcess(ProcessLaunchInfo &launch_info)
Launch the process specified in launch_info.
static void Kill(lldb::pid_t pid, int signo)
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
void SetExecutableFile(const FileSpec &exe_file, bool add_exe_file_as_first_arg)
lldb::pid_t GetProcessID() const
void SetArguments(const Args &args, bool first_arg_is_executable)
void SetMonitorProcessCallback(Host::MonitorChildProcessCallback callback)
void SetLaunchInSeparateProcessGroup(bool separate)
bool Fail() const
Test for error condition.
static Status static Status FromErrorStringWithFormatv(const char *format, Args &&...args)
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
#define LLDB_INVALID_PROCESS_ID
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
std::vector< ProcessInstanceInfo > ProcessInstanceInfoList
std::shared_ptr< lldb_private::Platform > PlatformSP
std::shared_ptr< lldb_private::Process > ProcessSP