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
Copy file name to clipboardexpand all lines: docs/cxx/tutorial/debugging.md
+9-9
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Debugging WebAssembly
2
2
3
-
Effective debugging results in effective programming. **itk-wasm** makes effective debugging of WebAssembly possible.
3
+
Effective debugging results in effective programming. **ITK-Wasm** makes effective debugging of WebAssembly possible.
4
4
5
-
This example walks through the different techniques that can be used with itk-wasm to debug WebAssembly during development.
5
+
This example walks through the different techniques that can be used with ITK-Wasm to debug WebAssembly during development.
6
6
7
7
We will debug the following C++ code:
8
8
@@ -29,7 +29,7 @@ int main() {
29
29
To run these examples, first [install and test](./hello_world) Podman or Docker and Node/NPM. Then, install the package dependencies and run the example commands.
30
30
31
31
```
32
-
cd itk-wasm/examples/Debugging/
32
+
cd ITK-Wasm/examples/Debugging/
33
33
npm install
34
34
npm run <name>
35
35
```
@@ -38,7 +38,7 @@ where `<name>` is the npm script. Available names can be found by calling `npm r
38
38
39
39
## Native
40
40
41
-
The CMake-based itk-wasm build system tooling enables the same C++ build system configuration and code to be reused when building a native system binary or a WebAssembly binary. As a result, native binary debugging tools, such as [GDB](https://sourceware.org/gdb/), [LLDB](https://lldb.llvm.org/), or the [Visual Studio debugger](https://docs.microsoft.com/en-us/visualstudio/debugger/?view=vs-2022).
41
+
The CMake-based ITK-Wasm build system tooling enables the same C++ build system configuration and code to be reused when building a native system binary or a WebAssembly binary. As a result, native binary debugging tools, such as [GDB](https://sourceware.org/gdb/), [LLDB](https://lldb.llvm.org/), or the [Visual Studio debugger](https://docs.microsoft.com/en-us/visualstudio/debugger/?view=vs-2022).
42
42
43
43
We can build the project's standard CMake build configuration,
44
44
@@ -59,13 +59,13 @@ The native binary can then be debugged in the standard way. For example, with `g
59
59
60
60
## WASI
61
61
62
-
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.
62
+
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:
@@ -79,9 +79,9 @@ A full debugging session is also possible after [LLDB](https://lldb.llvm.org/) >
79
79
80
80
## Node.js
81
81
82
-
When debugging WebAssembly built with the itk-wasm Emscripten toolchain, set the `CMAKE_BUILD_TYPE` to `Debug` as is required to debug native builds.
82
+
When debugging WebAssembly built with the ITK-Wasm Emscripten toolchain, set the `CMAKE_BUILD_TYPE` to `Debug` as is required to debug native builds.
83
83
84
-
As with native builds, this builds debugging symbols, the human-readable names of functions, variables, etc., into the binary. This also adds support for C++ exceptions and retrieving the string name associated with exceptions. Without this itk-wasm instrumentation, a C++ exception will through an error with an opaque integer value. And, Emscripten JavaScript WebAssembly bindings will not be minified, which facilitates debugging.
84
+
As with native builds, this builds debugging symbols, the human-readable names of functions, variables, etc., into the binary. This also adds support for C++ exceptions and retrieving the string name associated with exceptions. Without this ITK-Wasm instrumentation, a C++ exception will through an error with an opaque integer value. And, Emscripten JavaScript WebAssembly bindings will not be minified, which facilitates debugging.
85
85
86
86
When built with the default `Release` build type:
87
87
@@ -135,7 +135,7 @@ Next, open the options for Chrome WebAssembly Debugging extension:
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:
138
+
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:
0 commit comments