BabelBridge: A Control-Flow Graph Debugger for Microcontrollers
In this talk, we present our work on debugging WebAssembly (Wasm) applications running on microcontrollers (MCUs). Traditionally, MCUs have been programmed using languages like C/C++, compiled directly to native MCU code. With the advent of Wasm virtual machines (VMs) tailored for MCUs, a broader range of programming languages can now target these devices. However, existing Wasm debuggers often fall short: they are either not truly language-agnostic or are not designed to account for the characteristics of MCUs, such as handling interrupts.
In a submitted work, we explored the use of control-flow graphs (CFGs) to enable language-agnostic debugging of Wasm programs. We developed BabelBridge, a CFG-based language-agnostic debugger prototype and integrated it into a Visual Studio Code extension built for WARDuino, a Wasm VM for MCUs. In this demo, we show how BabelBridge identifies and resolves a concurrency bug representative of those found in real-world MCU applications. To demonstrate BabelBridge’s language-agnostic capability, we implement the same application in four different programming languages (i.e., C, Zig, Rust, and AssemblyScript) that compile to Wasm, and show how BabelBridge seamlessly supports each implementation without requiring any modification. We also showcase how CFGs enable both standard debugging operations (e.g., step into, step over, step out), uncommon operations (e.g., step to the next loop iteration), and MCU-specific operations (e.g., automatic pausing on interrupt handlers). Finally, we compare BabelBridge to WARDuino’s current debugger to highlight the advantages of CFG-based debugging, including significantly faster debugging operations.