|
23 | 23 | //! extensions. See the [`self::addr`] submodule for utilities to encode and |
24 | 24 | //! decode these synthesized addresses. |
25 | 25 | //! |
26 | | -//! [`Wasm`]: gdbstub::target::ext::wasm::Wasm |
| 26 | +//! To use GDB RSP with these extensions implemented by LLDB: |
| 27 | +//! |
| 28 | +//! 1. Implement the `Target` trait and the [`Wasm`], [`HostInfo`] and |
| 29 | +//! [`ProcessInfo`] traits on the target implementation for your Wasm |
| 30 | +//! execution engine/target. |
| 31 | +//! 2. Make use of this `Arch` implementation in your target. |
| 32 | +//! 3. Make use of the [`report_stop_with_regs`] API to report the Wasm PC with |
| 33 | +//! every stop packet. |
| 34 | +//! 4. Ensure that you have a build of LLDB with the Wasm target enabled. (A |
| 35 | +//! binary distribution of LLDB with your operating system may not have this, |
| 36 | +//! but a build from LLVM source will, by default. Once a release of |
| 37 | +//! [`wasi-sdk`] with [this PR] is made, `wasi-sdk` will distribute such a |
| 38 | +//! build for all major platforms.) |
| 39 | +//! 5. Start up LLDB and attach it to an endpoint served by `gdbstub` with this |
| 40 | +//! target: |
| 41 | +//! |
| 42 | +//! $ .../bin/lldb |
| 43 | +//! (lldb) process connect --plugin wasm connect://localhost:1234 |
| 44 | +//! |
| 45 | +//! then ordinary debugging with breakpoints, step/continue, and state |
| 46 | +//! examination should work. |
| 47 | +//! |
| 48 | +//! See [Wasmtime] for an example of the use of this crate. |
| 49 | +//! |
27 | 50 | //! [LLDB-specific Wasm extensions]: |
28 | 51 | //! https://lldb.llvm.org/resources/lldbgdbremote.html#wasm-packets |
| 52 | +//! [`Wasm`]: gdbstub::target::ext::wasm::Wasm |
| 53 | +//! [`HostInfo`]: gdbstub::target::ext::host_info::HostInfo |
| 54 | +//! [`ProcessInfo`]: gdbstub::target::ext::process_info::ProcessInfo |
| 55 | +//! [`report_stop_with_regs`]: |
| 56 | +//! gdbstub::stub::state_machine::GdbStubStateMachineInner::report_stop_with_regs |
| 57 | +//! [`wasi-sdk`]: https://github.com/WebAssembly/wasi-sdk |
| 58 | +//! [this PR]: https://github.com/WebAssembly/wasi-sdk/pull/596 |
| 59 | +//! [Wasmtime]: https://github.com/bytecodealliance/wasmtime |
29 | 60 |
|
30 | 61 | use gdbstub::arch::Arch; |
31 | 62 |
|
|
0 commit comments