Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 953faee9f74d5acf8f87ec419a4217503715eefe
      
https://github.com/WebKit/WebKit/commit/953faee9f74d5acf8f87ec419a4217503715eefe
  Author: Yijia Huang <[email protected]>
  Date:   2026-04-15 (Wed, 15 Apr 2026)

  Changed paths:
    M Source/JavaScriptCore/wasm/debugger/RWI_ARCHITECTURE.md
    M Source/JavaScriptCore/wasm/debugger/WasmDebugServer.cpp
    M Source/JavaScriptCore/wasm/debugger/WasmDebugServer.h
    M Source/JavaScriptCore/wasm/debugger/tests/ExecutionHandlerTestSupport.cpp
    M Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
    M Source/WebKit/UIProcess/Inspector/WasmDebuggerDebuggable.cpp
    M Source/WebKit/UIProcess/WebProcessPool.cpp
    M Source/WebKit/UIProcess/WebProcessPool.h
    M Source/WebKit/UIProcess/WebProcessProxy.cpp
    M Source/WebKit/UIProcess/WebProcessProxy.h
    M Source/WebKit/UIProcess/WebProcessProxy.messages.in
    M Source/WebKit/WebProcess/Inspector/WasmDebuggerDispatcher.cpp
    M Source/WebKit/WebProcess/Inspector/WasmDebuggerDispatcher.h
    M Source/WebKit/WebProcess/Inspector/WasmDebuggerDispatcher.messages.in
    M Source/WebKit/WebProcess/WebProcess.cpp

  Log Message:
  -----------
  [JSC][WASM][Debugger] Fix WasmDebugger RWI lifecycle: init ordering, cache 
handling, and process exit
https://bugs.webkit.org/show_bug.cgi?id=312094
rdar://174599638

Reviewed by Devin Rousso and BJ Burg.

Init ordering fix: WasmDebuggerDebuggable was created in didFinishLaunching()
before startRWI() was called, so early LLDB packets could arrive before the
debug server was ready. Fix by introducing a WasmDebugServerReady IPC sent
from WebContent after startRWI() succeeds. The UIProcess creates the debuggable
only in wasmDebugServerReady(), guaranteeing the debug server is initialized
before LLDB can attach.

Process cache improvement: Previously nothing happened on cache entry or exit,
leaving the debuggable alive when the process was cached (LLDB stayed attached
to an idle process) and never recreating it on cache reuse. Now on cache entry
the debuggable is destroyed and a ResetServer IPC is dispatched to the
WasmDebuggerDispatcher WorkQueue — which runs independently of the mutator —
to cleanly reset server state. On cache exit, WebContent resends 
WasmDebugServerReady
so the UIProcess recreates the debuggable for the new navigation.

Process exit fix: destroyWasmDebuggerTarget() is now called before 
shutDownProcess()
in shutDown() so LLDB is notified via RemoteInspector and detaches cleanly 
before
the WebContent process is killed.

Make DebugServer::reset() public so WasmDebuggerDispatcher can call it directly.
Change DebugServer::startRWI() to return void since it always succeeds.
Remove m_createWasmDebuggerDebuggable and move the enableWebAssemblyDebugger
parameter from WebProcessProxy::create() into initializeNewWebProcess(), since
debuggable creation is now driven by WasmDebugServerReady rather than launch.

Add a complete Component Lifecycle section to RWI_ARCHITECTURE.md.

Canonical link: https://commits.webkit.org/311292@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to