I’m looking for something like the debuginfod that gdb supports. Essentially I want source+symbols for my project’s dependencies.
I’ve recently learned about enableDebugging
(here) but it seems some packages are requiring an override, and I’m not entirely sure how to accomplish this. I’m probably abusing the design and doing something wrong. The project uses some utilities in llvm and I’d like to have the source+symbols from libLLVM available to gdb. I might extend the inputs list with additional dependencies that I might want debug symbols for.
with import <nixpkgs>{};
clangStdenv.mkDerivation {
packages = [llvm.src];
buildInputs = map enableDebugging [llvm];
name = "clang nix shell";
hardeningDisable = ["all"];
shellHook = "fish";
}
error: attribute 'override' missing
at /nix/store/dzys18by5mkr0ivs2q1bbjd8vbc182kz-nixos-22.11/nixos/pkgs/top-level/all-packages.nix:1082:26:
1081| # intended to be used like nix-build -E 'with import <nixpkgs> {}; enableDebugging fooPackage'
1082| enableDebugging = pkg: pkg.override { stdenv = stdenvAdapters.keepDebugInfo pkg.stdenv; };
| ^
1083|
(use '--show-trace' to show detailed location information)
Any help would be appreciated. I see here that NixOS might be planning to enable this at some point, but I might be mistaken.