Quick setup instructions for building the code from Sy Brand's Building a Debugger on a machine with a working Nix installation. (There are many other perfectly good ways to get set up; if you don't already have Nix you might prefer to do something else.)
For Recursers, you can get to a machine with Nix by configuring your SSH key, waiting an hour or two, and doing ssh broome.cluster.recurse.com.
The author's worked source code is available on GitHub, so if you want to start partway through the book, do e.g.
git clone https://github.com/TartanLlama/sdb -b chapter-8
cd sdbOr just start in chapter 1. Then create the following file as shell.nix:
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.05";
in
with import nixpkgs {};
mkShell {
packages = [
cmake
vcpkg
];
shellHook = ''
export CMAKE_TOOLCHAIN_FILE=${vcpkg}/share/vcpkg/scripts/buildsystems/vcpkg.cmake
'';
}Then run
nix-shell
mkdir build
cd build
cmake ..
cmake --build .and now you can e.g.
tools/sdb cat