2020-02-10 13:52:49 +00:00
|
|
|
diff -ur a/gdb/main.c b/gdb/main.c
|
|
|
|
--- a/gdb/main.c 2020-02-08 13:50:14.000000000 +0100
|
|
|
|
+++ b/gdb/main.c 2020-02-24 10:02:07.731806739 +0100
|
|
|
|
@@ -567,9 +567,17 @@
|
|
|
|
gdb_sysroot = xstrdup (TARGET_SYSROOT_PREFIX);
|
|
|
|
}
|
2017-07-28 12:51:27 +01:00
|
|
|
|
2020-02-10 13:52:49 +00:00
|
|
|
- debug_file_directory
|
|
|
|
- = xstrdup (relocate_gdb_directory (DEBUGDIR,
|
|
|
|
- DEBUGDIR_RELOCATABLE).c_str ());
|
|
|
|
+ debug_file_directory = getenv ("NIX_DEBUG_INFO_DIRS");
|
2020-02-25 01:18:09 +00:00
|
|
|
+ if (debug_file_directory != NULL)
|
2020-02-10 13:52:49 +00:00
|
|
|
+ // This might be updated later using
|
|
|
|
+ // $ set debug-file-directory /to/some/path
|
|
|
|
+ // which will use xfree. We must then have a xmallocated
|
|
|
|
+ // copy of the string that can be xfeed later.
|
|
|
|
+ debug_file_directory = xstrdup (debug_file_directory);
|
2020-02-25 01:18:09 +00:00
|
|
|
+ else
|
2020-02-10 13:52:49 +00:00
|
|
|
+ debug_file_directory
|
|
|
|
+ = xstrdup (relocate_gdb_directory (DEBUGDIR,
|
|
|
|
+ DEBUGDIR_RELOCATABLE).c_str ());
|
|
|
|
|
|
|
|
gdb_datadir = relocate_gdb_directory (GDB_DATADIR,
|
|
|
|
GDB_DATADIR_RELOCATABLE);
|