o
odinpkg.dev
packages / library / frigg

frigg

256024flibrary

Memory explorer for the odin language

No license · updated 3 months ago

Frigg

Frigg is a kind of memory viewer software-in-a-library for the Odin programming language.

Give the library a value; it will open a window. Use the arrow keys to browse the associated memory values.

Running the demo:
Demo

Usage

Download frigg and add it as a library in your project:

cd your_project
git clone https://github.com/Up05/frigg

Watch a variable and pause your program:

import "frigg"

main :: proc() {
    almost_anything: ??? 
    frigg.watch(almost_anything, pause_program = true)
}

Or watch a variable and keep on keeping on:

import "frigg"

main :: proc() {
    almost_anything: ??? // except soa pointers

    frigg.watch(almost_anything, pause_program = false)

    for {
        // update almost_anything...

        if !frigg.render_frame_for_all() do break
    }

}

There are also other functions for setting multi-pointer length, ignoring stuff and, I guess, formatting values

Keyboard Shortcuts

S is Shift, C is Ctrl

Arrow keys can be used as alternative keybindings.

S Tab       ↑  go to line above
Tab         ↓  go to line below
C Enter   C →  go to value & make window
Enter       →  go to value
Backspace   ←  go back          

Small value format

Printing of small values is designed to be obvious and short, but there are some weirder cases:

..          skipping elements
..<LEN      skipping and here is the entire length
[:NUM]      the array is sliced via frigg.link(array, &new_max_length)
[0*LEN]     the array is filled with zeroes (surprisingly common)
(TYPE)      union's active variant
<self>      a pointer to a pointer to a... 16+ times over

Compatibility

Platforms Status
Linux (Xorg) Works
Linux (Wayland) Works (except for GLFW problems)
Windows Works (mostly) (no memory safety checks)
MacOS, etc... I don't know
Raylib (user-side) Raylib itself doesn't render (maybe it does not MakeContextCurrent)
SDL2 (user-side) Messed up font textures in frigg