summaryrefslogtreecommitdiffstats
path: root/libdwfl/find-debuginfo.c
diff options
context:
space:
mode:
authorRoland McGrath <[email protected]>2008-05-07 18:37:14 +0000
committerRoland McGrath <[email protected]>2008-05-07 18:37:14 +0000
commit0fa20e84d7ac183bd3e270d825a557d879921b9c (patch)
tree1356d752f00fab130c759919b76573d411bc8353 /libdwfl/find-debuginfo.c
parent9897d66b4ec33c24719d0974b17db6fe9ea16c8e (diff)
libdwfl/
2008-05-06 Roland McGrath <[email protected]> * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Use FTS_LOGICAL here too. (dwfl_linux_kernel_find_elf): Likewise.
Diffstat (limited to 'libdwfl/find-debuginfo.c')
-rw-r--r--libdwfl/find-debuginfo.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/libdwfl/find-debuginfo.c b/libdwfl/find-debuginfo.c
index f1ff3a4b..a01293e8 100644
--- a/libdwfl/find-debuginfo.c
+++ b/libdwfl/find-debuginfo.c
@@ -1,5 +1,5 @@
/* Standard find_debuginfo callback for libdwfl.
- Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
+ Copyright (C) 2005, 2006, 2007, 2008 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -242,7 +242,23 @@ dwfl_standard_find_debuginfo (Dwfl_Module *mod,
}
/* Failing that, search the path by name. */
- return find_debuginfo_in_path (mod, file_name, debuglink_file, debuglink_crc,
- debuginfo_file_name);
+ int fd = find_debuginfo_in_path (mod, file_name,
+ debuglink_file, debuglink_crc,
+ debuginfo_file_name);
+
+ if (fd < 0 && errno == 0)
+ {
+ /* If FILE_NAME is a symlink, the debug file might be associated
+ with the symlink target name instead. */
+
+ char *canon = canonicalize_file_name (file_name);
+ if (canon != NULL && strcmp (file_name, canon))
+ fd = find_debuginfo_in_path (mod, canon,
+ debuglink_file, debuglink_crc,
+ debuginfo_file_name);
+ free (canon);
+ }
+
+ return fd;
}
INTDEF (dwfl_standard_find_debuginfo)