Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for breakpoint debugging (#371 / EW-7264)
This change places the InspectorService in a separate thread that manages communication with over the websocket to the inspector. The change also adds support for runMessageLoopOnPause() and quitMessageLoopOnPause() to support breakpoints and debugger break statements. There is also refactoring of the CDP message handling code so it can be called with or without the isolate lock held. This requires workerd to run with the command-line flag -i to turn on inspector support. This change only works for single service configurations. Support for multi service configurations to follow. To try this out using samples/helloworld as an example: 1) Edit "samples/helloworld/worker.js" and add a debugger statement to the handle(request) method. 2) Open workerd in VSCode, select 'workerd with inspector enabled (dbg)' as the Run and Debug Target panel. Hit F5 to run and select `samples/helloworld/config.capnp` as the config to use. 3) Open devtools in Chrome using either: * https://devtools.devprod.cloudflare.dev/js_app?ws=localhost:9229/main * chrome:://inspect 4) On the command-line run, `curl http://localhost:8080/` 5) Devtools should break into the running worker. Bug: #371 Test: manual Test: existing internal ew tests do not break
- Loading branch information