Debugging in the browser: gdb-wui
gdb-wui is a web UI for GDB: source,
disassembly, variables, registers, memory, threads and a gdb console in one window, with gdb itself
doing the debugging. On both sites an image runs it inside the emulated machine, next to the
console: gdb and gdb-wui run in the guest, and the page carries gdb-wui's HTTP and WebSocket
traffic over v86's virtual network, so nothing leaves your browser.
Its example programs are in /root/demo: pick one, click Run→main and step. Or start
gdbserver :1234 /root/demo/hello & on the console and click connect in
gdb-wui's console bar to debug it remotely.
Its Decompiled view works with no Ghidra in the guest: the example programs and the stripped
/bin/busybox were decompiled by Ghidra when the image was built, and a picker
switches to kuna, Ghidra's decompiler ported to
Rust, which the page runs as WebAssembly beside the emulator and gdb-wui asks over the virtual
network — for any program in the guest. gdb-wui is made for a desktop browser.
It debugs the microcontrollers' firmware too. Add &debug to a CH32V003 page
(Tetris or a game console game): the microcontroller is held at reset, and the page boots the
riscv64 gdb-wui image beside it with the firmware's ELF and sources. The emulated core has a GDB
stub, which the page offers on the guest's network as a debug probe would, so gdb in the guest
connects with target remote: breakpoints in flash, stepping through the C source,
registers, memory and monitor reset halt, while the display keeps drawing.