Saturday, May 3, 2025

Working with debug symbols on Fedora etc.

When installing Golf from a package using a package repository like COPR (for Fedora, Redhat, Rocky, Mageia, Amazon Linux etc.), such as like this:

sudo dnf -y install epel-release
sudo dnf -y copr enable golf-lang/golf-lang
sudo dnf -y install golf

then in order to be able to use gdb and step through Golf itself in gdb, you can obtain the debug package and Golf sources.

To get the dnf debug package:

sudo dnf install golf-debuginfo golf-debugsource

gdb will now know how to use both the debug info and the source code. In case somehow that doesn't work, in gdb use "set debug-file-directory /usr/lib/debug/usr/lib/golf" and "directory /usr/src/debug/golf-..." to point to debug files and source code.

This is how you can use gdb with Golf even if you didn't install from source. Of course, installing from source makes it easy, but then you won't have package management, if that matters to you.

And finally, this process is true for any dnf package, not just Golf.