I’m working on a package for the nixpkgs master branch that segfaults inside libstdc++. I have a hard time to figure out how to get all the debug symbols I need to run gdb.
If I understand it correctly environment.enableDebugInfo = true only applies to packages installed in context of the NixOS system derivation.
How do I get the debug symbols for dependencies of packages build with nix-build and - if possible - configure the environment so that gdb can find them automatically?
I think this only enables debug symbols for the package in question, but I need the debug symbols of its dependencies (esp. libstdc++ from the gcc package in this case).
If I understand it correctly environment.enableDebugInfo = true in the NixOS config installs the debug symbols for all packages that use separateDebugInfo and sets up the environment so that gdb can find them.
My problem is, that my NixOS system channel is different from the channel I develop against (due to the bug in question only happening when compiling on the master branch). The libstdc++ is therefore different for the package I want to debug.
Therefore neither are the debug symbols installed, nor would the environment variables be set to include them. I guess I could fetch the debug symbols manually and call gdb with them myself, but is there a better, automatic way to do this?