From e636e0a5329f546ebcc603d56bb99a0d016370f8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 17 Sep 2015 15:45:10 +0200 Subject: [PATCH] gdb: Look for debug info in /run/current-system/sw/lib/debug The previous default was $out/lib/debug, which wasn't very useful. This ensures that you can do environment.systemPackages = [ pkgs.hello.debug ]; to install debug info. --- nixos/modules/config/system-path.nix | 3 ++- pkgs/development/tools/misc/gdb/default.nix | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix index 3241780a3a71..748ada99be69 100644 --- a/nixos/modules/config/system-path.nix +++ b/nixos/modules/config/system-path.nix @@ -103,7 +103,8 @@ in [ "/bin" "/etc/xdg" "/info" - "/lib" + "/lib" # FIXME: remove + #"/lib/debug/.build-id" # enables GDB to find separated debug info "/man" "/sbin" "/share/applications" diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix index d50822d49491..ee7f0595a1fd 100644 --- a/pkgs/development/tools/misc/gdb/default.nix +++ b/pkgs/development/tools/misc/gdb/default.nix @@ -44,6 +44,7 @@ stdenv.mkDerivation rec { configureFlags = with stdenv.lib; '' --with-gmp=${gmp} --with-mpfr=${mpfr} --with-system-readline --with-expat --with-libexpat-prefix=${expat} + --with-separate-debug-dir=/run/current-system/sw/lib/debug '' + optionalString (target != null) " --target=${target.config}" + optionalString (elem stdenv.system platforms.cygwin) " --without-python";