Page 1 of 1

A browser-based debugger

Posted: Thu Oct 12, 2017 2:32 am
by devan
Hi everyone,
I thought I would share my latest project, a toy debugger that works with ST-Links and runs entirely from within your browser (assuming your browser is Chrome, version 61 or newer).

It has some basic functionality that you would expect from a debugger:
  • Reading CPU registers
  • Reading from memory
  • Run/halt/single-step
  • Write/erase flash memory (only tested on STM32F103)
  • Displaying redirected printf() output
It is, however, missing a lot of features that you might expect from a debugger:
  • Setting break points
  • Seeing what line of code you're on
  • Viewing disassembly for the current code being executed
As such, it's not really usable as a replacement for gdb or Visual Studio or your favorite debugger, but it does show the potential for building true debugger capabilities into online IDEs like mbed or Arduino Create. For me, it's mostly been an exercise to learn more about how embedded debuggers work.

If anyone wants to try it out, I have a live demo online which I hope is fairly self-explanatory:

I've tested it successfully on Windows, Linux, and Android with both an ST-Link/v2 clone + bluepill and with an STM32F103RB Nucleo board.
I'm hopeful that nobody will need to use Zadig to replace the ST-Link drivers, but my Windows desktop has such a mess of drivers that I can no longer tell which drivers are the original ones.

Note: it may get stuck if you connect to an ST-Link/v2 with no target microcontroller connected.

Re: A browser-based debugger

Posted: Thu Oct 12, 2017 8:16 am
by stevestrong

thanks for sharing, it is very nice and promising project, which I would use if your latest missing features would be included.

Maybe it would make sense to combine this with the other project currently developed based on Java by Vassilis ( He managed to get source code display.

Next step would be to combine this with a nice browser based code editor (like this:, and Arduino build facility.

Re: A browser-based debugger

Posted: Fri Oct 13, 2017 7:24 pm
by Vassilis
Very nice but the above debugger looks like the ST's STM32 ST-LINK Utility. There is no source code display :(

Re: A browser-based debugger

Posted: Fri Oct 13, 2017 8:32 pm
by devan
Yeah, unfortunately it's pretty hard to do source code display without having access to the local filesystem. Ideally, it would be integrated with some cloud IDE where it would have full access to the source. Otherwise the user would have to upload a copy of their entire source repo (and any libraries it depends upon).

For the time being, I think I'll focus on features that don't depend on having the full source code.
  • Adding a disassembly view using capstone.js
  • Parsing elf files to get basic addr2line functionality and local/global variable locations