You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The most direct way to debug WebAssembly is through the [WebAssembly System Interface (WASI)](https://wasi.dev/). In itk-wasm we can build to WASI with the [WASI SDK](https://github.com/WebAssembly/wasi-sdk) by specifying the `itkwasm/wasi` toolchain image. A backtrace can quickly be obtained with the `itk-wasm` CLI. Or, a fully fledged debugger session can be started with LLDB.
63
63
64
64
First, build to WASI WebAssembly with debugging symbols available:
**Note:** when calling `wasmtime` directly and passing local files into a pipeline, `--dir` arguments must be set. This gives `wasmtime` permission to access the directories containing the files. This is required due to WASI's [capability-based security](https://en.wikipedia.org/wiki/Capability-based_security) model. For example, if a file path starts with `./`, then add `--dir ./` arguments to the `wasmtime` invocation. `--dir` can be specified multiple times.
79
79
@@ -85,31 +85,31 @@ As with native builds, this builds debugging symbols, the human-readable names o
This will pause execution on start a debugging remote interface. To connect to the remote interface with a Chromium browser, visit `chrome://inspect` and click the *inspect* link on the corresponding *Remote Target*:
Other debugger interfaces [are also available](https://nodejs.org/en/docs/inspector), like a CLI debugger or the VSCode debugger.
115
115
@@ -127,21 +127,21 @@ Next, enable it in DevTools.
127
127
128
128
Open DevTools -> Click the *gear (⚙)* icon in the top right corner -> go to the *Experiments* panel -> and tick *WebAssembly Debugging: Enable DWARF support*.
Since itk-wasm performs builds in a clean Docker environment, the debugging source paths in the Docker environment are different than the paths on the host system. The debugging extension has a path substitution system that can account for these differences. In the Docker image, the directory where `itk-wasm` is invoked is mounted as `/work`. Substitute `/work` with the directory where the `itk-wasm` CLI is invoked. For example, if `itk-wasm` was invoked at `/home/matt/src/itk-wasm/examples/Debugging`, then:
# See docs at: https://mystmd.org/guide/frontmatter
2
+
version: 1
3
+
project:
4
+
id: 823d8bd8-d894-408c-bd81-bca17930fb73
5
+
title: "ITK-Wasm documentation"
6
+
subtitle: "Universal spatial analysis and visualization."
7
+
short_title: "ITK-Wasm"
8
+
description: "ITK-Wasm combines ITK and WebAssembly to enable high-performance spatial analysis in a web browser or system-level environments and reproducible execution across programming languages and hardware architectures."
0 commit comments