mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-24 20:02:58 +03:00
Add a setup hook to fill NIX_DEBUG_INFO_DIRS
This setup hook is propagated by gdb. Thus, a typical use is: $ nix-shell -p gdb nix nix.debug sqlite.debug ... and gdb will be able find the debug symbols of nix etc. automatically.
This commit is contained in:
parent
5b09152898
commit
5c5b71df5e
5
pkgs/build-support/setup-hooks/setup-debug-info-dirs.sh
Normal file
5
pkgs/build-support/setup-hooks/setup-debug-info-dirs.sh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
setupDebugInfoDirs () {
|
||||||
|
addToSearchPath NIX_DEBUG_INFO_DIRS $1/lib/debug
|
||||||
|
}
|
||||||
|
|
||||||
|
envHooks+=(setupDebugInfoDirs)
|
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
# Additional dependencies for GNU/Hurd.
|
# Additional dependencies for GNU/Hurd.
|
||||||
, mig ? null, hurd ? null
|
, mig ? null, hurd ? null
|
||||||
|
|
||||||
|
, setupDebugInfoDirs
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
@ -34,7 +36,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
patches = [ ./debug-info-from-env.patch ];
|
patches = [ ./debug-info-from-env.patch ];
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig texinfo perl ]
|
nativeBuildInputs = [ pkgconfig texinfo perl setupDebugInfoDirs ]
|
||||||
# TODO(@Ericson2314) not sure if should be host or target
|
# TODO(@Ericson2314) not sure if should be host or target
|
||||||
++ stdenv.lib.optional targetPlatform.isHurd mig;
|
++ stdenv.lib.optional targetPlatform.isHurd mig;
|
||||||
|
|
||||||
@ -43,6 +45,8 @@ stdenv.mkDerivation rec {
|
|||||||
++ stdenv.lib.optional targetPlatform.isHurd hurd
|
++ stdenv.lib.optional targetPlatform.isHurd hurd
|
||||||
++ stdenv.lib.optional doCheck dejagnu;
|
++ stdenv.lib.optional doCheck dejagnu;
|
||||||
|
|
||||||
|
propagatedNativeBuildInputs = [ setupDebugInfoDirs ];
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
# darwin build fails with format hardening since v7.12
|
# darwin build fails with format hardening since v7.12
|
||||||
|
@ -347,6 +347,8 @@ with pkgs;
|
|||||||
|
|
||||||
separateDebugInfo = makeSetupHook { } ../build-support/setup-hooks/separate-debug-info.sh;
|
separateDebugInfo = makeSetupHook { } ../build-support/setup-hooks/separate-debug-info.sh;
|
||||||
|
|
||||||
|
setupDebugInfoDirs = makeSetupHook { } ../build-support/setup-hooks/setup-debug-info-dirs.sh;
|
||||||
|
|
||||||
useOldCXXAbi = makeSetupHook { } ../build-support/setup-hooks/use-old-cxx-abi.sh;
|
useOldCXXAbi = makeSetupHook { } ../build-support/setup-hooks/use-old-cxx-abi.sh;
|
||||||
|
|
||||||
iconConvTools = callPackage ../build-support/icon-conv-tools {};
|
iconConvTools = callPackage ../build-support/icon-conv-tools {};
|
||||||
|
Loading…
Reference in New Issue
Block a user