Compile static gdbserver
for MIPS with Nix
I’ve tested the following instructions using GDB 15.2 and NixOS 24.11.
About gdbserver
When you run GDB to debug a process, two things happen:
- GDB starts or attaches to a process that you want to debug.
- GDB provides you a user interface so that you can control and inspect that process.
The GDB user interface itself typically runs on your own machine.
You can start or attach to processes even outside of your own machine.
GDB provides a program called gdbserver
for this task. gdbserver
manages
process execution without providing a user interface itself. GDB
then attaches to gdbserver
over the network using a TCP socket.