diff --git a/src/os-linux.c b/src/os-linux.c index 1cc9ba52..652d6f2f 100644 --- a/src/os-linux.c +++ b/src/os-linux.c @@ -37,6 +37,7 @@ tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, struct map_iterator mi; int found = 0, rc; unsigned long hi; + char debug_path[PATH_MAX]; if (maps_init (&mi, pid) < 0) return -1; @@ -57,7 +58,12 @@ tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, { strncpy(path, mi.path, pathlen); } - rc = elf_map_image (ei, mi.path); + snprintf (debug_path, sizeof (debug_path), "/usr/lib/debug%s", mi.path); + rc = elf_map_image (ei, debug_path); + if (rc != 0) + { + rc = elf_map_image (ei, mi.path); + } maps_close (&mi); return rc; }