Zig RAD Debugger interface library

Zig RAD Debugger interface library


After getting nerd sniped in RadDebugger and Zig - #3 by lassade I decided to make a Zig library with the capabilities of raddbg_markup.h.

This allow you to things such as

comptime {
    raddbg.typeView(
        Interner,
        "rows($, " ++
            "strings = storedStrings.size, " ++
            "holes = slots.items.len, " ++
            "bytes_used = storage.items.len, " ++
            "bytes_allocated = storage.capacity, " ++
            "storage = memory(storage.items.ptr, storage.items.len), " ++
            "slots, storedStrings, slotMergeThreshold)",
    );
}

So that when you are debugging you can see more meaningful information as fast as possible.

There is still much to do, since I am on linux I have not verified it works on windows (beyond cross compiling and checking the section is present in the binary).
and there is still functionality that I have yet to implement like setting thread name / colour, adding and removing breakpoints in the debugger programmatically, etc.
But it is functional enough for now.

Also of note, since linux support is still experimental for RAD Debugger (you have to build it yourself, it’s pretty easy though) I had to work around some bugs, such as it does not read the views from the elf file, so I had to make a small program that you can use at build time that uses Zig’s built in objcopy to get the section and write it out to the project file format.

Supported Zig versions

0.17.0

6 Likes