#Has anyone managed to get rr (record-and-replay debugger) with raylib?

4 messages · Page 1 of 1 (latest)

sleek ridge
#

Kind of a weird question, but I'm currently working on a game record-and-replay system, and I would like to be able to run the full "play the game a bit, then hit the replay key and replay the whole recorded session until the end" in rr or in gdb.
Then be able to jump in the execution and see the very spot(s) where the execution diverges.

I know it diverges because I have a diff system of the game state that, for now, saves most of the game to compare on replay.

Here is the latest version of my code, using hot-reloadable Odin-lang : https://github.com/duchainer/odin-raylib-hot-reload-game-template/commit/cdffae0034a2f41128a3c08390f63d900fbadaaf

I can debug normally with gdb fine, using :

gdb -i=mi ~/Documents/repos/odin-stuff/odin-raylib-hot-reload-game-template/game_hot_reload.bin

But not with rr , even without -i=mi

rr record ~/Documents/repos/odin-stuff/odin-raylib-hot-reload-game-template/game_hot_reload.bin

It only gives me a rr backtrace if I keep the stdout (see next comment)

And if I redirect the stdout to /dev/null, I don't see my application running either, rr seems to dump the record right away and the record is useless, as far as I understand (see the second next comment)

Thanks in advance for your time 🙂

GitHub

It might very well expose the issue with the sheeps array divergence on
replay frame 2 and onward

#

With $ rr record ~/Documents/repos/odin-stuff/odin-raylib-hot-reload-game-template/game_hot_reload.bin 2>/dev/null

I don't get to run the app, and seem to get a useless recording

#

And in gdb, I can't get to run the record feature correctly neither: