I was told to post this here, my apologies if not relevant. This was my summer project this year (I’m a 3rd year undergrad). I also wanted to include more pictures, but I got an error saying I can only have 1 because I’m a new user.
ghc-debug-web is like ghc-debug-brick but on the web, with graphic visualisations of the heap. Like ghc-debug-brick, you can instrument a debuggee with GHC.Debug.Stub, and then look at the memory layout.
The layout of the main page is similar to ghc-debug-brick. Instead of using keyboard commands to change modes, you can click on the bar up top, and instead of navigating the object trees with the keyboard, you can use the mouse.
Here is a demonstration of the visualisation. The debuggee is a simple tree balancing program, so that the shared memory structure can be seen in the visualisation. Note the shared children across nodes. The root node of the structure is rendered yellow.
Since GC Root objects can be very large, the graph is usually compressed, denoted by the green nodes. Clicking a green node will expand its children. A compressed root node appears in a lighter shade of green to show that it is both the root, and compressed.
The selection page also includes eventlog2html, so that if the debuggee is compiled with -prof and run with -l/-l-agu, the eventlog file can be uploaded and visualised in the browser.
To try it for yourself, the repo is here: GitHub - KC1423/ghc-debug-web . It’s not without it’s problems, so if I’ve missed out something or something needs explaining, just ask.




