mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 15:13:46 +00:00
ad337f7f3a
The current gdb patch to support NIX_DEBUG_INFO_DIRS fails if the user attempts to change the debug file directory to a value other than the default. For instance: (gdb) set debug-file-directory /run/booted-system/sw/lib/debug results in: munmap_chunk(): invalid pointer Aborted (core dumped) To fix this issue, the debug_file_directory is allocated with xstrdup so that a subsequent call to xfree will succeed.
16 lines
565 B
Diff
16 lines
565 B
Diff
Initialize debug-file-directory from NIX_DEBUG_INFO_DIRS, a colon-separated list
|
|
of directories with separate debugging information files.
|
|
|
|
--- a/gdb/main.c
|
|
+++ b/gdb/main.c
|
|
@@ -556,3 +556,8 @@ captured_main_1 (struct captured_main_args *context)
|
|
|
|
- debug_file_directory = relocate_gdb_directory (DEBUGDIR,
|
|
+ debug_file_directory = getenv("NIX_DEBUG_INFO_DIRS");
|
|
+
|
|
+ if (debug_file_directory != NULL)
|
|
+ debug_file_directory = xstrdup(debug_file_directory);
|
|
+ else
|
|
+ debug_file_directory = relocate_gdb_directory (DEBUGDIR,
|
|
DEBUGDIR_RELOCATABLE);
|