1--- a/gdb/main.c
2+++ b/gdb/main.c
3@@ -708,8 +708,12 @@ captured_main_1 (struct captured_main_args *context)
4 if (gdb_sysroot.empty ())
5 gdb_sysroot = TARGET_SYSROOT_PREFIX;
6
7- debug_file_directory
8- = relocate_gdb_directory (DEBUGDIR, DEBUGDIR_RELOCATABLE);
9+ const char * nix_debug = getenv ("NIX_DEBUG_INFO_DIRS");
10+ if (nix_debug != NULL)
11+ debug_file_directory = nix_debug;
12+ else
13+ debug_file_directory
14+ = relocate_gdb_directory (DEBUGDIR, DEBUGDIR_RELOCATABLE);
15
16 gdb_datadir = relocate_gdb_directory (GDB_DATADIR,
17 GDB_DATADIR_RELOCATABLE);