https://github.com/JDevlieghere created https://github.com/llvm/llvm-project/pull/196368
Call `EnsureConnected` in the `PlatformWebInspectorWasm` ctor so the platform reports being connected after selecting in. The lazy approach resulted in confusion due to the "Connected: no" in the `platform select` output: ``` (lldb) platform select webinspector-wasm Platform: webinspector-wasm Connected: no ``` >From 6d3bf2237f524b358237610b02a03fabad657094 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere <[email protected]> Date: Thu, 7 May 2026 09:50:20 -0700 Subject: [PATCH] [lldb] Immediately connect in webinspector-wasm Call EnsureConnected in the PlatformWebInspectorWasm so the platform reports being connected after selecting in. The lazy approach resulted in confusion due to the "Connected: no" in the platform select output: ``` (lldb) platform select webinspector-wasm Platform: webinspector-wasm Connected: no ``` --- .../Platform/WebAssembly/PlatformWebInspectorWasm.cpp | 7 +++++++ .../Platform/WebAssembly/PlatformWebInspectorWasm.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lldb/source/Plugins/Platform/WebAssembly/PlatformWebInspectorWasm.cpp b/lldb/source/Plugins/Platform/WebAssembly/PlatformWebInspectorWasm.cpp index fc60a98f46862..c23647f204692 100644 --- a/lldb/source/Plugins/Platform/WebAssembly/PlatformWebInspectorWasm.cpp +++ b/lldb/source/Plugins/Platform/WebAssembly/PlatformWebInspectorWasm.cpp @@ -30,6 +30,13 @@ static constexpr llvm::StringLiteral kServerBinary = static constexpr uint8_t kConnectAttempts = 5; static constexpr auto kConnectDelay = std::chrono::milliseconds(100); +PlatformWebInspectorWasm::PlatformWebInspectorWasm() { + if (llvm::Error err = EnsureConnected()) { + LLDB_LOG_ERROR(GetLog(LLDBLog::Platform), std::move(err), + "EnsureConnected failed: {0}"); + } +} + llvm::StringRef PlatformWebInspectorWasm::GetPluginDescriptionStatic() { return "Platform for debugging Wasm via WebInspector"; } diff --git a/lldb/source/Plugins/Platform/WebAssembly/PlatformWebInspectorWasm.h b/lldb/source/Plugins/Platform/WebAssembly/PlatformWebInspectorWasm.h index 52286b4532ebc..d20308ecfb2f7 100644 --- a/lldb/source/Plugins/Platform/WebAssembly/PlatformWebInspectorWasm.h +++ b/lldb/source/Plugins/Platform/WebAssembly/PlatformWebInspectorWasm.h @@ -45,7 +45,7 @@ class PlatformWebInspectorWasm : public PlatformWasm { private: static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch); - PlatformWebInspectorWasm() = default; + PlatformWebInspectorWasm(); llvm::Error LaunchPlatformServer(); llvm::Error EnsureConnected(); _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
