1e0384829d
Also fix tests.
42 lines
1.3 KiB
Diff
42 lines
1.3 KiB
Diff
From a3b7510e4c9e7201a4301f2a45d8569b06354607 Mon Sep 17 00:00:00 2001
|
||
From: Jan Tojnar <jtojnar@gmail.com>
|
||
Date: Sat, 24 Dec 2022 20:30:22 +0100
|
||
Subject: [PATCH 4/4] libbacktrace: Support NIX_DEBUG_INFO_DIRS environment
|
||
variable
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=UTF-8
|
||
Content-Transfer-Encoding: 8bit
|
||
|
||
Let’s make debug data lookup work on NixOS just like in gdb.
|
||
---
|
||
elf.c | 11 +++++++++--
|
||
1 file changed, 9 insertions(+), 2 deletions(-)
|
||
|
||
diff --git a/elf.c b/elf.c
|
||
index 65c647a..5c8abc0 100644
|
||
--- a/elf.c
|
||
+++ b/elf.c
|
||
@@ -6935,11 +6935,18 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor,
|
||
|
||
if (buildid_data != NULL)
|
||
{
|
||
+ const char *debug_directories_immutable;
|
||
+ const char *nix_debug = getenv ("NIX_DEBUG_INFO_DIRS");
|
||
+ if (nix_debug != NULL)
|
||
+ debug_directories_immutable = nix_debug;
|
||
+ else
|
||
+ debug_directories_immutable = SYSTEM_DEBUG_DIR;
|
||
+
|
||
int d;
|
||
- char debug_directories[strlen(SYSTEM_DEBUG_DIR) + 1];
|
||
+ char debug_directories[strlen(debug_directories_immutable) + 1];
|
||
char *debug_dir;
|
||
|
||
- strcpy(debug_directories, SYSTEM_DEBUG_DIR);
|
||
+ strcpy(debug_directories, debug_directories_immutable);
|
||
|
||
debug_dir = strtok (debug_directories, ":");
|
||
while (debug_dir != NULL)
|
||
--
|
||
2.38.1
|
||
|